Plesk

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:

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>]

where

For example, to merge the files in all 3 directories, and have the
resulting files in the /tmp directory under the names
shared.php, admin-panel.php, and control-panel.php
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.

Exit mobile version