[Koha-cvs] CVS: koha/misc/translator text-extract2.pl,1.11,1.12

Ambrose Li acli at users.sourceforge.net
Fri Feb 13 02:03:21 CET 2004


Update of /cvsroot/koha/koha/misc/translator
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27136

Modified Files:
	text-extract2.pl 
Log Message:
Paul's problem #1 is now fixed: Bug in regular expression $re_directive.
Put my "grander plan" :-) in the comments


Index: text-extract2.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/text-extract2.pl,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** text-extract2.pl	13 Feb 2004 00:48:52 -0000	1.11
--- text-extract2.pl	13 Feb 2004 01:03:18 -0000	1.12
***************
*** 10,13 ****
--- 10,21 ----
  # FIXME: Strings like "<< Prev" or "Next >>" may confuse *this* filter
  # TODO: Need to detect unclosed tags, empty tags, and other such stuff.
+ # (Why? Because Mozilla apparently knows what SGML unclosed tags are :-/ )
+ 
+ # A grander plan: Code could be written to detect template variables and
+ # construct gettext-c-format-string-like meta-strings (e.g., "Results %s
+ # through %s of %s records" that will be more likely to be translatable
+ # to languages where word order is very unlike English word order.
+ # --> This will be relatively major rework, and requires corresponding
+ # rework in tmpl_process.pl
  
  use Getopt::Long;
***************
*** 23,27 ****
  BEGIN {
      # $re_directive must not do any backreferences
!     $re_directive = q{<(?:(?i)(?:!--\s*)?\/?TMPL_(?:VAR|LOOP|INCLUDE|IF|ELSE|UNLESS)\b(?:\s+(?:[a-zA-Z][-a-zA-Z0-9]*=)?(?:'[^']*'|"[^"]*"|[^\s<>]+))\s*(?:--)?)>};
  }
  
--- 31,35 ----
  BEGIN {
      # $re_directive must not do any backreferences
!     $re_directive = q{<(?:(?i)(?:!--\s*)?\/?TMPL_(?:VAR|LOOP|INCLUDE|IF|ELSE|UNLESS)(?:\s+(?:[a-zA-Z][-a-zA-Z0-9]*=)?(?:'[^']*'|"[^"]*"|[^\s<>]+))*\s*(?:--)?)>};
  }
  





More information about the Koha-cvs mailing list