18.md 1.4 KB

["11. Localization and Languages"]

Localization and Languages

Since ArOZ Online v24-12-2019, localization support is now added. The system display language can be translated in real time on document ready. The system translation is done via real time javascript key replacement method. The localization translation is done with the following process.

  1. Check if the user has selected a localized language of the system
  2. Load the corresponding json file which contains all the text “localtext” keys and translation as value.
  3. Replace the content of the document object with the value of the localization json if key found.

Under normal situation, the system localization language file should be located under SystemAOB/system/lang/*.json where * is the shorthand name of the language and the location of the content. Here is an example of the translation syntax used in system index, source localization file and the output.

>>index.html

…  <a href="index.php" **class**="item localtext" localtext="index/menu/title">ArOZ Online β</a> … 

\>>zh-hk.json

{  "lang":"zh-HK",  "author":"tobychui",  "version":"1.0",  "Keys":{    …     "index/menu/title":"ArOZ 在線作業系統",   … } }



\>>Output (On browser source after translation)

<a href="index.php" class="item localtext" localtext="index/menu/title">ArOZ 在線作業系統</a>

Please see ao_module_initLocalTranslation for more information.