czn8xa
Last Updated: July 03, 2016
·
2.172K
· nosolopau

Get rid of the Mongoid translation missing errors (Mongoid 4.0 & Rails 4.0)

If you are using Mongoid with an internationalised application, you will find that Mongoid tries to translate some errors. Since the major part of these errors are useful only for developers you may want to use english instead of translating them.

Picture
To fix this, you need to change your application.rb file, adding:

# Configure fallbacks for mongoid errors:
require "i18n/backend/fallbacks"
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
config.i18n.fallbacks = {'es' => 'en'}

Then you will need to restart your server. Now you should get:

Picture

:)

3 Responses
Add your response

17891

That was really annoying.. Thank you!

over 1 year ago ·
18152

WOW, thank you so much

over 1 year ago ·
27608
config.i18n.fallbacks = { 'de' => 'en' } 

is enough in normal rails 4 applications

over 1 year ago ·