summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichi Henning <michi.henning@canonical.com>2014-12-10 22:33:58 -0500
committerRodney Dawes <dobey@wayofthemonkey.com>2014-12-10 22:33:58 -0500
commitb6c29c7e40a1e888b65ff52df333ac77e2fa1f2e (patch)
tree2afbd62599464f69bb4a4e48c27e7f6403381429
parent53b7a6038b8dca0075679db78839ae59b0e85a68 (diff)
parent1a494da1f91de39557c908c8ab99e76d14755f67 (diff)
downloadintltool-b6c29c7e40a1e888b65ff52df333ac77e2fa1f2e.tar.gz
Fixed incorrect handling of spaces around = in .ini files.
-rw-r--r--intltool-extract.in2
-rw-r--r--intltool-merge.in4
-rw-r--r--tests/cases/extract13.desktop.in3
-rw-r--r--tests/results/extract13.desktop3
-rw-r--r--tests/results/extract13.desktop.in.h3
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");