Page tree

Versions Compared

Key

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

...

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  need to be followed when both creating and upgrading a language pack.

...

STEP 2: Check if the files below are located in the the /usr/local/voipnow/bin/langutils folder.

...

Note
Do not move the keys from one file to another! Translate each file keeping the directory structure generated in the the /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:

Shell
/usr/local/voipnow/bin/langutils/translation/language_packs/de-DE-1996/language/de-DE-1996
STEP 6: Validate your translation. To do so, use the the /local/voipnow/bin/langutils/lpvalidatepack.php script:
Shell
php /usr/local/voipnow/bin/langutils/lpvalidatepack.php -r <path_to_lp_version_in_English> -t <path_to_translated_structure>
An interactive menu will ask you for some 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).
Copy the translated files in your working directory. In our example, we assume your translation is in:
Shell
cp -r /usr/local/voipnow/bin/langutils/translation/language_packs/de-DE-1996/language /usr/local/voipnow/bin/langutils/translation/de-DE-1996
Copy the the en language pack to the /path/to/working/dir/ folder using the following command:
Shell
cp -r /usr/local/voipnow/admin/htdocs/language/en /usr/local/voipnow/bin/langutils/translation/en
Validate your translation using the the lpvalidatepack.php script. Type:
Shell
php /usr/local/voipnow/bin/langutils/lpvalidatepack.php -r /usr/local/voipnow/bin/langutils/translation/en/ -t /usr/local/voipnow/bin/langutils/translation/de-DE-1996/
The following message will be displayed in the console:
Shell

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

STEP 7: Fix the errors, if necessary. When executing the previous step, some errors might occur. For more information, please see the Possible Errors section below.

...

Note
titlePay 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 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:

Shell

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

cp -r language/de-DE-1996/ de-DE-1996/

STEP 3: Run the the 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:
Shell

php /usr/local/voipnow/bin/langutils/lpvalidatepack.php -r /usr/local/voipnow/bin/langutils/translation/en/ -t /usr/local/voipnow/bin/langutils/translation/language/de-DE-1996/ -f

#2 Error:  Some Some keys might be missing from the translation files.

...

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:

Shell

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

cp -r language/de-DE-1996/ de-DE-1996/

STEP 3: Run the the lpvalidatepack.php script to verify your translation.
Shell
php /usr/local/voipnow/bin/langutils/lpvalidatepack.php -r /usr/local/voipnow/bin/langutils/translation/en/ -t /usr/local/voipnow/bin/langutils/translation/de-DE-1996/

...

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