[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-devel] Perl / regexp question
From: |
paul POULAIN |
Subject: |
[Koha-devel] Perl / regexp question |
Date: |
Mon Jan 12 22:13:04 2004 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.4) Gecko/20030630 |
Hi,
In the translator tool, we have a little problem.
We have the following strings in templates : <a
href="/koha/search.pl">search</a> the library.
In the translation file for french, we have :
search chercher
So, the regexp :
$line =~ s/(\W)$text(\W)/$1$subst$2/g;
gives : <a href="/koha/chercher.pl">chercher</a> dans la bibliothèque.
that is WRONG !!! (search.pl must not be replaced !)
& I couldn't find the regexp that could work better.
I tried to use HTML::Tree, HTML::TreeBuilder, but without success : it
doesn't enjoy HTML::Template syntaxt & create bad HTML :-(
I also tried to play with HTML::Parser, but without success neither.
For instance, the workaround is NOT to replace strings translated by
IGNORE, but that's really a poor way to do it, as some things are no
more translated.
but i'm still looking for a better solution to do this.
Note : remembre we can also have <img src="XX" alt="search"> and this
search is to be replaced...
--
Paul POULAIN
Consultant indépendant en logiciels libres
responsable francophone de koha (SIGB libre http://www.koha-fr.org)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-devel] Perl / regexp question,
paul POULAIN <=