Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated using 4PSA automated script

...

STEP 1: Copy the translated structure to your working directory.

Shell

cd /usr/local/voipnow/bin/langutils/translation

cp -r /usr/local/voipnow/bin/langutils/translation/language_diff_folder/language/en /usr/local/voipnow/bin/langutils/translation/diff_oldVersion_newVersion_languageCode

STEP 2: Run the lpmerge.php script using the following command:
Shell
php /usr/local/voipnow/bin/langutils/lpmerge.php -o <old_translation> -n <new_translation> -r <reference_lp> -f
where:
Shell
-o <old_translation> - The file or directory structure containing the old language pack translated in the desired language.
-n <new_translation> - The file or directory structure containing the differences between the old and the new language packs, translated in the desired language.
-r <reference_lp> - The file or the directory structure containing the language pack for the reference version, usually the latest version available for English.
-f - This flag is optional and should be used to skip checking for untranslated keys.
An interactive menu will ask you for supplementary information:
Shell

The ISO language code of the language chosen for translation.

The name of the translated language.

The VoipNow version the translation was made for (e.g. 3.0.0).

For our example , assuming that the folder containing the differences was copied to /usr/local/voipnow/bin/langutils/translation and it is named diff_253_300_es, the following commands must be run:
Shell

cd /usr/local/voipnow/bin/langutils/translation

/usr/local/httpsa/php53/php/php /usr/local/voipnow/bin/langutils/lpmerge.php -o /usr/local/voipnow/bin/langutils/translation/253es -n /usr/local/voipnow/bin/langutils/translation/diff_253_300_es -r /usr/local/voipnow/bin/langutils/translation/en

The following messages will be displayed in the console:
Shell

Please enter the ISO language code you want to create the language pack for (eg: en): es-ES

Please enter the language name for es-ES (e.g. English): Spanish

For which 4PSA VoipNow version is this language pack (e.g. 3.0.0): 3.0.0

STEP 3:  When there are no PHP errors and untranslated keys, a confirmation message is displayed and you can use the generated archive to upload it to your web interface.
Shell

The validation process has ended successfully.

You can take the tar archive from /usr/local/voipnow/bin/langutils/translation/voipnow300_Spanish.tar.gz. Congratulations!

STEP 4 (optional): If errors occurred in errors occurred in the generation process of the language pack, you must address them according to the below section.

...

STEP 1: Edit the file where the problem was reported and reported and search for the //NOT-TRANSLATED text. In our example, the file detected with keys not translated is located at language/es-ES/api/soap/common.php.  

Warning
Not all keys marked with //NOT-TRANSLATED can or should be translated!

...

Note
titlePay attention to the reported file!
Your translation files are in our example located in: /usr/local/voipnow/bin/langutils/translation/diff_253_300_es or in /usr/local/voipnow/bin/langutils/translation/253es. The files containing translation errors are located in:   /usr/local/voipnow/bin/langutils/translation/language/es-ES/

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/ es-ES /). After having all these lines 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:

Shell
cp -r /usr/local/voipnow/bin/langutils/translation/language/es-ES/ /usr/local/voipnow/bin/langutils/translation/diff_253_300_es
STEP 3: Run the lpmerge.php script script as described in How to Do It again 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, lpmerge.php will exit with error. If you are confident that all the keys that can be translated are in order, use the lpmerge.php script with -f  (force) in order to generate the language archive. Example:
Shell
php /usr/local/voipnow/bin/langutils/lpmerge.php -o /usr/local/voipnow/bin/langutils/translation/253es -n /usr/local/voipnow/bin/langutils/translation/diff_253_300_es -r /usr/local/voipnow/bin/langutils/translation/en -f

...

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/es-ES/). After having all the missing lines translated, you must replace the folder containing the differences with the repaired one. To do so, please type:

Shell
cp -r /usr/local/voipnow/bin/langutils/translation/language/es-ES/ /usr/local/voipnow/bin/langutils/translation/diff_253_300_es
STEP 3: Run the lpvalidatepack.php script script as described in in How to Do It

Error: There are PHP errors in your translation files

...

STEP 2: After fixing the error, run the lpmerge.php script script as described in in How to Do It:

Shell
php /usr/local/voipnow/bin/langutils/lpmerge.php php \
-o /usr/local/voipnow/bin/langutils/translation/253es 253es
-n /usr/local/voipnow/bin/langutils/translation/diff_253_300_es \
-r /usr/local/voipnow/bin/langutils/translation/en

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.