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>
CODE

<mgrname> — abbreviated name of the control panel. The file <mgrname>_msg_sv.xml should be named according to the name of the panel, that is, the BILLmanager file will be named billmgr_msg_<language>.xml, and the VMmanager file will be named vmmgr_msg_<language>.xml, etc.

Abbreviated names of control panels:

  • ispmgr — ISPmanager;
  • billmgr — BILLmanager;
  • vmmgr — VMmanager KVM or Cloud;
  • vemgr — VMmanager OVZ;
  • dcimgr — DCImanager;
  • ipmgr — IPmanager;
  • dnsmgr — DNSmanager.

<sv> — language code. Use an arbitrary value.

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>
CODE

Svenska — language name.

sv — language code. Use the value you specified in the <mgrname>_msg_<sv>.xml file.

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

killall core
CODE

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.

  1. 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
    CODE

    <mgrname> — abbreviated name of the control panel. Possible values:

      • ispmgr — ISPmanager;
      • billmgr — BILLmanager;
      • vmmgr — VMmanager KVM or Cloud;
      • vemgr — VMmanager OVZ;
      • dcimgr — DCImanager;
      • ipmgr — IPmanager;
      • dnsmgr — DNSmanager.

    <sv> — language code. Use an arbitrary value.

  2. 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.
  3. Translate the messages in the file from English to Swedish.
  4. For the changes to take effect, restart the control panel:

    killall core
    CODE