Localizing Plesk

In this chapter, we will discuss the details of Plesk localization.

Preparing for Translation

To prepare locale files for translation:

  1. Export the American English (en-US) locale by copying the locale directories and files. The list of these files is provided in the Plesk Locale Files section.
  2. Change the locale code in the copied locale files and directories. To learn what exactly you need to change, see the Changing Locale Code section.
  3. (Optional) Merge the 'new-style' locale files. In other words, convert a large number of locale files into a few for easier translation. The instructions on merging files are provided in the Merging 'New-Style' Locale Files section.
Translating GUI Messages

Plesk locale files are PHP files with simple associative arrays made up of records like

'<localization_key>' => '<message>',

or

'<localization_key>' => "<message>",

where

  • <localization_key> uniquely identifies a GUI item.
  • <message> is human-readable text describing a particular GUI item, and appearing as either a GUI element or contextual help text.

To translate the Plesk GUI into a particular language, edit the files by translating all string parts containing messages (<message>), leaving localization keys and string syntax intact.

The Translating Plesk GUI Messages section provides more information on translating locale strings.

After you have finished editing the locale files, to avoid possible issues caused by broken PHP syntax, we recommend that you validate the new locale files after translation.

To validate the translated files:

  1. Upload the files to a computer with PHP installed.
  2. Run the following command for every uploaded file:

    #php -l <file-name>

    for example,

    #php -l conhelp_pt-BR.php

Importing the New Locale

To import the new locale into Plesk:

  1. If you have merged files for translation, split the merged files before importing the locale into Plesk. Find the instructions on splitting merged files in the Splitting 'New-Style' Locale Files section.
  2. Add the new locale to Plesk by copying the directories containing the new locale files to the corresponding locations on the file system.
  3. Register the new locale in Plesk by running the following commands:
    • On Linux:

      # mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e "replace into locales values ('<xx-YY>', 'true')"

    • On Windows:

      >cd /D "%plesk_dir%\Databases\MySQL\bin"

      >mysql -P8306 -uadmin -p<Plesk admin password> psa -e "replace into locales values ('<xx-YY>', 'true')"

    Where <xx_YY> is the code of your locale.

In this chapter:

Plesk Locale Files

Changing the Locale Code

Merging the 'New-Style' Locale Files

Translating Plesk GUI Messages

Splitting the 'New-Style' Locale Files

Importing the New Locale into Plesk

 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.