当前位置: 动力学知识库 > 问答 > 编程问答 >

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.

网友答案:

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?

分享给朋友:
您可能感兴趣的文章:
随机阅读: