Skip to content

Multi lang

Frederic Bardin edited this page Oct 17, 2020 · 2 revisions

Multi-lang

Multi-lang is integrated in phpMyHue.


Select interface language

English is the default but, during installation, you can choose another language among the translations available in the package.

This language can be switch again after installation by updating the 'LANG' parameter in file 'include/config.php'.
You have to reload the page to see any change in the language configuration (lang parameter or file content change)


Lang files

Lang files are stored into 'lang' directory in json format.
Their are named "text_LG.json" where "LG" is the lang code used in the config.php file (ie. text_en.json for english).

The file is filled by "code=value" pairs where the code name is the concatenated english text and the value its translation as displayed in the interface.
To be correctly displayed, all language specific characters must be stored in UTF-8 encoding.


Create a new file

To create a new lang file, copy the "text_en.json" under the new target lang code then replace all english values by their translation.
New displayed texts are always added at the end of file, so it is easy to identify the missing text in a personnal translation file by comparing it with "text_en.json".


Submit a new lang file

New language translations files are welcome.

You can add a "TranslationAuthor" entry at the 1st line of your file, it'll be displayed in the 'about' tab when your file is used.
(ie : {"TranslationAuthor":"my name, email, date","Translation":"<translation of Translation>",...)

To submit one, you need a github account, then use the issue system as follow :

  • In the project page, click on "Issues" then on "New issue" button
  • Zip your "text_NEW LANG.json" file then drag or select it into the issue frame
  • Add a comment like "Submisson" of lang file for NEW LANGUAGE
  • Submit the issue

I will be warned of your submission then, if the file content appears to be correct, it will be integrated in the project.

You can also submit updates this way.

Clone this wiki locally