This page describes how to create a VoipNow translation.
Overview
When VoipNow is freshly installed, creating a language pack becomes necessary because at that moment you do not have any of the product's previous language files versions. Translating the English language files into a language of your choice will consume most of your resources and time. The following sections describe in detail the steps that need to be followed when both creating and upgrading a language pack.
How to create a language pack
Several scripts are required when creating a new language pack. Here are the steps that need to be followed:
STEP 1: Log in to your server as root
using either SSH
from Linux or Putty
from Windows.
STEP 2: Check if the files below are located in the /usr/local/voipnow/bin/langutils
folder.
lpfunctions.php
lpmerge.php
lpvalidatepack.php
lpverkeydiff.php
lpreplicate.php
STEP 3: Outside the VoipNow structure, create a special directory for your work and execute the translations steps. For example:
cd /usr/local/voipnow/bin/langutils
mkdir translation
cd translation
php /usr/local/voipnow/bin/langutils/lpreplicate.php <the_language_code_you_want_to_translate>
en
. For example, if you wish to replicate German using the 1996 orthography, then you have to provide the de-DE-1996
language code. The output resulted after running the lpreplicate.php
script can be found in the current directory. For the above example, you will see the language_packs/de-DE-1996
folder.cd /usr/local/voipnow/bin/langutils/translation
php /usr/local/voipnow/bin/langutils/lpreplicate.php de-DE-1996
/usr/local/voipnow/bin/langutils/translation/language_packs/<LANGUAGE_CODE>/language/<LANGUAGE_CODE>/
/usr/local/voipnow/bin/langutils/translation/language_packs/<LANGUAGE_CODE>/language/<LANGUAGE_CODE>/
folder.The files you should translate can be found, in our example, in the following folder:
/local/voipnow/bin/langutils/lpvalidatepack.php
script:en
language pack to the /path/to/working/dir/
folder using the following command:lpvalidatepack.php
script. Type:Please enter the ISO language code you want to create the language pack for (e.g. en): de-DE-1996
Please enter the language name for de-DE-1996 (e.g. English): German
For which 4PSA VoipNow version is this language pack (e.g. 3.0.0): 3.0.0
Possible Errors
This section deals with the errors that might occur when validating the translation and offers a resolution for each one of them.
#1 Error: Some keys might be left untranslated.
In this case, the answer is:
STEP 1: Edit the file where the problem was reported and search for the //NOT-TRANSLATED text. In our example, the file is located at /usr/local/voipnow/bin/langutils/translation/language/de-DE-1996/interface.php
. These are the keys that you forgot to translate.
For example, the following keys must NOT be translated:
$msg_arr['soap2_err_302'|'soap2_err_302'] = '{invalid_password}';//NOT-TRANSLATED $msg_arr['soap2_err_505'|'soap2_err_505'] = '{parent_limitations}';//NOT-TRANSLATED
Some keys cannot be translated into your language:
$msg_arr['btn_ok'|'btn_ok'] = 'Ok';//NOT-TRANSLATED $msg_arr['it_app_rxfax'|'it_app_rxfax'] = 'Fax';//NOT-TRANSLATED
Or maybe you simply forgot to translate some keys:
$msg_arr['btn_enable_client_off'|'btn_enable_client_off'] = 'This client cannot be enabled because the reseller owning the account is disabled';//NOT-TRANSLATED
Pay attention to the reported file!
/usr/local/voipnow/bin/langutils/translation/de-DE-1996/
The files containing translation errors are located in:
/usr/local/voipnow/bin/langutils/translation/language/de-DE-1996/
STEP 2: Translate all the keys that you missed. You can translate the lines marked with //NOT-TRANSLATED in the folder where the errors were reported (in our example /usr/local/voipnow/bin/langutils/translation/language/de-DE-1996/
). Once all these lines have been translated, you must replace the existing language folder with the folder containing the files with all the keys in order. To do so, please type:
cd /usr/local/voipnow/bin/langutils/translation
cp -r language/de-DE-1996/ de-DE-1996/
lpvalidatepack.php
script again to verify your translation. For the lines that must not be translated or for those words that have the same spelling as in English, lpvalidatepack.php
will return the same message //NOT-TRANSLATED every time.After making sure that all the keys that can be translated are in order, use the
lpvalidatepack.php
script with -f
, as in the example below:#2 Error: Some keys might be missing from the translation files.
In this case, the answer is:
STEP 1: Edit the file where the problem was reported and search for the //NEW-KEY text. In our example, the file is located at language/de-DE-1996/interface.php
. These are the supplementary keys that you must translate and include in your language pack.
Pay attention to the reported file! Your translation files are in our example located in:
/usr/local/voipnow/bin/langutils/translation/de-DE-1996/
The files containing translation errors are located in:
/usr/local/voipnow/bin/langutils/translation/language/de-DE-1996/
STEP 2: Translate all the marked keys that you missed from all the reported files. You can translate the lines marked with //NEW-KEY in the folder where the errors were reported (in our example, /usr/local/voipnow/bin/langutils/translation/language/de-DE-1996/
).
As soon as all the missing lines have been translated, you must replace the folder containing differences with the repaired one. To do so, please type:
cd /usr/local/voipnow/bin/langutils/translation
cp -r language/de-DE-1996/ de-DE-1996/
lpvalidatepack.php
script to verify your translation.#3 Error: There are PHP errors in your translation files.
In this case, the answer is:
STEP 1: Edit the file where the problem was reported and search for the reported key, $msg_arr['java_options_max_sip_invalid']. In our example, the file is located at
$msg_arr['java_options_max_sip_invalid'] = 'The 'Maximum number of phone extensions\' value must be a number.(e.g. 40)';
and it should be:
$msg_arr['java_options_max_sip_invalid'] = 'The \'Maximum number of phone extensions\' value must be a number.(e.g. 40)';
STEP 2: After fixing the error, run the lpvalidatepack.php
script again to verify your translation. When there are no PHP errors left and no untranslated keys, a confirmation message will be displayed.
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.