Reputation: 155
I using the i18n for internationalization. but, occur the problem as blow.
config/locales/view/en.yml: expects it to return a hash, but does not
Although, I write yml with correct intent (2 space, no tap),
error is occur.
How could I resolve the problem ?
en.yml
en:
moderna:
language:
en: English
jp: Japanese
kr: Korean
menu:
company: Company
home: Home
submenu:
company:
history: History
introduce: Introduce
philosophy: Philosophy
subsidiary: Subsidiary
vision: Vision
erb
<%= link_to t("moderna.menu.home"), xx_path %>
<%= link_to t("moderna.submenu.company.introduce"), introduce_path %>
<%= link_to t("moderna.submenu.company.history"), history_path %>
<%= link_to t("moderna.submenu.company.philosophy"), philosophy_path %>
<%= link_to t("moderna.submenu.company.subsidiary"), subsidiary_path %>
<%= link_to t("moderna.submenu.company.vision"), vision_path %>
Upvotes: 3
Views: 7633
Reputation: 155
I found the cause. When you use i18n in project
should be generate file of internalization with different name.
config/locales/default/en.yml
config/locales/default/kr.yml
config/locales/model/en.yml
config/locales/model/kr.yml
engines/hoge_engines/config/locales/default/en.yml
engines/hoge_engines/config/locales/default/kr.yml
engines/hoge_engines/config/locales/modle/en.yml
engines/hoge_engines/config/locales/model/kr.yml
=> maybe occur error.[can not load translations from ~~~~~] so, I changed the file name as blow
config/locales/default/default_en.yml
config/locales/default/default_kr.yml
config/locales/model/model_en.yml
config/locales/model/model_kr.yml
engines/hoge_engines/config/locales/default/default_en.yml
engines/hoge_engines/config/locales/default/default_kr.yml
engines/hoge_engines/config/locales/modle/model_en.yml
engines/hoge_engines/config/locales/model/model_kr.yml
Upvotes: 2