Skip to content

Instantly share code, notes, and snippets.

@eliza-abraham
Forked from datt/Gemfile
Created November 11, 2013 09:16
Show Gist options
  • Save eliza-abraham/7410271 to your computer and use it in GitHub Desktop.
Save eliza-abraham/7410271 to your computer and use it in GitHub Desktop.
Using Internationalisation in JS files in a Rails Project
//= 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