h2. Intro
This gem takes an other approach to Javascript internationalization than most others do.
I use this in production but you might want to look at it as a proof of concept.
The goal is to build a lightweight, unobtrusive and powerful translation solution for Frontend applications by using standard libraries.
Right now, you'll have to manually provide the following depencencies: Rails, jQuery and Mustache.
h2. Installation
h3. Add the gem to your Gemfile
bc. gem 'internashunalize-js'
h3. Run the generator
bc. rails g internashunalize:js:install
Don't forget to include the javascript in your Html.
h3. Mark translations you want to use in your scripts
bc. <% t(:yml_key, :javascript => true) %>
h3. Place the view helper somewhere in your layout / views
bc. <%= javascript_translations %>
h2. Usage
Start using the marked translations in your Javascript
bc. I18n.t('yml_key')
For interpolating values, you can pass a Json object as second argument
bc. I18n.t('yml_key_with_variable', { your_variable: 'Variable content' })