File: intltool-extract.patch

package info (click to toggle)
intltool-debian 0.30+20040213
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 132 kB
  • ctags: 83
  • sloc: perl: 1,998; makefile: 41
file content (42 lines) | stat: -rw-r--r-- 1,511 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Index: intltool-extract.in.in
===================================================================
RCS file: /cvs/gnome/intltool/intltool-extract.in.in,v
retrieving revision 1.56
diff -u -r1.56 intltool-extract.in.in
--- intltool-extract.in.in	6 Jan 2004 23:44:12 -0000	1.56
+++ intltool-extract.in.in	18 Jul 2004 22:01:37 -0000
@@ -315,6 +315,16 @@
         }
         $lineno += length($newline);
         my @str_list = rfc822deb_split(length($underscore), $text);
+        #   Dirty hack for po-debconf until a better solution is found.
+        if (defined($ENV{INTLTOOL_DEBIAN_TYPE}) && $ENV{INTLTOOL_DEBIAN_TYPE} eq 'po-debconf') {
+                while($pre =~ m/^(Type:\s*\S+)/mig)
+                {
+                        #  This variable has to be persistent because several
+                        #  fields may be translated in a single template
+                        $type = $1;
+                }
+                $tag = $type . "\n" . $tag if length($type);
+        }
         for my $str (@str_list)
         {
             $strcount++;
@@ -345,7 +355,16 @@
     my $type = shift;
     my $text = shift;
     $text =~ s/^[ \t]//mg;
-    return (split(/, */, $text, 0)) if $type ne 1;
+    if ($type ne 1)
+    {
+        my @values = ();
+        for my $value (split(/(?<!\\), */, $text, 0))
+        {
+            $value =~ s/\\,/,/g;
+            push @values, $value;
+        }
+        return @values;
+    }
     return ($text) if $text !~ /\n/;
 
     $text =~ s/([^\n]*)\n//;