Midcom 3 does now gettext
Posted on 2008-07-17 12:18:20 EEST.
Last days when I've had some time I've been thinking about implementing finally the gettext support for MidCOM 3. Now it's finally done. Some cleaning up things with templating may be required.
Gettext UI localization should be context safe, every component has it's own translator context and naturally all translations happen per component level.
As a component developer point of view it requires setting the locale - folder inside the component. There is a normal gettext folder structure. Currently system only supports "default" language that is configured at midcom_core's confifuration until i18n service has been implemented in order to change UI language more easily.
Usage at TAL is quite simple. Just put for example <div i18n:translate="string:welcome_message">Welcome here</div>. String:welcome_message is the string found in translation files.
More information about TAL namespacing and TAL-gettext
And usage of gettext itself http://www.onlamp.com/pub/a/php/2002/06/13/php.html
Have fun!
