koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/misc/translator tmpl_process.pl,1.5.2.7,1.5.2.8


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha/misc/translator tmpl_process.pl,1.5.2.7,1.5.2.8
Date: Tue, 10 Feb 2004 05:51:22 -0800

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

Modified Files:
      Tag: rel_2_0
        tmpl_process.pl 
Log Message:
improving handling of (,),.,* ... in translator tool.

Index: tmpl_process.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/tmpl_process.pl,v
retrieving revision 1.5.2.7
retrieving revision 1.5.2.8
diff -C2 -r1.5.2.7 -r1.5.2.8
*** tmpl_process.pl     6 Feb 2004 14:06:36 -0000       1.5.2.7
--- tmpl_process.pl     10 Feb 2004 13:51:20 -0000      1.5.2.8
***************
*** 120,142 ****
  
        $out_dir =~ s/\/$//; # chops the trailing / if any.
-       foreach my $text (keys %{$strhash})
-               {
-                       # escaping \|()[{}^$*+?.
-                       %{$strhash}->{$text} =~ s/\\/\\\\/g;
- #                     %{$strhash}->{$text} =~ s/\//\\\//g;
-                       %{$strhash}->{$text} =~ s/\|/\\\|/g;
-                       %{$strhash}->{$text} =~ s/\(/\\\(/g;
-                       %{$strhash}->{$text} =~ s/\)/\\\)/g;
-                       %{$strhash}->{$text} =~ s/\[/\\\[/g;
-                       %{$strhash}->{$text} =~ s/\]/\\\]/g;
-                       %{$strhash}->{$text} =~ s/\{/\\\{/g;
-                       %{$strhash}->{$text} =~ s/\}/\\\}/g;
-                       %{$strhash}->{$text} =~ s/\^/\\\^/g;
-                       %{$strhash}->{$text} =~ s/\$/\\\$/g;
-                       %{$strhash}->{$text} =~ s/\*/\\\*/g;
-                       %{$strhash}->{$text} =~ s/\+/\\\+/g;
-                       %{$strhash}->{$text} =~ s/\?/\\\?/g;
- #                     %{$strhash}->{$text} =~ s/\./\\\./g;
-               }
        # Processes every entry found.
        foreach my $file (@{$in_files})
--- 120,123 ----
***************
*** 200,226 ****
                        {
                                # Does the file contains text that needs to be 
changed ?
!                               if( $lines =~ /$text/ && %{$strhash}->{$text} 
ne "IGNORE" )
                                {
                                        if (%{$strhash}->{$text} =~ "LIMITED")
                                        {
                                                # changing text
-                                               my $subst = 
%{$strhash}->{$text};
                                                $subst =~ s/UNUSED;//;
-                                               # escaping \|()[{}^$*+?.
-                                               $text =~ s/\\/\\\\/g;
-                                               $text =~ s/\//\\\//g;
-                                               $text =~ s/\|/\\\|/g;
-                                               $text =~ s/\(/\\\(/g;
-                                               $text =~ s/\)/\\\)/g;
-                                               $text =~ s/\[/\\\[/g;
-                                               $text =~ s/\]/\\\]/g;
-                                               $text =~ s/\{/\\\{/g;
-                                               $text =~ s/\}/\\\}/g;
-                                               $text =~ s/\^/\\\^/g;
-                                               $text =~ s/\$/\\\$/g;
-                                               $text =~ s/\*/\\\*/g;
-                                               $text =~ s/\+/\\\+/g;
-                                               $text =~ s/\?/\\\?/g;
-                                               $text =~ s/\./\\\./g;
                                                $subst =~ s/^LIMITED;//g;
                                                $lines =~ 
s/(.*)>$text(\W)/$1>$subst$2/g;
--- 181,207 ----
                        {
                                # Does the file contains text that needs to be 
changed ?
!                               # escaping \|()[{}^$*+?.
!                               my $subst = %{$strhash}->{$text};
!                               $text =~ s/\\/\\\\/g;
!                               $text =~ s/\//\\\//g;
!                               $text =~ s/\|/\\\|/g;
!                               $text =~ s/\(/\\\(/g;
!                               $text =~ s/\)/\\\)/g;
!                               $text =~ s/\[/\\\[/g;
!                               $text =~ s/\]/\\\]/g;
!                               $text =~ s/\{/\\\{/g;
!                               $text =~ s/\}/\\\}/g;
!                               $text =~ s/\^/\\\^/g;
!                               $text =~ s/\$/\\\$/g;
!                               $text =~ s/\*/\\\*/g;
!                               $text =~ s/\+/\\\+/g;
!                               $text =~ s/\?/\\\?/g;
!                               $text =~ s/\./\\\./g;
!                               if(%{$strhash}->{$text} ne "IGNORE" )
                                {
                                        if (%{$strhash}->{$text} =~ "LIMITED")
                                        {
                                                # changing text
                                                $subst =~ s/UNUSED;//;
                                                $subst =~ s/^LIMITED;//g;
                                                $lines =~ 
s/(.*)>$text(\W)/$1>$subst$2/g;
***************
*** 229,250 ****
                                        } else {
                                                # changing text
-                                               my $subst = 
%{$strhash}->{$text};
                                                $subst =~ s/UNUSED;//;
-                                               # escaping \|()[{}^$*+?.
-                                               $text =~ s/\\/\\\\/g;
-                                               $text =~ s/\//\\\//g;
-                                               $text =~ s/\|/\\\|/g;
-                                               $text =~ s/\(/\\\(/g;
-                                               $text =~ s/\)/\\\)/g;
-                                               $text =~ s/\[/\\\[/g;
-                                               $text =~ s/\]/\\\]/g;
-                                               $text =~ s/\{/\\\{/g;
-                                               $text =~ s/\}/\\\}/g;
-                                               $text =~ s/\^/\\\^/g;
-                                               $text =~ s/\$/\\\$/g;
-                                               $text =~ s/\*/\\\*/g;
-                                               $text =~ s/\+/\\\+/g;
-                                               $text =~ s/\?/\\\?/g;
-                                               $text =~ s/\./\\\./g;
                                                $lines =~ 
s/(\W)$text(\W)/$1$subst$2/g;
                                        }
--- 210,214 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]