1 TRANSLATION TOOL , V2.0:
3 This transation tool should greatly help Koha translators.
4 It's composed of 2 script :
5 * test-extract.pl, that extracts the texts in a template. It is called by
7 tmpl process can do 3 things :
8 - create a file with all sentences all files in a directory (& it's subdirectories)
9 - update an existing translation file.
10 - rebuild translated templates from english & translation file.
12 Call tmpl_process --help to get full explanations.
14 HOW TO TRANSLATE Koha :
16 1- create your translation file :
17 ./tmpl_process.pl create -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -s opac.fr -r
18 2- translate your opac.fr file (english & other_language being separated by a tab, using IGNORE and LIMITED pragmas, see below)
19 3- create your translated version :
20 ./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
21 4- copy images/css files in your new directory (as they are NOT moved by tmpl_process.pl install)
23 If something changes in english version :
24 1- update your translation file :
25 ./tmpl_process.pl update -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -s opac.fr -r
26 2- translate new your opac.fr file (english & other_language being separated by a tab, using IGNORE and LIMITED pragmas, see below)
27 3- create your translated version :
28 ./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
29 4- copy new images/css files in your new directory if needed
33 I've found some weaknesses (some solvable probably, but maybe some unsolvable)
34 - HTML::Templates pb :
35 if there is only a <TMPL* > 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 <br/> or another HTML statement.
36 The text-extract2.pl filter attempts to address this problem; it seems that the new filter is now working correctly.
39 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 (
40 line 185 of tmpl_process :
41 $line =~ s/(\W)$text(\W)/$1$subst$2/g;
43 Don't seem to have any side effect.
45 - WORD exist in FILENAME
46 words that are in the templates and in a perl script name are replaced !
47 For example : Search is replace by Recherche in french, thus,giving <a href="cgi-bin/opac-Recherche.pl">, which is wrong...
48 2 ways to solve this problem, IGNORE & LIMITED pragma.
50 if a line in translation file is :
51 this_original_string IGNORE
52 it is ignored during translation.
54 if a line in translation file is :
55 this_original_string LIMITED;the_translation_string
56 The string is translated only if :
58 * has <space>title=" just before
59 * has <space>alt=" just before.
60 This prevent stupid replaces, at the cost of some missing translation maybe.
63 Maybe some strings that should be translated are missing.
64 You can add whatever you want in text-extract.pl.
65 For instance, it extracts :
67 - text in alt="SOMETEXT"
68 - meta html encoding (8859-1) to enable non european translations.
70 - DIFFERENT WORD ORDER
71 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.
75 @ paul poulain (paul.poulain _@_ free.fr) & Jerome Vizcaino vizcainj _@_ esiee.fr