synch'ing 2.0.0 branch (RC4 tag) and head
[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
37 - SHORT STATEMENTS
38  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 (
39 line 185 of tmpl_process :
40 $line =~ s/(\W)$text(\W)/$1$subst$2/g;
41 )
42 Don't seem to have any side effect.
43
44 - WORD exist in FILENAME
45 words that are in the templates and in a perl script name are replaced !
46 For example : Search is replace by Recherche in french, thus,giving <a href="cgi-bin/opac-Recherche.pl">, which is wrong...
47 2 ways to solve this problem, IGNORE & LIMITED pragma.
48 IGNORE :
49 if a line in translation file is :
50 this_original_string    IGNORE
51 it is ignored during translation.
52 LIMITED :
53 if a line in translation file is :
54 this_original_string LIMITED;the_translation_string
55 The string is translated only if :
56 * has a > just before
57 * has <space>title=" just before
58 * has <space>alt=" just before.
59 This prevent stupid replaces, at the cost of some missing translation maybe.
60
61 - MISSING STRINGS
62 Maybe some strings that should be translated are missing.
63 You can add whatever you want in text-extract.pl.
64 For instance, it extracts :
65 - standard text
66 - text in alt="SOMETEXT"
67 - meta html encoding (8859-1) to enable non european translations.
68
69 COPYRIGHT
70 ======
71 @ paul poulain (paul.poulain _@_ free.fr) & Jerome Vizcaino vizcainj _@_ esiee.fr