Problems adding translation to rails, wrong encoding?
I have some weird problems when I try to add some additional languages to my rails application. I guess that it has something to do with character encoding, but I have no clue where to start looking.
irb(main):001:0> I18n.available_loca开发者_如何学Cles
=> [:en, :se]
irb(main):002:0> I18n.available_locales.include? :en
=> true
irb(main):003:0> I18n.available_locales.include? :se
=> false
I have config.encoding = "utf-8" set in my application.rb and I have made se.yml in UTF-8.
If someone has any pointers where i should start looking, I would greatly appriciate it.
Well, it seems to be working now. Between now and when I wrote the question a lot have happend with my app, so I can't really say what solved it.
However, I suspect it was some missmatch with the encoding of the files. When I had the problems I was writing all the text in Notepad++ on Windows. However, I switched to Linux and now I'm writing the project in gedit.
Seems like you are executing this code inside the irb interpreter. Can you try to execute it in the rails console?
精彩评论