Translating GUI and Contextual Help Messages

In this section:

Files Structure

Translation Tips

Files Structure

Files messages_<locale>.php and conhelp_<locale>.php have a simple structure presenting an associative array made up of records like

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

where

 

To adjust these files so that the Plesk GUI was displayed to users in a particular language, translate all string parts containing messages (<message>), 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 in Plesk instead of the corresponding message.

 

Translation Tips

For editing locale-defining PHP files, 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.

Note: Use editor that supports editing texts in UTF-8.

 

There is a number of recommendations that might be useful when translating these files, specifically, concerning PHP array syntax, message variables, HTML entities, and special characters.

Important: Do not change the files encoding: It must be UTF-8. Otherwise, the messages you'vee translated may be displayed incorrectly.

 

Array syntax

# It is important that commas at the end of each string were left where they are. 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>',

 

Variables

When translating Plesk interface and contextual help messages, pay special attention to the messages containing variables:

The following types of variables are used:

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

    For example, if we have Plesk 8.0 for Unix 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.0 for Unix you should agree to the terms of this license.

  2. %%<variable-name>%% - variables of this type are used in messages_[locale].php files.

    For example, if the IP address is 192.0.2.68, the client name is John Doe, and the file

    messages_en-US.php contains the string

    'ui__client/domain/properties__client_ip_address_was_assigned' => 'The IP address %%ip_address%% was assigned to %%client_name%%.',

    then the corresponding message in Plesk GUI looks as The IP address 192.0.2.68 was assigned to John Doe.

  3. %1, %2, etc. - this type is used in messages_[locale].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