Skip to content
Michael-X-Net edited this page Feb 3, 2023 · 1 revision

##Internationalization translation manual:

###Introduction: Internationalization adopts a template format similar to jinjia2, and the following format can be found in the html file: {{ _("English version text") }}

Generally html is stored in $module/web_ui/

And the translation of each language is placed in $module/lang/$LANG/LC_MESSAGES/messages.po Among them, the simplified Chinese $LANG is zh_CN, and the traditional Chinese is zh_TW. Because English is used as the index of the translation dictionary, if the translation cannot be found, it is directly realized in English.

###Add a new language (Traditional Chinese as an example)

  • Create translation files Create $module/lang/zh_TW/LC_MESSAGES/ directory $module is each module, currently including: launcher, gae_proxy, x_tunnel mkdir -p launcher/lang/zh_TW/LC_MESSAGES/ gae_proxy/lang/zh_TW/LC_MESSAGES/ x_tunnel/lang/zh_TW/LC_MESSAGES/

  • Copy the Simplified Chinese translation file: cp launcher/lang/zh_CN/LC_MESSAGES/messages.po launcher/lang/zh_TW/LC_MESSAGES/messages.po cp gae_proxy/lang/zh_CN/LC_MESSAGES/messages.po gae_proxy/lang/zh_TW/LC_MESSAGES/messages.po cp x_tunnel/lang/zh_CN/LC_MESSAGES/messages.po x_tunnel/lang/zh_TW/LC_MESSAGES/messages.po

  • Modify $module/pybabel_update.sh Refer to the style inside and add the corresponding language

  • Modify launcher/web_ui/config.html Add a new language option on line 10

###translate
Edit each messages.po with a text editor file

###Update the translation file according to the html content During development, you need to change or add new text, after modifying html, execute $module/pybabel_update.sh in the corresponding directory Fields can be automatically updated in the po file

###test
Refresh the interface to see the effect

Clone this wiki locally