Skip to content

Instantly share code, notes, and snippets.

@datt
Last active December 17, 2015 09:49
Show Gist options
  • Save datt/5590674 to your computer and use it in GitHub Desktop.
Save datt/5590674 to your computer and use it in GitHub Desktop.
Using Internationalization(I18n) in javascript of Rails application.
//= require i18n
//= require i18n/translations
/**NOTE : for internationalization set default to english */
I18n.defaultLocale = "en";
I18n.locale = "en";
//Example usage in javascript
I18n.t("swing_analysis_help_text.1.paragraphs")
#NOTE Rails I18n translations on the Javascript.
gem 'i18n-js','2.1.2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment