diff options
-rw-r--r-- | intltool-extract.in | 2 | ||||
-rw-r--r-- | intltool-merge.in | 4 | ||||
-rw-r--r-- | tests/cases/extract13.desktop.in | 3 | ||||
-rw-r--r-- | tests/results/extract13.desktop | 3 | ||||
-rw-r--r-- | tests/results/extract13.desktop.in.h | 3 |
5 files changed, 12 insertions, 3 deletions
diff --git a/intltool-extract.in b/intltool-extract.in index 45a969c..47a539b 100644 --- a/intltool-extract.in +++ b/intltool-extract.in @@ -276,7 +276,7 @@ sub add_message sub type_ini { ### For generic translatable desktop files ### - while ($input =~ /^(#(.+)\n)?^_.*=(.*)$/mg) { + while ($input =~ /^(#(.+)\n)?^_[A-Za-z0-9\-]+\s*=\s*(.*)$/mg) { if (defined($2)) { $comments{$3} = $2; } diff --git a/intltool-merge.in b/intltool-merge.in index 1afa2a4..05db7cf 100644 --- a/intltool-merge.in +++ b/intltool-merge.in @@ -1186,7 +1186,7 @@ sub desktop_merge_translations while (<INPUT>) { - if (s/^(\s*)_([A-Za-z0-9\-]+=(.*))/$1$2/) + if (s/^(\s*)_([A-Za-z0-9\-]+\s*=\s*(.*))/$1$2/) { my $string = $3; @@ -1200,7 +1200,7 @@ sub desktop_merge_translations next if !$translation; $_ = $non_translated_line; - s/(\w+)=.*/${1}[$lang]=$translation/; + s/(\w+)\s*=\s*.*/${1}[$lang]=$translation/; print OUTPUT; } } diff --git a/tests/cases/extract13.desktop.in b/tests/cases/extract13.desktop.in index 19021be..256935f 100644 --- a/tests/cases/extract13.desktop.in +++ b/tests/cases/extract13.desktop.in @@ -24,3 +24,6 @@ X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=gnome-utils X-GNOME-Bugzilla-Component=gsearchtool _X-Color=Blue +_X-Color2 = Red +_X-Color3= Green +_X-Color4 =Yellow diff --git a/tests/results/extract13.desktop b/tests/results/extract13.desktop index e8b60a1..879fcc1 100644 --- a/tests/results/extract13.desktop +++ b/tests/results/extract13.desktop @@ -24,3 +24,6 @@ X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=gnome-utils X-GNOME-Bugzilla-Component=gsearchtool X-Color=Blue +X-Color2 = Red +X-Color3= Green +X-Color4 =Yellow diff --git a/tests/results/extract13.desktop.in.h b/tests/results/extract13.desktop.in.h index e9df7b9..9e44646 100644 --- a/tests/results/extract13.desktop.in.h +++ b/tests/results/extract13.desktop.in.h @@ -3,3 +3,6 @@ char *s = N_("Find Files..."); /* 4. This comment also should be extracted. */ char *s = N_("Locate documents and folders on this computer by name or content"); char *s = N_("Blue"); +char *s = N_("Red"); +char *s = N_("Green"); +char *s = N_("Yellow"); |