Translating Interface Messages

To make Parallels Plesk Panel GUI talking to the users in their language, you should translate the following files:

To make Parallels Plesk Panel CLI displaying translated help for the utilities, translate the cli_messages.php file. Keep in mind that translated CLI messages will be properly displayed only if all the following conditions are true:

  1. Resulting LP is set as default in Plesk Panel.
  2. In Windows settings, the LP language is selected to be used in the non-Unicode programs (Windows Control Panel > Regional and Language Options > Advanced tab).

In case you do not translate cli_messages.php, include the file with English strings to your LP, and command line messages will be displayed in US English.

In this section:

Files Structure

Translation Tips

Validating Translated Files

Files Structure

Files that define interface messages have a simple structure which presents an associative array made up of records like

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

where

 

To adjust these files so that the Plesk interface was displayed to users in a particular language, translate all <message> parts leaving localization keys as they are.

Important: Do not translate any of the localization keys. Plesk uses localization keys to link a particular GUI item with the corresponding message, so if you change a key in an LP file, the original key will be displayed instead of the corresponding message.

   

Important: Locale files may contain records with empty messages, which look as follows: '<localization_key>' => ''.
This is done with purpose, and it is important to leave such lines as they are, making no changes to them at all.

Translation Tips

LP Builder provides its own interface for translating GUI and Contextual Help messages which prevents corrupting the interface messages array. If you use LP Builder for translating interface messages, you just translate the content of the right column STRTEXT.

LP Builder project

 

However, you can use your favorite text editor for translating these locale-defining PHP files. If you choose this option, keep in mind the following:

  1. The editor must support working with texts in UTF-8.
  2. We recommend using a text editor which supports highlighting syntax. Using such editors not only makes the translating more comfortable than when using those displaying just plain text, but also, what's more important, helps you detect the file corruption if you change the array syntax.
  3. Do not change the files encoding, it must be UTF-8. Otherwise, the messages you've translated may be displayed incorrectly.

 

There is a number of recommendations that might be useful when translating these files, specifically, concerning message variables, HTML entities, and special characters, and PHP array syntax (important if translating not in LP Builder).

Variables

When translating interface and contextual help messages, pay special attention to the messages which contain variables:

The following types of variables are used:

  1. $PROD_NAME - replaces the nomination of Plesk instance.

    For example, if we have Plesk 8.2 for Windows installed, and the file messages_en-US.php contains the string

    'license__you_should_accept' => "In order to use $PROD_NAME you should agree to the terms of this license.",

    the corresponding message in the Plesk GUI looks as In order to use Plesk 8.2 for Windows you should agree to the terms of this license.

  2. '.PRODUCT_ROOT.' - replaces the nomination of a directory where Plesk is installed. The default installation directory is C:\Program files\Parallels\Plesk\.

    For example, if Plesk is installed to the default location, and the file messages_en-US.php contains the string

    'get_password__admin_password' => 'The administrator\'s password cannot be sent by e-mail for security reasons. You can use the plesksrvclient.exe utility located in '.PRODUCT_ROOT.'admin\bin to set up a new password.',

    the corresponding message in the Plesk GUI looks as The administrator's password cannot be sent by e-mail for security reasons. You can use the plesksrvclient.exe utility located in C:\Program files\Parallels\Plesk\admin\bin to set up a new password..

  3. %%<variable-name>%% - variables of this type are used in messages.php files.

    For example, if the Plesk license key update date is 1 October, 2007, and the file messages_en-US.php contains the string

    'key__license_update_date_hint' => 'The expiration date will be automatically extended when reaching %%license_update_date%%. For more information, refer to the %%help begin:lim_date%%following help topic%%help end:lim_date%%.',

    then the corresponding message in Plesk GUI looks as The expiration date will be automatically extended when reaching Oct 1, 2007. For more information, refer to the following help topic.

  4. %1, %2, etc. - this type is used only in messages.php files. Such variables may replace almost everything: titles of Plesk objects (Domain, Client, IP, etc.), domain, client and other Plesk objects names, error messages, and so on, – in each string, the meaning of a particular variable of such type depends on the context. The variable value is dynamically set by Plesk when it displays the message in its GUI.

    The table below gives an idea of how to understand messages with these variables.

String

Variable Meaning

Message Examples

'clist__info' => '%4 %1 total',

 

%4 - the number of items in a list

100 Domains total

%1 - the Plesk object

30 Clients total

2 Databases total

'__client_with_login_name_already_exists' => "Client with login name \"%1\" already exists.",

%1 - Plesk client login

Client with login name "johndoe" already exists.

'__domain_resolves_to_another_ip' => "The domain resolves to another IP address (%1). Please correct DNS settings.",

%1 - IP address to which a domain resolves

The domain resolves to another IP address (10.0.0.4). Please correct DNS settings.

'__unable_update_cl_data' => "Unable to update client data: %1",

%1 - A phrase stating why updating a client account is impossible.

Unable to update client data: Client with login name "johndoe" exists.

 

HTML Entities; Special Characters

Do not translate

 

Array syntax

# It is important that commas at the end of each string are left where they were. Otherwise, the PHP array will be corrupt and, when using such language pack, Plesk GUI will display pure localization keys instead of the correct messages.

# What else can corrupt the array is mistakes in using quotes. To avoid such mistakes, follow the rules below.

1. If a message text does not contain any quotes, enclose the text with either single or double quotes.

2. If a message text contains at least one single quote or apostrophe:

'b_add_ip_for_clients' => 'Add IP address to client\'s pools.',

or

'b_add_ip_for_clients' => "Add IP address to client's pools.",

3. If a message text contains at least one double quote:

'odbc__mysql_option' => "Options that specify how MyODBC should work. See <a href=\"http://dev.mysql.com/doc/mysql/en/Connection_parameters.html\">http://dev.mysql.com/doc/mysql/en/Connection_parameters.html</a>",

or

'odbc__mysql_option' => 'Options that specify how MyODBC should work. See <a href="http://dev.mysql.com/doc/mysql/en/Connection_parameters.html">http://dev.mysql.com/doc/mysql/en/Connection_parameters.html</a>',