Merge remote branch 'kc/master' into new/enh/bug_5917
[koha_gimpoz] / misc / translator / translator_doc.txt
index 066a1c4..67e0180 100644 (file)
@@ -1,71 +1,73 @@
-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
+TRANSLATION TOOL, V3.0:
+======================
+
+This transation tool should greatly help Koha translators. It's composed of
+2 scripts (with a number of associated perl module files):
+
+ 1. xgettext.pl, that extracts the texts in a template, and which is called by
+    the script; and
+ 2. tmpl_process3.tmpl, which can do 3 things:
+     a. create a file with all the "translatable strings" in all files in a
+        directory (& its subdirectories),
+     b. update an existing translation file, and
+     c. rebuild translated templates from English & translation file.
+
+Call tmpl_process3.pl --help to get a more detailed explanation. Some
+additional explanations are also available by calling perldoc tmpl_process3.pl.
+
+Warning: Those scripts relie upon 'gettext' set of tools. On Debian
+         it is included in 'gettext' package.
+
+HOW TO TRANSLATE Koha:
+=====================
+
+ 1. Create your translation file (assuming your current directory is this
+    directory, i.e., misc/translator):
+
+        ./tmpl_process3.pl create -i ../../koha-tmpl/opac-tmpl/default/en/ -s po/css_opac_fr_FR.po -r
+
+    (In the above example, ../../koha-tmpl/opac-tmpl/default/en/ contains the
+    English templates in the "default" theme, and po/css_opac_fr_FR.po is where
+    you want the generated PO file to appear. The use of relative paths for the
+    English templates is recommended; it makes the resulting PO files slightly
+    shorter and more usable in a team environment. Absolute paths are certainly
+    fine, and might be better if there is only one translator for your
+    language.)
+ 2. Translate your css_opac_fr_FR.po file using a text editor or a PO file
+    translation tool.
+ 3. Create your translated templates:
+
+        ./tmpl_process3.pl install -i ../../koha-tmpl/opac-tmpl/default/en/ -o /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/fr2/ -s po/css_opac_fr_FR.po -r
+
+    (In the above example, /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default
+    /fr2/ is where you want your translated templates to be saved.)
+ 4. Copy images/css files in your new directory (as they are NOT moved by
+    tmpl_process3.pl install).
+
+If something changes in the English version:
+
+ 1. Update your translation file:
+
+        ./tmpl_process3.pl update -i ../../koha-tmpl/opac-tmpl/default/en/ -s po/css_opac_fr_FR.po -r
+
+ 2. Translate your newly updated css_opac_fr_FR.po file. Look for strings
+    marked as "fuzzy" and strings that are not translated.
+ 3. Create your translated templates:
+
+        ./tmpl_process3.pl install -i ../../koha-tmpl/opac-tmpl/default/en/ -o /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/fr2/ -s po/css_opac_fr_FR.po -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 <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.
-
-- 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 <a href="cgi-bin/opac-Recherche.pl">, 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 <space>title=" just before
-* has <space>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.
+==========
+
+For a somewhat up-to-date list of weaknesses, please run perldoc xgettext.pl
+and perldoc tmpl_process3.pl and read the BUGS sections.
 
 COPYRIGHT
-======
-@ paul poulain (paul.poulain _@_ free.fr) & Jerome Vizcaino vizcainj _@_ esiee.fr
+=========
+
+  * Paul Poulain (paul.poulain _@_ free.fr) & Jerome Vizcaino (vizcainj _@_
+    esiee.fr)
+  * Parts of V3.0 by Ambrose Li (acli _@_ ada.dhs.org)
+