This article describes how to add a new language to the control panel. Swedish is taken as an example.
How to add a language to the panel
To make a new language appear in the language selection field, create the /usr/local/mgr5/etc/xml/<mgrname>_msg_<sv>.xml file with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<mgrdata>
<lang name="sv">
</lang>
</mgrdata>
To display the language name in the control panel, create the /usr/local/mgr5/etc/xml/core_mod_sv.xml file with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<mgrdata>
<lang name="en">
<messages name="label_langs">
<msg name="sv">Svenska</msg>
</messages>
</lang>
</mgrdata>
After both files have been added, restart the command control panel:
killall core
In the panel, you will be able to select the Swedish language on the authorization page or on the page for changing the user's language.
How to translate the panel interface
Once the new language is added, you can translate the control panel interface into that language.
-
Take the English message file <mgrname>_msg_en.xml as a base and copy it:
cp /usr/local/mgr5/etc/xml/<mgrname>_msg_en.xml /usr/local/mgr5/etc/xml/<mgrname>_msg_<sv>.xml
Comments - In the new file <ispmgr>_msg_sv.xml change <lang name="en"> to <lang name="sv">. You will get a file for the Swedish language, which already has all possible control panel messages.
- Translate the messages in the file from English to Swedish.
-
For the changes to take effect, restart the control panel:
killall core