TRANSLATION TOOL , V2.0: ============ This transation tool should greatly help Koha translators. It's composed of 2 script : * test-extract.pl, that extracts the texts in a template. It is called by * tmpl_process. tmpl process can do 3 things : - create a file with all sentences all files in a directory (& it's subdirectories) - update an existing translation file. - rebuild translated templates from english & translation file. Call tmpl_process --help to get full explanations. HOW TO TRANSLATE Koha : ============ 1- create your translation file : ./tmpl_process.pl create -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -s opac.fr -r 2- translate your opac.fr file (english & other_language being separated by a tab, using IGNORE and LIMITED pragmas, see below) 3- create your translated version : ./tmpl_process.pl install -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -o /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/fr2/ -s opac.fr -r 4- copy images/css files in your new directory (as they are NOT moved by tmpl_process.pl install) If something changes in english version : 1- update your translation file : ./tmpl_process.pl update -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -s opac.fr -r 2- translate new your opac.fr file (english & other_language being separated by a tab, using IGNORE and LIMITED pragmas, see below) 3- create your translated version : ./tmpl_process.pl install -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -o /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/fr2/ -s opac.fr -r 4- copy new images/css files in your new directory if needed WEAKNESSES ======= I've found some weaknesses (some solvable probably, but maybe some unsolvable) - HTML::Templates pb : if there is only a tag between 2 strings, text-extract sometimes merges both strings, and so can't replace them in the translated template. I've solved all those cases with a
or another HTML statement. The text-extract2.pl filter attempts to address this problem; it seems that the new filter is now working correctly. - SHORT STATEMENTS short statements (like "in") can be replaced stupidly (like in cgi-bin => gives cgi-bdans in french). the workaround has been to replace only complete words ( line 185 of tmpl_process : $line =~ s/(\W)$text(\W)/$1$subst$2/g; ) Don't seem to have any side effect. - WORD exist in FILENAME words that are in the templates and in a perl script name are replaced ! For example : Search is replace by Recherche in french, thus,giving , which is wrong... 2 ways to solve this problem, IGNORE & LIMITED pragma. IGNORE : if a line in translation file is : this_original_string IGNORE it is ignored during translation. LIMITED : if a line in translation file is : this_original_string LIMITED;the_translation_string The string is translated only if : * has a > just before * has title=" just before * has alt=" just before. This prevent stupid replaces, at the cost of some missing translation maybe. - MISSING STRINGS Maybe some strings that should be translated are missing. You can add whatever you want in text-extract.pl. For instance, it extracts : - standard text - text in alt="SOMETEXT" - meta html encoding (8859-1) to enable non european translations. - DIFFERENT WORD ORDER Some languages have different word order than English in sentences, or even in dates. For these languages, it is impossible to make a good translation at the moment. COPYRIGHT ====== @ paul poulain (paul.poulain _@_ free.fr) & Jerome Vizcaino vizcainj _@_ esiee.fr