Add a new language to the control panel

 

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/_msg_.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>
Comments

After both files have been added, restart the command control panel:

pkill 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 a new language has been added, you can translate the panel to that language.

  1. Take the files with English messages ispmgr_msg_en.xml and core_msg_en.xml as a basis and copy them:
    cp /usr/local/mgr5/etc/xml/ispmgr_msg_en.xml /usr/local/mgr5/etc/xml/ispmgr_msg_sv.xml
    cp /usr/local/mgr5/etc/xml/core_msg_en.xml /usr/local/mgr5/etc/xml/core_msg_sv.xml
  2. As a result, we get Swedish language files that already contain all possible messages that are used in the control panel. All that remains is to translate the messages in the files from English to Swedish.
  3. Translate the messages in the file from English to Swedish.
  4. For the changes to take effect, restart the control panel.