Updated w.r.t. the text-extract2.pl filter.
[koha.git] / misc / translator / translator_doc.txt
1 TRANSLATION TOOL , V2.0:
2 ============
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
6 * tmpl_process.
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.
11
12 Call tmpl_process --help to get full explanations.
13
14 HOW TO TRANSLATE Koha :
15 ============
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)
22
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
30
31 WEAKNESSES
32 =======
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.
37
38 - SHORT STATEMENTS
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;
42 )
43 Don't seem to have any side effect.
44
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.
49 IGNORE :
50 if a line in translation file is :
51 this_original_string    IGNORE
52 it is ignored during translation.
53 LIMITED :
54 if a line in translation file is :
55 this_original_string LIMITED;the_translation_string
56 The string is translated only if :
57 * has a > just before
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.
61
62 - MISSING STRINGS
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 :
66 - standard text
67 - text in alt="SOMETEXT"
68 - meta html encoding (8859-1) to enable non european translations.
69
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.
72
73 COPYRIGHT
74 ======
75 @ paul poulain (paul.poulain _@_ free.fr) & Jerome Vizcaino vizcainj _@_ esiee.fr