Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

This page describes how to obtain language pack differences.

Overview

VoipNow is improved with each release. Some of the generated language pack messages might be outdated or new ones might need to be added. To upgrade an existing translation you need to obtain the differences between an older language pack version and the one currently installed and to create the translated language pack of the currently installed VoipNow version.

Preparation

You need to identify the scripts needed for the translation process and to bring together all the needed data.  The needed language pack versions are:

  • last translated version of the language you need to translate
  • English language pack corresponding to the above version
  • English language pack corresponding to the version you want to translate to

The standard VoipNow distribution comes with a couple of scripts that help you create and install language packs. First we must make sure sure that we have all the scripts needed for the translation:

STEP 1: Log in to your server as root using either SSH from Linux or Putty from Windows.

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

  • lpfunctions.php
  • lpmerge.php
  • lpvalidatepack.php
  • lpverkeydiff.php
  • lpreplicate.php

Then we need to bring together the translation files involved in process:

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
STEP 4: Copy the English language pack of the version for which you already have a translation. To do so, download the English file from our Github repository, then copy it on the server and untar the downloaded file in a folder with a suggestive name.

STEP 5: Copy your older translated version of the language pack in the working directory.

STEP 6: Replicate the language folder used by currently version of VoipNow and its APIs. To do so from your working directory, run the /usr/local/voipnow/bin/langutils/lpreplicate.php script. It will generate a folder with the structure described here, adapted to your language pack. Please type:

php /usr/local/voipnow/bin/langutils/lpreplicate.php <the_code_of_the_language_you_want_to_translate>
The output resulted after running the lpreplicate.php script can be found in the current directory. The replicated folder will be named after the language code you have earlier provided in the script.

For a better understanding, here is an example. Let us assume that you already have the VoipNow language pack translated in Spanish for version 2.5.3 and you want to upgrade the files to version 3.0.0. After executing STEP 1 to STEP 6 described before, in the /usr/local/voipnow/bin/langutils/translation folder, you should have the following files: 253en - The folder that contains the English language pack for version 2.5.3 obtained from STEP 4. Bellow there are some commands that might help you to fulfill this step:

cd /usr/local/voipnow/bin/langutils/translation
wget "http://www.4psa.com/docs/lp/voipnow253_English.tar.gz" -O voipnow253_English.tar.gz
tar -xzvf voipnow253_English.tar.gz
mv en 253en
253es - The folder that contains the Spanish language pack for version 2.5.3 obtained from STEP 5
cd /usr/local/voipnow/bin/langutils/translation
mkdir 253es
tar -xzvf voipnow253_Spanish.tar.gz -C 253es
en - The folder that contains the English language pack for version 3.0.0 obtained from STEP 6
cd /usr/local/voipnow/bin/langutils/translation
php /usr/local/voipnow/bin/langutils/lpreplicate.php en
mv /usr/local/voipnow/bin/langutils/translation/language_packs/en en

Obtain differences

Next we need to find out what keys were changed since last version translated.

STEP 1: Run the lpverkeydiff.php script to obtain the differences from the previous version. Type:

php /usr/local/voipnow/bin/langutils/lpverkeydiff.php \
-o <path_to_old_language_pack_version_in_english> \
-n <path_to_new_lp_version_in_english>
For our example, the command is:
cd /usr/local/voipnow/bin/langutils/translation
php /usr/local/voipnow/bin/langutils/lpverkeydiff.php -o 253en -n en
The following message will be displayed in the console:

A changelog has been created in /usr/local/voipnow/bin/langutils/translation/change.log

You can copy the folder with the differences between the language pack versions from /usr/local/voipnow/bin/langutils/translation/language_diff_folder

STEP 2: Translate the language keys. The keys you should translate are located in the /usr/local/voipnow/bin/langutils/translation/language_diff_folder/language/en folder. The general folder structure is described here.

Do not move the keys from one file to another! Translate each file keeping the directory structure generated in the language_diff_folder.
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels

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