I've just commited a new translation tool. Feel free to test it AND IMPROVE IT. TRANSLATION TOOL : ============ 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 update -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -s opac.fr -r 2- translate your opac.fr file (english & french being separated by a tab 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 in your new directory (as they are NOT moved by tmpl_process.pl install) If something changes in english version, go back to pt1 & repeat. 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... The only way I've found to solve this is to ignore any translation whose translation string is IGNORE (search is the only cas i've found in french opac) - 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. COPYRIGHT ====== @ paul poulain (paul.poulain _@_ free.fr) & Jerome Vizcaino vizcainj _@_ esiee.fr -- Paul POULAIN Consultant indépendant en logiciels libres responsable francophone de koha (SIGB libre http://www.koha-fr.org)
paul POULAIN a écrit :
I've just commited a new translation tool. Feel free to test it AND IMPROVE IT.
Just forgotten to say : it's in CVS, misc/translator directory. -- Paul POULAIN Consultant indépendant en logiciels libres responsable francophone de koha (SIGB libre http://www.koha-fr.org)
On 2003-12-05 16:57:21 +0000 paul POULAIN <paul.poulain@free.fr> wrote:
I've just commited a new translation tool. Feel free to test it AND IMPROVE IT.
I am sorry to be a little rude, but wouldn't it be better to work on splitting templates and texts, rather than building tools to combine them?
- meta html encoding (8859-1) to enable non european translations.
I think we have already argued over this. We probably should move koha to utf-8, away from the 8859 codings. -- MJR/slef My Opinion Only and possibly not of any group I know. Please http://remember.to/edit_messages on lists to be sure I read http://mjr.towers.org.uk/ gopher://g.towers.org.uk/ slef@jabber.at Creative copyleft computing services via http://www.ttllp.co.uk/
MJ Ray a écrit :
On 2003-12-05 16:57:21 +0000 paul POULAIN <paul.poulain@free.fr> wrote:
I've just commited a new translation tool. Feel free to test it AND IMPROVE IT.
I am sorry to be a little rude, but wouldn't it be better to work on splitting templates and texts, rather than building tools to combine them?
I don't think so, for at least 2 reasons : * the Koha project already has existing and working tools / versions. It's sometimes/usually easier to improve something that exists than rewrite it from scratch. this translation tool works quite good imho, and needed only a few hours to be done. * this translation tools is something like a gettext, but on developper time, not on execution time. Pro : it's no cpu consumming, & so better for low-end hardware. -- Paul POULAIN Consultant indépendant en logiciels libres responsable francophone de koha (SIGB libre http://www.koha-fr.org)
participants (2)
-
MJ Ray -
paul POULAIN