Merging the ‘New-Style’ Locale Files
Locale for the ‘new-style’ Plesk pages is made up of numerous files organized into a complex hierarchy. Handling those multiple files and preserving the hierarchy during the translation can be difficult. You can make the task easier by merging the individual ‘new-style’ locale files into a few larger ones before the translation. After you have translated the few bigger files, split them back before importing the new locale into Plesk.
The contents of the following directories can be merged:
Controls used on the ‘new-style’ Plesk pages, shared by Server Administration Panel and Customer Panel.
Server Administration Panel locale.
Customer Panel locale.
You can join the locale files within each of these directories into a separate big locale file.
To join the ‘new-style’ locale files:
Run the following command for each of the directories:
php <plesk-installation-dir>/admin/smb/application/utils/locale/smb2plesk.php -d <target-directory> [-o <output-directory>]
<plesk-installation-dir>is the Plesk installation directory (by default, that’s
/usr/local/psaon Linux and
"C:\Program Files(x86)\%plesk_dir%"on Windows).
<target-directory>is the directory whose contents are to be merged.
<output-directory>is the directory where the resulting file will be created. If not specified, the current directory will be used.
Note: The file name cannot be specified and is always
en-US.php, so be sure to rename it before running the utility to merge the different directory. Otherwise, the file will be overwritten.
For example, to merge the files in all 3 directories, and have the
resulting files in the
/tmp directory under the names
respectively, run the following commands:
# cd /usr/local/psa/admin # php smb/application/utils/locale/smb2plesk.php -d application/default/resources/languages/en-US/ -o /tmp # mv -T /tmp/en-US.php /tmp/shared.php # php smb/application/utils/locale/smb2plesk.php -d application/admin/resources/languages/en-US/ -o /tmp # mv -T /tmp/en-US.php /tmp/admin-panel.php # php smb/application/utils/locale/smb2plesk.php -d application/smb/resources/languages/en-US/ -o /tmp # mv -T /tmp/en-US.php /tmp/control-panel.php
Note: The utility output may contain the following text: “PHP Notice: Undefined variable: content in /usr/local/psa/admin/smb/application/utils/locale/smb2plesk.php on line 170”. It can be ignored.
After you have translated the resulting files, you will need to split them before importing the locale into Plesk. See the Splitting ‘New-Style’ Locale Files section for instructions.