| Path: | app/models/translation.rb |
| Last Update: | Sun May 03 00:50:54 -0500 2009 |
Comas uses GetText for the system translation. GetText is a very powerful, scalable and widely used translation system - But it does not fare very well with dynamic content, as translations must be compiled. That‘s why, for all database-stored content, we introduced this ad-hoc, homegrown and lightweight translation system.
Translation was modelled to be similar in behaviour to GetText - You should populate your database with the strings in the default language. We advise you to stick to English as the default language, as to keep consistency with the rest of the Comas system, even if your installation‘s main language is different.
This system will basically cover two kinds of translation:
To ensure no name collisions on two different domains force you into choosing a single translation for both, catalog rows will be prefixed for translation with the catalog‘s name and a vertical bar
corresponding translation key will be ‘Room|Auditorium’. This qualifier will be automatically dropped when the translation is requested, even if no string has yet been specified (only ‘Auditorium’ will be shown).
To use a Translation-based string, use the for class method:
Translation.for('something to be translated')