Questions tagged [i18n-gem]

Ruby internationalization and localization solution.

Ruby internationalization and localization solution.

For more information, see the official GitHub repository of the project.

105 questions
4
votes
0 answers

i18n-js Gem not locating necessary files

So I have an application which is using Rails 3.1.3, and gets deployed under Jruby. We allow the users to import their own themes (so their own CSS content) and for that reason we do not pre-compile our assets in production (I am aware of…
4
votes
3 answers

gem for translating ruby I18n strings on rails app from the browser/frontend?

Is there an up2date gem out to edit the whole rails i18n strings from the frontend? and to edit your translations from the webbrowser? There once was this great gem: https://github.com/archan937/e9s-demo screencast: http://vimeo.com/17050431 Which…
Rubytastic
  • 15,001
  • 18
  • 87
  • 175
3
votes
2 answers

Is there a tool to convert i18n yaml files to gettext po format?

I'd like to convert rails i18n yaml files to gettext po format. I tried https://github.com/pejuko/i18n-translators-tools but it doesn't worked as expected in my case. Any suggestion?
eolo999
  • 863
  • 6
  • 13
3
votes
5 answers

Not setting default locale in Rails 3.1.3

Not setting default_locale in Rails 3.1.3 application.rb: config.i18n.default_locale = :en I have got 3 locales (en,es and ca) And when i go to my console: I18n.locale => :ca # I guess the first one in the array I am using Gettext. Somebody got a…
Michael Koper
  • 9,586
  • 7
  • 45
  • 59
3
votes
1 answer

Pick random I18n translation with parameters

On one of my contact form, there is a pre-filled message so the candidates avoid bad messages and have an initial good basis to work with. So far I was using a single message_template, but I'd like to introduce some variety with a random list. My…
Cyril Duchon-Doris
  • 12,964
  • 9
  • 77
  • 164
3
votes
1 answer

How can I add keys to I18n for tests?

I'm working on a feature in a Rails app that depends on a locale-specific piece of information. In testing, I want to show that some behavior depends on what the locale contains. How can I dynamically add or edit translations to be used by I18n.t in…
Nathan Long
  • 122,748
  • 97
  • 336
  • 451
3
votes
1 answer

Middleman and I18n: having some issues

I have activated I18n in middleman like so: activate :i18n, mount_at_root: :de Now I'd like to be redirected from / to /de automatically. Is this possible? Also, I wonder why middleman auto-assigns class index (for german) and en_index (for…
Joshua Muheim
  • 12,617
  • 9
  • 76
  • 152
3
votes
1 answer

Redirect when using I18n with Rails is encoding the forward slash as %2F

I was recently following Ryan Bate's Railscast on I18n adding multiple locations and setting the locale from the URL Params like www.example.com/en/ www.example.com/fr/ Generally it works a treat, however I've noticed that if I manually try to…
Gareth Jones
  • 1,760
  • 1
  • 14
  • 24
3
votes
1 answer

actionmailer set host dynamic based on .LTD app.com/ app.fr

Im having 2 different languages in my rails app and would like to be able to set the domain name set in the right language. For example if a user registers from app.FR I want in below example the extension .FR used instead of .COM is there a way to…
3
votes
1 answer

i18n formatted text

I have a question regarding the best practise of handling formated text when using i18n. For example, let say I have a about us page with multiple paragraphs, bullet points etc. (keeping in mind that I dont want to change the template directly every…
luxerama
  • 1,109
  • 2
  • 14
  • 31
3
votes
2 answers

I18n translation in Rails console doesn't show proper Chinese (or any other language)

So we're using I18n to localize our website to traditional Chinese I have a zh-TW.yml file under directory config/locales I'm trying to see that the translation works in Rails Console. So I tried: 1.9.3-p0 :001 > I18n.default_locale => :zh 1.9.3-p0…
Zack Xu
  • 11,505
  • 9
  • 70
  • 78
2
votes
1 answer

i18n search using tire and Globalize3

i have a site that uses globalize3 gem (https://github.com/svenfuchs/globalize3) and i'm currently adding the Tire gem to make site search. How do i do to Index a table translations depending on the actual locale? right now the model that gets…
2
votes
1 answer

Use custom locale in devise emails

I am using devise_invitable gem in rails and I have configured a number of locales in my rails app. What I would like to do is to invite a user with a locale I would specify myself. I t could look something like this: User.invite!(:email =>…
rpechayr
  • 1,282
  • 12
  • 27
2
votes
0 answers

Seed Database With 'find_or_create_by' Adding Garbage Values

I am using find_or_create_by method to seed a MySQL database like that: Translation.where(:locale => 'en', :key => 'A0000', :value => 'a').first_or_create I am using Translation class from i18n library for a purpose. And corresponding MySQL table…
Melih
  • 666
  • 1
  • 9
  • 24
2
votes
1 answer

Ruby i18n.translate having :raise => true as default behaviour

When i call: t 'to_translate' method from my template, I would like it to raise an error without actually passing second parameter like this: t 'to_translate', :raise => true It would save me a lot of typing in every translation I do. Or is there…
Martin Svoboda
  • 297
  • 1
  • 4
  • 18