i18n
These days, I do the internationalization (i18n) for our application. It really a painful process.
There are three parts of the system need to do the i18n:
1) normal HTML (but is template html)
2) python code
3) javascript
For 1), 2), there are a tools to do - itools. Thanks for the creators of these tools, it makes the translation not that painful. And the tutorial is a good start too (i18n made easy).
For 3), the javascript part, I cannot find any good methods to do the i18n. And I found a blog that talks about how to do the i18n in javascript (24 ways: Javascript i18n). This is the start point of my work of i18n the javascript. It talks about how to use the javascript object to be the dictionary for the translation.
Following this direction, I wrote a python script to extract the strings with the pattern `_(”xxxx”)' or `_('xxxx')' and another script to build the javascript dictionary as the 24 ways talks about. But of course, I need to add the hook _(….) to all the strings needed to translate.
All together, I spent a week to build the i18n architecture and extract all the strings to translate. Then, I pass the translation file to my colleague to do the “real” translation.
FYI, there are almost a thousand strings to translate.
(0)
