heroku not loading language file

前端 未结 5 619
北恋
北恋 2020-12-06 13:53

Heroku does not seem to be loading config/locales/pt.yml. (Language is being set correctly to pt.)

I18n is working perfectly on localhost,

5条回答
  •  囚心锁ツ
    2020-12-06 13:53

    I ran into a similar issue, but mine was due to having duplicate keys.

    In one file, we defined this:

    en:
      dashboard: "Dashboard"
    

    And another we defined

    en:
      dashboard:
        title: "Some Title"
    

    Locally, I18n.t("dashboard.title") worked just fine, but on production it did not. The reason was probably due to a load order difference between Heroku and my development machine.

    I fixed it by changing the name of the first dashboard key so there was no longer an overlap.

提交回复
热议问题