| Home | 最新文章 | 登入 | 申請網誌

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.

 




按此回應 回應的RSS 暫時未有引用通告  (0)


Comments »

暫時未有回應

Trackback 路徑: http://chwong1.mocasting.com/main/wp-trackback.php/158503


 

nice! (0)


回應

電郵地址不會被顯示

:  (必須填寫)

:  (必須填寫)

:  

:  
(必須填寫)

:  authimage

友好連結:m-Friends|HKWBBS|HKWCHAT|網上食譜|數碼攝影網

| 1