Configure I18n fallbacks on Heroku

I have tried everything to make the i18n Fallback on Heroku but I couldn't. I don't want to get the "translation missing messages". It work OK on developement mode.

Please help!

thanks

require "i18n/backend/fallbacks"
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
I18n.fallbacks.map(:es => [:en])
config.i18n.fallbacks = true

Upvotes: 1

Views: 804

Answers (2)

Kadu Diógenes
Kadu Diógenes

Reputation: 507

I have this in my application.rb file:

config.i18n.fallbacks = [:en]

and I just commented this code in production.rb:

config.i18n.fallbacks = true

and it's working ok for me in heroku.

Upvotes: 3

Hilde
Hilde

Reputation: 456

In config/enviroments/production.rb

class Appname::Application.configure do
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation can not be found)
  config.i18n.fallbacks = true
end

how to use rails i18n fallback features

Upvotes: -1

Related Questions