languages

By default Mongoid adds the I18n translation file for English. However adding new languages is easy. In your application initializer (for Rails 3 it can be in config/initializers/mongoid.rb), just add the code:

# Add the Spanish exception translations.
Mongoid.add_language("es")

Available languages for Mongoid are:

  • bg: Bulgarian
  • de: German
  • en: English
  • es: Spanish
  • fr: French
  • hi: Hindi
  • hu: Hungarian
  • id: Indonesian
  • it: Italian
  • ja: Japan
  • kr: Korean
  • nl: Dutch
  • pl: Polish
  • pt-br: Brazilian Portuguese
  • pt: Portuguese
  • ro: Romanian
  • ru: Russian
  • sv: Swedish
  • vi: Vietnamese
  • zh-CN: Chinese

You can also just include them all by:

Mongoid.add_language("*")