-
-
Save giedriusr/650ec9d6dbe57faf53c5cd470e0ff1ee to your computer and use it in GitHub Desktop.
Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# My Setup | |
### Gemfile | |
gem 'react-rails' | |
gem 'i18n-js' | |
### app/assets/javascripts/application.js | |
//= require react | |
//= require react_ujs | |
//= require i18n | |
//= require i18n/translations | |
//= require components | |
### app/assets/javascripts/components/EventBook.jsx | |
const text = this.props.is_logged_in ? I18n.t('js_translation') : 'Register and Book'; | |
### app/views/layouts/frontend.html.slim | |
= javascript_tag do | |
I18n.defaultLocale = "#{I18n.locale}"; | |
I18n.locale = "#{I18n.locale}"; | |
### config/locales/en.yml | |
js_translation: "Book EN" | |
### config/locales/lt.yml | |
js_translation: "Book LT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment