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