1

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
  • According to what I know, to use fallback, you must pass a default value to I18n. See https://github.com/svenfuchs/i18n/wiki/Fallbacks. If it can't found any value, it will show the the "translation missing messages". – Blue Smith Sep 27 '12 at 10:40

2 Answers2

3

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.

Kadu Diógenes
  • 508
  • 1
  • 6
  • 19
-1

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

Community
  • 1
  • 1
Hilde
  • 428
  • 5
  • 12