heroku not loading language file

前端 未结 5 613
北恋
北恋 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:56

    Curiously, data were appearing in I18n.backend as expected but were not individually selectable using I18n.t

    This led to the realization that the load path must be configured correctly for Rails to find the translation files, but that it was not parsing them properly.

    This led to @ANeves discovering that a BOM was disrupting Heroku's ability to parse the files which resulted in the fix of removing the offending BOM.


    Wikipedia on BOM in UTF-8

    The Unicode Standard does permit the BOM in UTF-8, but does not require or recommend its use. Byte order has no meaning in UTF-8 so in UTF-8 the BOM serves only to identify a text stream or file as UTF-8.

    Many Windows programs (including Windows Notepad) add BOMs to UTF-8 files by default.

    If future readers are on ruby-1.9 consider reading about common encoding problems.

提交回复
热议问题