MongoDB backend implementation for I18n gem.


  • Ruby 1.8.7 (Ruby 1.9+ untested but should work).

  • I18n 0.5.0

  • Rails 3.0.3


From command line:

gem install mongo-i18n

At rails’ 3 gemfile:

gem 'mongo-i18n'

Usage with Rails 3

I recommend to start with Chain backend while mongodb collection is empty, and move to entirely mongodb-based backend when you populate your database with all I18n messages.

Begin with:

collection =['my_app_related_db'].collection('i18n')
I18n.backend =, I18n.backend)

And finish with:

collection =['my_app_related_db'].collection('i18n')
I18n.backend =

If you are already using a mongodb ORM in your project (and I suppose you are, why else would you be reading this article? :), I recommend using the existing database connection:

collection = MongoMapper.database.collection('i18n')
I18n.backend =


Mongo-I18n is licensed under Apache license. See LICENSE for details.