README.textile

A Database Backend For Rails I18N

Stores your translations in the database, rather than yaml files. As you tag items with i18n.t() throughout your code base, all untranslated items are marked and added to the database. An admin panel is provided so translators can quickly translate untranslated text. All lookups occur in a cache store of your choice prior to hitting the database.

DISCLAIMER!

In implementing this into another project, I realized that the currency support is currently broken. It basically boils down to the i18n gem accessing some of the Rails i18n yaml’s in a different way than others. In this case, it’s requesting a parent key, and expects a hash to be returned containing the children. This is not baked in the plugin at the moment, and any contributions toward this would be well received. Thank you wlorentson!

The translations_controller is unprotected, and you’ll probably want to add some kind of authorization filter to it to make sure the outside world can’t access it.

Pluralization is handled by passing in a “count” key value pair, which is a unique interpolation value.

I18n.t("You are {{count}} years old", :count => 100)

Links to external documents that need to be translated should be tagged as well.

I18n.t('http://www.elctech.com/core')

All fragment cache view blocks need to have their keys prepended with the current locale.

cache("#{I18n.locale}-footer_#{controller.action_name}")

Date/Time localization is handled by using the I18n.l method. The format used will be :default (see next item for explanation).

I18n.l(@user.joined_at)

Date/Time localization can take a format parameter that corresponds to a key in the translations table (the Rails defaults :default, :short, and :long are available). We could in theory create our own like en.date.formats.espn_default.