Skip to content

Instantly share code, notes, and snippets.

@osamu
Created October 31, 2020 14:50
Show Gist options
  • Save osamu/331044e25173f44d95f621195d76057a to your computer and use it in GitHub Desktop.
Save osamu/331044e25173f44d95f621195d76057a to your computer and use it in GitHub Desktop.
Debug i18n on Rails
irb(main):002:0> I18n.t "views.mypage.menu.postguide"
D, [2020-10-31T14:34:36.213031 #1] DEBUG -- : [i18n-debug] ja.views.mypage.menu.postguide => "投稿した台本"
=> "投稿した台本"
irb(main):003:0> y = YAML.load_file('config/locales/ja.yml'); y['ja']['views']['mypage']['menu']['postguide']
=> "ガイド管理"
結果
config/locales/en.ymlに、 'ja'をkeyにしたツリーが混入
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment