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

ActionView::Template::Error (uninitialized constant I18n::RESERVED_KEYS)

I am running a rails 3 app with ruby 1.9.3. Heroku gives me an error 500 with this message in heroku logs: Started GET "/" for 90.3.47.58 at 2014-03-20 08:42:50 +0000 Completed 500 Internal Server Error in 176ms

<%= t('.title_html')…

boussac
  • 125
  • 8
0
votes
2 answers

Rails - Current URL without locale part passed

In my Rails app I scope locale into my urls: http://localhost:3000/de/blah/blubb http://localhost:3000/en/blah/blubb http://localhost:3000/es/blah/blubb ^^^ How can I "get" the current_url without the locale…
Jan
  • 12,992
  • 9
  • 53
  • 89
0
votes
1 answer

How to use pg_search in a multi-lingual website?

If I understand the pg_search documentation well, there is only one table storing "searchable" documents for the entire website, so my question is: Is there any way, other than filtering the search results by language, that allows to do a…
0
votes
2 answers

How to setup locales for Rails 4

i have a rather specific setup regarding rails internationalization. I'm using rails-i18n gem, but that shouldn't matter. It worked perfectly with Rails 3. Here is my config from config/application.rb config.i18n.default_locale =…
danijel
  • 576
  • 4
  • 10
0
votes
1 answer

number_to_currency gives "can't convert symbol to integer" error

I'm using the method number_to_currency and i keep getting an error. Here's what i've tried: = number_to_currency(233) and: = number_to_currency(233, locale: :en) and they both raise he error: can't convert Symbol into Integer Any ideas why this…
Uri Klar
  • 3,800
  • 3
  • 37
  • 75
0
votes
3 answers

Load languages files with I18n

I have a problem to load files with I18n. Befor I had all my translations in only one file called fr.yml. But I decied to split them in some files like clubs.fr.yml, searcher.fr.yml ... The problem it that I18n apparently only load fr.yml. Here my…
0
votes
2 answers

How select the default value when loading edit form

customer_gender is a array of array. I want to select the current value on edit form But it didn't work. I think the problem is the gender's value is not a number but a string, How to solve this problem if the value is a string customer_gender=…
newBike
  • 14,385
  • 29
  • 109
  • 192
0
votes
2 answers

Versioning for Rails i18n translations

I'm in the process of building a volunteer based translation engine for a new site built in Rails 4.0. Since it's volunteer based, there is always the possibility that a user may enter a translation that others do not agree with, accidentally remove…
Godwin
  • 9,739
  • 6
  • 40
  • 58
0
votes
1 answer

What's wrong with this locales.yml file structure and how to fix it? (rails project)

Assuming that I have views/admin/, views/user/, controller/admin/, controller/user/ (etc) folders, what's the right way to structure my locales.yml file so it works properly? Right now, it looks like this: en: views: admin: index: …
0
votes
1 answer

Add translation for Model Translations

Is it possible to translate "SettingsTranslation" in this pic. I tried to add different things to my yml files / tried with placing label but no luck so far.
FastSolutions
  • 1,809
  • 1
  • 25
  • 49
0
votes
1 answer

RAILS I18n: How to use @ in translation key?

Here is in our yml file: Or make up unique one like login@a.com : 'test' But here is the error on view page for I18n.t("Or make up unique one like login@a.com"): translation missing: zh-CN.Or make up unique one like login@a.com What causes the…
user938363
  • 9,990
  • 38
  • 137
  • 303
0
votes
2 answers

After installing I18n in Rails Spree application rake db:migrate does not work and methods and pages cannot be found

In my Ruby on Rails Spree Commerce app I try to run bundle exec rake railties:install:migrations bundle exec rake db:migrate via ssh on the server since I think that will solve some issues I am having with methods that cannot be found (e.g.,…
user2609980
  • 10,264
  • 15
  • 74
  • 143
0
votes
1 answer

Translation bundling error in Ruby on Rails

I've recently updated my Ruby on Rails project and then when I try to run the rake i18n:js:export command, I'm getting the following error uninitialized constant I18n::INTERPOLATION_PATTERN This happens in both windows 8.1 and centos6 machines. My…
Mujahid
  • 1,227
  • 5
  • 32
  • 62
0
votes
1 answer

Store default translation if key is missing

I am trying to store a default translation if a translation is missing in Rails. After much struggle I came up with this: backend = I18n.backend if not backend.exists?(locale, key) backend.store_translations(locale, {key => locale.to_s + "-" +…
Omid Kamangar
  • 5,768
  • 9
  • 40
  • 69
0
votes
2 answers

rails-i18n not working for header error

I'm using the rails-i18n gem to use :hr for my main language. The gem works but for header message it doesn't. (The 4 errors prohibited this list from being saved: part) This is what I get when I submit the form with invalid atributes: 4 errors…
Vucko
  • 20,555
  • 10
  • 56
  • 107