### How Language Pack Works

All the information about language pack strings is contained in the XML files stored on your Management Node.

Each language pack consists of the following files:

- strings.xml - the main localization file for a given language pack. Contains all commonly used strings.
- countries.xml - the default string IDs for names of countries.
- states_ca.xml - the default string IDs for Canadian states
- states_us.xml - the default string IDs for US states

Localization files for each language pack are stored in a special directories, each set of files in a separate directory. The common path for such directories is

`/var/opt/hspc-root/i18n`

and each language pack is stored in a separate directory named by the two-letter language identification string in accordance with the ISO 639 language codes, thus, the `country_code` in the package name above actually can be EN for the English language pack, DE - for the German one, etc.

For example, the English language pack is stored in the

`/var/opt/hspc-root/i18n/EN`

directory. And the German language pack is stored in the

`/var/opt/hspc-root/i18n/DE`

directory, and so on.

Each set of language pack files can include a set of additional XML files containing non-common strings used only for plug-ins and other modules.

HSPcomplete loads the files on startup and uses them in accordance with the personal interface settings of a user logged in to the HSPcomplete.

Localization files are not encrypted, and represented in the UTF encoding by default, so anyone can see which string IDs and values are used in HSPcomplete.

The example of XML file containing strings for OnlineNIC plug-in:

<?xml version="1.0" encoding="iso-8859-1"?>

<strings lang="en" convert_to_utf="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="strings.xsd">

<string>

<id>dm_onlnic_title</id>

<c>DM|OnlineNIC|Title</c>

<en>OnlineNIC</en>

</string>

<string>

<id>dm_onlnic_host</id>

<c>DM|OnlineNIC|API Gateway host</c>

<en>API Host</en>

</string>

<string>

<id>dm_onlnic_port</id>

<c>DM|OnlineNIC|API Gateway port</c>

<en>Port</en>

</string>

<string>

<id>dm_onlnic_cust_id</id>

<c>DM|OnlineNIC|Customer ID</c>

<en>Customer ID</en>

</string>

</strings>

The <strings> tag opens and closes the localization file and has the following parameters:

- lang - the required parameter specifying the language. The lang value is a two-letters lower-case language identification, according to ISO 639. For example,

  <strings lang="en" > for English localization.

- convert_to_utf - the parameter specifying whether a localization file will be converted into UTF encoding or not. By default, all files are converted into UTF.

  convert_to_utf="1" - yes, convert to UTF,

  convert_to_utf="0" - no, do not convert to UTF, view file in a native encoding.

Foe example, <strings lang="en" convert_to_utf="0"> means that the file contains the English localization strings, this file is not converted into UTF and to be viewed in a native encoding that corresponds to a language.

The format for a localization string is the following (for example, we consider the English localization):

String | Description
<string> | A string description starts.
<id>string_id</id> | The <id> tag contains a string alphanumerical identifier (ID). The string-id can be replaced with any combination of letters, digits, or underscores (A-Z, a-z, 0-9, _). This must be the one line, without line breaks.
<c>comment</c> | The <c> tag contains a free-form comment to a string. Letters, digits, spaces and any other symbols can be used in a comment. This must be the one line, without line breaks.
<en>string</en> | This tag must be named by a corresponding language two-letter lower-case code, similarly to the lang parameter value in the <strings> tag. In our example, we consider the English localization, so the tag is named as <en>. For Germagn language, it must be <de>, etc. This language-code tag contains the string itself. This must be the one line, without line breaks.
</string> | A string description finished.

Please send us your feedback on this help page