This document provides information for translators of phrases from cPanel & WHM's locale system.
Suggested translation workflow
We suggest that developers and translators use the following workflow: Developers use WHM's Locale XML Upload interface (WHM >> Home >> Locale >> Locale XML Upload) to import the updated locale information. Note: For help to distribute locale lexicons to many servers, read our Distribute a Custom Locale documentation.
We suggest that developers and translators use the following workflow:
Developers use WHM's Locale XML Upload interface (WHM >> Home >> Locale >> Locale XML Upload) to import the updated locale information.
For help to distribute locale lexicons to many servers, read our Distribute a Custom Locale documentation.
The XLIFF format
XML Localization Interchange File Format (XLIFF) is an XML-based format that standardizes the way in which tools pass data. The locale system does not run on XLIFF-formatted data, but does use the format to import and export locale system data. Because of this fact, it is important to understand XLIFF files before you begin the translation process.
XLIFF files appear similar to the following example:
XLIFF files will contain the following elements:
file— A single extracted file and its information. The
fileelement may contain the following additional information:
trans-unit— A translation unit. This element contains
For more information, read the XLIFF 1.2 Specification documentation.
cPanel-specific XLIFF elements
In addition to XLIFF's default elements, cPanel uses the following custom attributes in its XLIFF files:
cp:ref— A value that references another
- For example, a
<ph>element that contains the
quant()bracket notation method will also contain a
cp:refattribute references the
idvalue for the
<group>element that contains that
- For example, a
cp:meta-note— A string that contains metadata that may be useful to cPanel or to the translation service.
cp:replace— An internal attribute that cPanel uses to identify the original potion of a phrase to replace with the element's rendered context.
cp:lexicon-key— An internal attribute that cPanel uses to map a
<source>phrase to its arbitrary key in the locale's lexicon.
Bracket notation for translators
The locale system uses bracket notation to mark the dynamic potions of translated phrases. Bracket notation is additional markup within a translated phrase, surrounded with brackets (
The following examples list some of the ways in which developers might use bracket notation:
- References to variables (for example,
“[_1]“ is not a valid domain name.).
- Locale-specific number formatting (for example,
Page [numf,_1] of [numf,_2]).
- Output-agnostic links (for example,
To complete your request, [output,url,_1,click here].).
- Locale-specific noun quantization (for example,
The system will retain data for [quant,_1,day,days].).
The following bracket notation example uses the
quant() method, which is common in locale system phrases. This method displays a variable amount of a resource or content (for example, memory or files).
These examples use the following localized phrase:
In an XLIFF file, this phrase returns the following
In English, quantities use a simple "one or other" structure.
- If the value is
quant()method returns the first option (
- If the value is more than
quant()method returns the second option (
This results in the following group code for the English file:
Some languages (for example, Russian) have complex rules, which result in many plural categories, and the following group code: