UI translations - Order to chaos
Posted on 2008-09-09 09:28:55 EEST.
For MidCOM 3 the work of implementing gettext support is almost done. Most of the translation requests come from TAL templating. Some may come directly from the PHP - code and that requires some nice i18n API function.
A quick bus trip thinking about the flow of the translation spawned a requirement of a new helper component for MidCOM 3 that is midcom.helper.translator. If fact it's functionality is quite simple. It provides three key functionalities
A quick bus trip thinking about the flow of the translation spawned a requirement of a new helper component for MidCOM 3 that is midcom.helper.translator. If fact it's functionality is quite simple. It provides three key functionalities
- Collector that goes through every component's all PHP and TAL files and looks for certain function calls. It also reads translations that are already made. Then it writes the results to database in order to provide easier access for the translation UI itself
- The very UI for translations that makes it easy to browse and input translation entries. Especially strings that are not translated should be easily accessible
- Exporter functionality is required for writing .po files to corresponding component's locales folder and running msgfmt command to that translation file in order to generate the gettext binary
