Add the i18n-js gem to your gemfile.
Before you can really start using the localizations, you have to set the current locale. Do this in your application.html.erb file. (But it doesn’t really matter where you set it, just do it before the call to translate)
And now just translate the same way you do in your rails app.
Here is an example of my en.yml file.
Using number in your locales with pluralization.
Use a default value when no translation is present.
Use localizations for number formatting.
For more info check Github.
Sign up for our newsletter
Who’s got the mic?
Architecture & Design
Koen Van Der Auwera
Bob Van Landuyt
Nathan de Witte