erucolindo
erucolindo

Reputation: 11

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_locales
=> [: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.

Upvotes: 0

Views: 238

Answers (2)

erucolindo
erucolindo

Reputation: 11

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.

Upvotes: 1

Alex Epelde
Alex Epelde

Reputation: 1739

Seems like you are executing this code inside the irb interpreter. Can you try to execute it in the rails console?

Upvotes: 0

Related Questions