Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.2k views
in Technique[技术] by (71.8m points)

ruby on rails - Heroku and i18n Problems

I'm having trouble getting i18n to work on heroku. I set:

I18n.default_locale = :de

in my environment.rb and the translation is in config/locales/de.yml works perfect on my local machines but not so on Heroku. On heroku everything is in english. I don't think I need a special gem like i18n gem, cause I don't have it on my local machine either. Maybe someone has a solution to this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try to set the default local like this in your config.environment.rb:

Rails::Initializer.run do |config|
  # ...
  config.i18n.default_locale = :de
end

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...