Translating Plesk GUI Messages

We recommend using a text editor which supports highlighting syntax for editing the locale files. Using such an editor makes translating more comfortable, and also helps you detect accidental changes to the syntax of the files.

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

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

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

PHP array syntax

# It is important that commas at the end of each string are not removed. Otherwise, the PHP array will be corrupted, and Plesk GUI will display localization keys instead of the translated messages.

# Pay attention to the usage of quotation marks. Follow these guidelines to avoid making a mistake:

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

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

  • precede each quote with a backslash:
<span class="prefred">'b_add_ip_for_clients'</span> => <span class="prefred">'Add IP address to client\'s pools.'</span>,

or

  • enclose the message in double quotes:
<span class="prefred">'b_add_ip_for_clients'</span> => <span class="prefred">"Add IP address to client's pools."</span>,

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

  • precede each quote with a backslash:
<span class="prefred">'odbc__mysql_option'</span> => <span class="prefred">"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>"</span>,

or

  • enclose the message in single quotes:
<span class="prefred">'odbc__mysql_option'</span> => <span class="prefred">'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>'</span>,
Variables

Pay special attention to the messages that contain variables:

  • Leave variables as they are, do not translate them.
  • Translate the running text of a message carefully, taking into account the meaning of the variable. Think of how the message will look in the Plesk GUI once the actual value has been substituted for the variable.

The following types of variables are used in the locale files:

%%<variable-name>%%

For example, the message string 'The IP address %%ip_address%% was assigned to %%client_name%%.' may look like this in the Plesk GUI once the variables have been replaced:

The IP address 192.0.2.68 was assigned to John Doe.

Variables can substituted with other messages, as well as values taken from the Plesk operation context. For example:

<span class="prefred">    'secureSettingsDescription'</span> => <span class="prefred">'If you want the provided hosting to be the most secure, %%link%%. Note that some of the permissions, if granted, let subscribers change these settings. %%helpLink%%.'</span>,
    <span class="prefred">'secureSettingsLink'</span> => <span class="prefred">'apply secure settings preset'</span>,
    <span class="prefred">'secureSettingsHelpLink'</span> => <span class="prefred">'Learn about secure hosting setting'</span>,

Here, variables %%link%% and %%helpLink%% are substituted with the messages defined by the secureSettingsLink and secureSettingsHelpLink variables, respectively. So, the resulting message in Plesk looks as follows:

If you want the provided hosting to be the most secure, apply secure settings preset. Note that some of the permissions, if granted, let subscribers change these settings. Learn about secure hosting setting.

%<number>

For example, the message string 'The domain resolves to another IP address (%1). Please correct DNS settings.' may look like this in the Plesk GUI once the variables have been replaced:

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

Such variables may replace almost anything. In each string, the meaning of a particular variable of such type depends on the context. The value of the variable is dynamically set by Plesk when it displays the message in GUI.

HTML Entities and Special Characters

Do not translate the following items:

  • HTML entities

    for example, <, > used for defining "<" and ">" symbols.

  • special characters

    for example, \n used for defining a new line.