Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the I18n fallback features in Rails 3

I am getting an "translation missing" error message from Rails 3:

activerecord:   notices:     messages:       success:          create: "Something was created"     models:       user:         success:           create: "Thanks for registration"  I18n.t("activerecord.notices.models.user.success.create") # => "Thanks for registration"   I18n.t("activerecord.notices.models.book.success.create")  # => "translation missing: de, activerecord, notices, models, book, success, create" 

I don't know why the book model doesn't get the fallback massage. I have set config.i18n.fallbacks = true.

like image 509
antpaw Avatar asked Nov 19 '10 09:11

antpaw


1 Answers

I set in config/application.rb usually

    config.i18n.fallbacks = [:de, :fr, :en] 

So you can declare the order of the fallback.

But keep attention in some environments/*.rb the configuration is overwritten.

like image 136
raskhadafi Avatar answered Oct 03 '22 04:10

raskhadafi