Translator documentation: Difference between revisions

Jump to navigation Jump to search
Line 71: Line 71:
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.
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.


 
To have a localise tring into the PHP code, all you have to do then is loading the language file use the methode to get the translated value. This ca nbe done like this:
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:


<source lang="php">
<source lang="php">
$langs->load("myfile"); // or use $langs->load("myfile@mymodule") if myfile.lang is inside directory htdocs/mymodule/langs/xx_XX 
$langs->trans("CodeX")
$langs->trans("CodeX")
</source>
</source>

Navigation menu