Plesk

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

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. Add the new locale to Plesk by copying the directories containing the
    new locale files to the corresponding locations on the file system.

  2. 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%DatabasesMySQLbin"
      >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.

Exit mobile version