This document explains a regular way of adding new language using the language bundle compiler.
We assume you know what language bundles are.
-
Login as cpanel user under root:
su -
su -l cpanel
All affected files must have cpanel:cpanel ownership.
Create custom bundle directory, e.g., ~shiva/custom/bundles
if it is not created yet.
Set custom bundle location in hsphere.properties (if it's not set):
Important:
Starting with H-Sphere 3.0 RC 1, menu.properties and messages.properties
become deprecated, and all labels are merged into a single hsphere_lang.properties for each language!
CUSTOM_TEMPLATE_BUNDLE=custom.bundles.hsphere_lang
CUSTOM_MENU_BUNDLE=custom.bundles.menu
CUSTOM_USER_BUNDLE=custom.bundles.messages
Add bundles for a new language in the
~shiva/custom/bundles directory.
These files must be named accordingly.
For example, for Portuguese (Brazil):
hsphere_lang_pt_BR.properties
menu_pt_BR.properties
messages_pt_BR.properties
Place translation of default English texts into these newly created files.
Default English text files are located in the default bundle directory:
hsphere_lang.properties
menu.properties
messages.properties
If a label or message has
a variable in curly brackets, e.g. {0}, single quotes and
apostrophes (') must be replaced with two single quotes ('').
For example, in English we write:
search.view_invoice = View Client's Invoice
but:
billing.del_no = No, I don''t want to delete {0}
Note: With upcoming versions of H-Sphere,
default English texts may be changed and new labels may be added,
so you need to
update translation
of your language bundles accordingly.
To ensure that the new language is available to choose from the interface,
add a label for your language (ID and definition) into the
shiva/custom/bundles/hsphere_lang.properties file,
following the pattern:
misc.langs.<XYZ>lang = <LANGUAGE> (<ENCODING>)
Consider this example for the Portuguese (Brazil) language:
misc.langs.ptlang = Portuguese (Brazil)
Add new language to the list of languages available in H-Sphere.
For this, add respective language and encoding to the LANG_LIST parameter
in hsphere.properties. For example:
LANG_LIST = en_US_ISO8859_1|ISO-8859-1:misc.langs.englang pt_BR_ISO-8859-15|ISO-8859-15:misc.langs.ptlang
This line contains definitions for the languages that come with H-Sphere, delimited with
whitespace, each including the following components:
<language>_<COUNTRY>_<ENCODING>|<html_encoding>:misc.langs.<XYZ>lang;
Here, misc.langs.<XYZ>lang; is a label for a language set
in the previous step.
In hsphere.properties, set
system locale and encoding to custom values. The locale should
correspond to the Java ISO standards, the encoding must correspond
to the browser standards. For example, settings for Portuguese (Brazil)
will look as follows:
# Override system locale
LOCALE = pt_BR
# Encoding
ENCODING = ISO-8859-15
# System database encoding
DB_ENCODING=ISO-8859-15
The LOCALE value will affect not only the interface language,
but also the currency, date, time, days of the week and other
locale settings.
Logout back to root and
restart H-Sphere.
1) To have your translation incorporated into the future versions of H-Sphere,
please send the translated files to
support@psoft.net.
2) Language bundles for Portuguese (Brazil) are available for
download
from our site.