Questions tagged [rails-i18n]

Repository for collecting Locale data for Ruby on Rails I18n as well as other interesting, Rails related I18n stuff.

About

The Ruby I18n (shorthand for internationalization) gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for translating your application to a single custom language other than English or for providing multi-language support in your application.

The process of "internationalization" usually means to abstract all strings and other locale specific bits (such as date or currency formats) out of your application. The process of "localization" means to provide translations and localized formats for these bits.

Links:

  1. Homepage
  2. Guide
778 questions
0
votes
1 answer

Locale does not switch while iterating in Rails

I have extended RefineryCMS blog/admin/posts controller with Export action, which export post to xml and save it to file. I need export all translated versions of post. When I click export it saves all files, but all files have same locale. Is it…
0
votes
1 answer

i18n-tasks command error on Rails 3?

I'm building a new Rails application that's using the i18n-tasks gem, but when I run the command i18n-tasks this output is shown: /home/user-pc/.rvm/gems/ruby-1.9.3-p392@product/gems/i18n-tasks-0.5.1/lib/i18n/tasks/plural_keys.rb:3:in…
0
votes
1 answer

Rails I18n word as a link

In my I18n file i have the following translation: reservation: please_accept: "Please accept regulation" And in my view i'm using it in the following way: = t('reservation.please_accept') Now I want to the word "regulation" be a link to some…
Mateusz Urbański
  • 7,352
  • 15
  • 68
  • 133
0
votes
1 answer

i18n Pluralization of a sentence with few counts

Looks like I got to a real challenge... I want to translate the following sentence: You got XX new messages in YY forums I already used translation pluralization, but this one is different since instead of array of pluralization I need a…
guyaloni
  • 4,972
  • 5
  • 52
  • 92
0
votes
2 answers

Locale Switcher

I am busy going through PBP - Agile Web Development with Rails and implementing the locale switcher. However when I try switch between english and spanish I get a error: No route matches [POST] "/en" My controller is as follows: class…
Toma
  • 239
  • 3
  • 11
0
votes
1 answer

Strip out thousands delineator specific to the locale

I have a rails app in which users input numbers in large quantities. They often use the thousands delimiter (e.g. 1,000,000,000) to help keep their large numbers human-readable (I don't want to disallow delimiter because doing so would increase the…
charlie
  • 181
  • 13
0
votes
1 answer

Rails 4: Change Locale Issue (PRD env. only)

I have a problem when I try to change the locale on my webapp. In dev mode (webrick) all is ok, but when I deploy on my prd env (Unicorn + NGINX) a strange behaviour happens: For each flag i set this link <%= link_to "
Luis C.
  • 727
  • 3
  • 22
  • 34
0
votes
1 answer

When using translate rails 4.1 sets data value incorrectly

I'm saving some translation data in the data attribute of a DOM element. data-save= <%=t :Save%> value= <%=t :Add_Category%> unfortunately when the translation file value has a…
bobbdelsol
  • 996
  • 6
  • 21
0
votes
0 answers

I18n validation deprecation warning

Hi I can't precompile my assets because of this "I18n validation deprecation warning". I've tried the answers here Rails I18n validation deprecation warning but nothing seems to work. I am using rails 3.2.11, windows7 64bt and here's my…
0
votes
1 answer

Is it a bad idea to change my i18n locale file's name

I'm Taiwanese , I saw most people use 'zh-TW' to represents Taiwan language but zh-TW contains special character ? so it has strange behavior in rails console. if I changed my locale to English, it works perfect I18n.locale= :en But failed to …
newBike
  • 14,385
  • 29
  • 109
  • 192
0
votes
1 answer

Locale not set in Application Controller

I've spent the last few hours trying everything possible to make this work, googled, redesigned, tested, etc. - but somehow doesn't get it working. ok, I would like to set the I18n.locale - fairly simple. Basically I implemented what is written on…
0
votes
1 answer

i18n for meta tags in Rails (FB open graph tags to be specific)

I am looking to start supporting different languages with my website. Currently, we have Facebook Open Graph tags for English. If someone in Korea visits our site, they will view our content in Korean. If they decide to share this site to FB, the…
Victor
  • 351
  • 1
  • 7
  • 17
0
votes
0 answers

Rails 4 - Want To Use Hover Image With Locales

I have a Rails 4 application with three locales. I currently use image_tag for people to select their preferred languages using flag images. Here is my Ruby code: <%= link_to_unless_current image_tag("english.jpg", alt: "#{t :english}"), locale:…
0
votes
2 answers

How to do Error Message Interpolation in Rails with Devise?

I have a Rails 3.2 app running with Devise 2.3. I kept the email address as the default authentication key. When a user tries to create a new account with an existing email address, I would like to show him links to the login and to the reset…
somecto
  • 239
  • 2
  • 9
0
votes
2 answers

i18n rails 4 production error. not development

I'm developing a rails 4 application with i18n support. I've installed i18n gem. In my application.rb file I have this code config.i18n.enforce_available_locales = true config.i18n.available_locales = [:es] config.i18n.default_locale = :es In…