Translator documentation
From Dolibarr Wiki
Contents
|
Translate Dolibarr into another language
Dolibarr languages files are translated in several languages. French and English are by default always complete. Other languages depends on contributions. This tutorial can help you to complete a translation that does not exists or is not correct for another language.
There are 4 methods for translating Dolibarr (1 automatic: autotranslator, 3 manual: phpLangEditor, iniTranslation and the completely manual method). They are in order of preference:
Automatic Translation with autotranslator.php tool
- Translator OS: All
- Tool: autotranslator.php provided with Dolibarr 2.5.1 and higher in directory dev/translation.
To make or update all files of a language code, just run the script:
php autotranslator.php lang_code_source lang_code_target
For example :
php autotranslator.php en_US pt_PT
to translate into Portuguese (pt_PT) using English (en_US) files.
All non existing files will be created, all existing files will be update. The tool use Google translation service to find the translation value of a string, so a working Internet connection is required from station running the script. Your PHP must also have permissions to write into htdocs/langs directory and must have curl functions available.
Manual Translation with the Firefox plugin phpLangEditor
- Translator OS: All
- Tool: phpLangEditor (plugin for Firefox)
This is step to follow to make a translation using the Firefox plugin:
- Install Firefox and install version 2.5.2 or higher of plugin phpLangEditor (File:PhpLangEditor254.xpi)
- A further step is required to complete the installation. Type into URL field, the text about:config then in the Filter field, enter phplangeditor. Double click on the line phpLangEditor.file.typeOfLangExt and put ini in field. phpLangEditor is now ready to translate Dolibarr.
- From Firefox, open phpLangEditor by selecting the menu Tools -> PHP lang editor.
- Click on "Open reference file" and choose your file. Lang original (eg in your Dolibarr, htdocs / lang / en_US / bills.lang
- Click 'Open file translation and select the file containing the translation, if a file exists (eg htdocs / lang / es_ES / bills.lang).
- You can choose to display all the words to translate the words or only non-translated. Click on the term in the left column to translate it into the box below. You can also use keyboard shortcuts such as CTRL + N to move to the next
- Save the file once the translation is finished.
- Edit the file with a text editor to remove or correct the first comment line. Indeed, with phpLangEditor, it is not possible to translate the lines Discussed (starting with #), the file contains translated once recorded the comment line of the source file. A small manual editing is needed to correct or delete this line, although this does not adversely affect the proper functioning of the new file. Lang.
Manual Translation with iniTranslator
- Translator OS: Windows
- Tool: iniTranslator (Windows).
This is steps to follow to make a translation using iniTranslator :
- Run your application translation will ask the template file (For example, under iniTranslator, do File - Open Original). Choose the source model in the directory htdocs / lang / en_US or htdocs / lang / en_US, which are up to date.
- Then choose the destination file may, in the directory htdocs / lang / xx_XX or xx is the language code to translate.
- Your tools will display the files 2 face to face with the missing strings to translate.
- Complete files.
- Save the new destination file.
Attention, iniTranslator has a serious defect. It does not retain the original order of the parameters and the generated file sorting alphabetically rather than keys in the order of the source file. In addition, areas comments source files are not reflected in the destination file translated.
Manual translation
To translate Dolibarr into another language, go to the langs directory and create a folder named with the code language to translate (Following the same format as those already existing, for example en_US, en_GB, es_ES, de_DE, etc.. ..). Then copy the files from a directory lang already translated (for example en_US / or main.lang en_GB / bills.lang), copy them into the directory of the new language that we have just created and bring the contents of these files.
These files are the following:
Code1 = translate phrases 1 Code2 = translate phrases 2 ... Coden = translate phrases n
Only sentences are = right to translate the code should remain unchanged. It is possible to translate the files one by one, without bringing them all at once. If a file has not been translated into the new language, Dolibarr use English.
Note that for the moment, there are still many tough sentences in the code of PHP pages. These must be replaced with the following code:
$langs->trans("CodeX")
And an entry type
CodeX = phrase X
must be added to the files. lang
Integrate its translation into Dolibarr
If you have completed existing but incomplete .lang files
- You can submit your changes by creating a patch using the procedure described on the FAQ page developer in "Without access CVS ecriture.
If you have created new .lang files for a new language, you can:
- Send your file by mail attachment to the list: dolibarr-dev@nongnu.org. Un développeur les intégrera pour vous. A developer to integrate.
Note: There are 2 master languages, all 2 always complete:
- English (file. Lang directory lang / en_US)
- French (file. Lang directory lang / fr_FR)
You can use indifferently one or the other (which arrange) as a reference because the 2 are up to date. All other language files are likely to be incomplete.
Distribute your translation
Into official Dolibarr CVS sources
The best thing after making a translation, is to include it on official version of Dolibarr. This is possible, if you know how to use a CVS system. You can request to have a write access on Dolibarr CVS with a Z-6PO grade for your language.
As a separate addon file
When you create a new language, if it is not integrated into Dolibarr, it can still be spread to others. You can build a package to distribute the script build/makepack-dolibarrlang.pl
The .tgz made file just needs to be unzipped in the directory Dolibarr that language is available. This file can be posted to the website http://www.dolibarr.org in area "download modules / addon" or the mailing list developer dolibarr-dev@nongnu.org of Dolibarr.
Translate documentation on wiki
The wiki is written in 3 languages: English, French and Spanish. If you want to enhance documentation on one of this language, all you have to do is to create an account on this wiki. Then, you can edit existing pages to correct a bad translation or translate pages waiting for translation on page Category:Page_waiting_for_translation.

