In this chapter, we will discuss the details of Business Manager localization.
Before you start translating Business Manager to a certain language, export the American English (en-US) locale by copying the file en.php
. This file is located in the following directory:
/opt/plesk-billing/lib/lib-billing/include/translations/en.php
%plesk_dir%\billing\lib\lib-billing\include\translations
Then change the name of your copy to the two-letter code of your language. To find the code of a certain language, see the Appendix: Locale codes.
Business Manager locale files are PHP files with simple associative arrays made up of records like
"<localization_key>" => "<message>",
where
<localization_key>
uniquely identifies a GUI item.<message>
is the message corresponding to the GUI item, appearing as either a GUI or a contextual help text.The localization task is to translate all string parts containing messages (<message>
), leaving localization keys and string syntax as they are.
Note: locale messages can contain HTML source text, be sure to preserve the HTML syntax during the translation, too.
The section Translating Plesk GUI Messages provides more information on translating locale strings.
After you complete editing locale files, we recommend that you validate the new locale file after translation to avoid possible problems caused by breaking the PHP syntax.
To validate the translated files:
#php -l <file-name>
for example,
#php -l conhelp_pt-BR.php
To import the new locale to Business Manager:
/opt/plesk-billing/lib/lib-billing/include/translations/
%plesk_dir%\billing\lib\lib-billing\include\translations
# usr/share/plesk-billing/cache --clear --type locale
> C:\Program Files\Parallels\Plesk\bin\billing-cache.exe --clear --type locale
In addition to creating new locales, you can change existing GUI messages in Business Manager, for example, if you find default names or descriptions not suitable for your business.
To change an existing Business Manager locale:
.custom.php
in the directory with the default locale you want to change. Here <locale> is the abbreviation used for the locale, for example, en
for the English locale.Note: If you correct keys directly in the corresponding locale file <locale>.php
, your changes may be lost since Business Manager completely overwrites these files during upgrades.
<?php
$translation_keys = array(
);
# usr/share/plesk-billing/cache --clear
> C:\Program Files\Parallels\Plesk\bin\billing-cache.exe --clear