Translator documentation: Difference between revisions

no edit summary
No edit summary
Line 5: Line 5:
Dolibarr language files are translated in several languages.
Dolibarr language files are translated in several languages.
French and English are by default always complete. Other languages depend on contributions. This tutorial can help you to complete a translation that does not exists or is not correct for another language.
French and English are by default always complete. Other languages depend on contributions. This tutorial can help you to complete a translation that does not exists or is not correct for another language.
<!-- TRANSIFEX IS THE STANDARD NOW, WHAT TO DO WITH NOTES ABOUT ALTERNATIVE METHODS?
There are 3 methods for translating Dolibarr (1 automatic: autotranslator, 2 manual: a completely manual method or transifex).
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 ==
== Automatic Translation with autotranslator.php tool ==
Line 12: Line 11:
* Translator OS: All
* Translator OS: All
* Tool: '''autotranslator.php''' provided with Dolibarr in directory '''dev/translation'''.
* Tool: '''autotranslator.php''' provided with Dolibarr in directory '''dev/translation'''.
This method is recommended when starting translation for a language not already initialized. If there is already a translation available but you need to add missing key or correct errors, try to use next method.
This method is recommended when starting translation for a language not already initialized. If there is already a translation available but you need to add missing key or correct errors, try to use next transifex method.


To make or update all files of a language code, just run the script:
To make or update all files of a language code, just run the script:
Line 28: Line 27:
Your PHP must also have permissions to write into '''htdocs/langs''' directory and must have curl functions available.
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 ==
== Manual Translation (not recommanded) ==
 
* Translator OS: All
* Tool: phpLangEditor (plugin for Firefox) [[File:PhpLangEditor.jpg|40px]]
 
Follow these steps to translate using the Firefox plugin:
 
# Install Firefox and install plugin phpLangEditor ([[Media: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 ==


To translate Dolibarr into another language, go to the langs directory and create a folder/directory named with the code language to translate (follow the existing format, for example en_US, en_GB, es_ES, de_DE, etc...). Then copy the files from an existing language directory (for example en_US/main.lang, en_GB/bills.lang), into the new language directory that you have just created.
To translate Dolibarr into another language, go to the langs directory and create a folder/directory named with the code language to translate (follow the existing format, for example en_US, en_GB, es_ES, de_DE, etc...). Then copy the files from an existing language directory (for example en_US/main.lang, en_GB/bills.lang), into the new language directory that you have just created.
Line 74: Line 57:


must be present or added to the myfile.lang file.
must be present or added to the myfile.lang file.
-->


== Manual Translation using Transifex online service==
 
== Manual Translation using Transifex online service (recommanded) ==


Transifex is a web application that provides an online platform for translation projects. It includes teams and discussion tools, translation memory, glossary, proofreading and a lot of other features.
Transifex is a web application that provides an online platform for translation projects. It includes teams and discussion tools, translation memory, glossary, proofreading and a lot of other features.