To customize store localization strings for an existing language pack, edit a PHP file located in the /var/opt/hspc-frontend/includes/languages directory. In this case, please keep in mind that your customization will be re-written with standard strings during upgrade. To avoid this, back up the file before upgrade installation and after an upgrade is installed, merge the customized strings back.
Flags icons are located in the /var/opt/hspc-frontend/images/flags directory. Flags icons are named like flag_<country code>.gif. It is required that a flag icon must be named like this and be in the GIF format. Flag size is to be 18x12 pxls.
If you want to add a new language to be used in store, then you will need to:
The procedure of Parallels Business Automation - Standard language packs customization is described in details later in this document. Please look through this chapter before you start customizing store localization.
Now we describe this procedure in details.
To add a new language definition:
/var/opt/hspc-root/i18n/ directory. Remember that a new directory must be named by a two-letter language code in upper case, following the ISO 639 language codes.language.xml
strings.xml
countries.xml
states_ca.xml
states_us.xml
language.xml and do the following:lang parameter, this parameter must be re-set to a new language pack:<?xml version="1.0" encoding="iso-8859-1"?>
<strings lang="new_language_code" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="strings.xsd">
Where new_language_code is a two-letter language definition according to , but in lower case.
strings.xml file leave only one definition for a new language name, the string ID you add will be later used in a language definition file:<string>
<id>lang_<country code>_uc</id>
<c>interface language name</c>
<val>New language name</val>
</string>
Where <country code> is to be replaced with a language ISO 639 two-letter code in lower case to form a string ID, and New language name is a language name to be shown in interface, for example, like English.
<?xml version="1.0" encoding="iso-8859-1"?>
<strings lang="new_language_code" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="strings.xsd">
</strings>
These strings are used in Parallels Business Automation - Standard tools only and since you do not need to use a new language pack in any Parallels Business Automation - Standard tools except for store (store uses own localization), leave empty files in a new language pack directory. Now you need only a language pack definition.
language.xml file:<?xml version="1.0" encoding="iso-8859-1"?>
String |
Comment |
<language id="<language code>" title="New language title"> |
Set parameters' values in the <language> tag: replace <language code> with a language ISO 639 two-letter code in lower case, and New language title - with a new language name. |
<title_id>Language name string ID</title_id> |
Replace the Language name string ID with a language name string IS you have assigned in the strings.xml file, see item 3b. |
<flag_icon_id>flag_<language code></flag_icon_id> |
Replace <language code> with language ISO 639 two-letter code in lower case |
|
|
<charset>iso-8859-1</charset> <utf8_map>ISO_8859-1</utf8_map> <dateformat>%d-%b-%Y</dateformat> <datetimeformat>%d-%b-%Y, %H:%M</datetimeformat> <timeformat>%H:%M</timeformat> <posixlocale>en_US.utf8</posixlocale> |
These tags can be left unchanged unless you exactly know what values to use. Since you customize store localization, these settings do not play an important role. In case of problems, contact support. |
</language>
/etc/init.d/hspcd restart
To add a new language to PHP store:
includes/languages directory. Important: Store localization file is a PHP file containing constants definition. Thus, it is very important to escape quotation marks in constants values. Back slash is to be escaped as well.
includes/languages directory.images/flags directory. Flag icons are to be named strictly as follows: flag_<language ISO 639 two-letter code in lower case>. For example, for English language, flag icon is to be named flag_en.gif. Flag icon size is to be 18x12 pxls.