Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active January 13, 2016 04:01
Show Gist options
  • Select an option

  • Save YumaInaura/5a93ed2feddfa672ec75 to your computer and use it in GitHub Desktop.

Select an option

Save YumaInaura/5a93ed2feddfa672ec75 to your computer and use it in GitHub Desktop.
Rails | i18n で 言語を強制指定する方法 ref: http://qiita.com/Yinaura/items/f8a5efdfa2f975a094ac
en:
message: It is English
I18n.t('message', locale: :en)
# => It is English
I18n.t('message', locale: :ja)
# => これは日本語です
I18n.t('en.message')
# => "translation missing: en.en.message"
I18n.t('ja.message')
# => "translation missing: ja.ja.message"
ja:
message: これは日本語です
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment