I18n

Internationalization/localization features in Workarea allow for translation/customization of static content (including message content and JavaScript content) and translation of administrable content.

Note: Internationalization/localization in Workarea relies heavily on Rails I18n and Mongoid Localization. The preceding links provide excellent explanations of those features, so they are recommended reading.

Customizing Text

Rails I18n features are useful even if your app has only a single locale. Use I18n to customize static text strings, such as the content of success, failure, and warning messages.

Translating Text

Of course, your app may also use multiple locales to provide static content translations and translation of administrable content.

To use multiple locales, start by configuring locales.

Determining the Current Locale

Workarea determines the current locale by looking for a locale prefix in the request URL.

Given an app with en (default), es, and de locales, the following table demonstrates how each URL maps to a locale.

URL Locale
http://example.com/categories/sale en (default)
http://example.com/en/categories/sale en
http://example.com/es/categories/sale es
http://example.com/de/categories/sale de
Now on GitHub