translator tool. see translator_doc.txt
[koha.git] / misc / translator / translator_doc.txt
1 TRANSLATION TOOL :
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 update -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -s opac.fr -r
18 2- translate your opac.fr file (english & french being separated by a tab
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 in your new directory (as they are NOT moved by tmpl_process.pl install)
22
23 If something changes in english version, go back to pt1 & repeat.
24
25 WEAKNESSES
26 =======
27 I've found some weaknesses (some solvable probably, but maybe some unsolvable)
28 - HTML::Templates pb :
29  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.
30
31 - SHORT STATEMENTS
32  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 (
33 line 185 of tmpl_process :
34 $line =~ s/(\W)$text(\W)/$1$subst$2/g;
35 )
36 Don't seem to have any side effect.
37
38 - WORD exist in FILENAME
39 words that are in the templates and in a perl script name are replaced !
40 For example : Search is replace by Recherche in french, thus,giving <a href="cgi-bin/opac-Recherche.pl">, which is wrong...
41 The only way I've found to solve this is to ignore any translation whose translation string is IGNORE
42 (search is the only cas i've found in french opac)
43
44 - MISSING STRINGS
45 Maybe some strings that should be translated are missing.
46 You can add whatever you want in text-extract.pl.
47 For instance, it extracts :
48 - standard text
49 - text in alt="SOMETEXT"
50 - meta html encoding (8859-1) to enable non european translations.
51
52 COPYRIGHT
53 ======
54 @ paul poulain (paul.poulain _@_ free.fr) & Jerome Vizcaino vizcainj _@_ esiee.fr