Heroku does not seem to be loading config/locales/pt.yml. (Language is being set correctly to pt.)
I18n is working perfectly on localhost, but not on my heroku server.
Code is at https://github.com/aneves/deficit-puzzle
localhost:
$ rails console
Loading development environment (Rails 3.0.5)
irb(main):001:0> I18n.t(:Edit)
=> "Editar"
heroku:
$ heroku console
Ruby console for deficit-puzzle.heroku.com
>> I18n.t(:Edit)
=> "translation missing: pt.Edit"
possible dups:
There are SO matches for my problem, but those are dead threads. I do not want to open a bounty on a thread whose OP left comments unanswered, I’d rather have a good question with good follow up. Also, the questions do not pinpoint the problem accurately and, so, the answers miss the point.
Curiously, data were appearing in
I18n.backendas expected but were not individually selectable usingI18n.tThis 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
If future readers are on ruby-1.9 consider reading about common encoding problems.