From 2aaa95f609b5936f82f8281bf2f850a3e14eae2d Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Mon, 30 Jan 2012 12:32:21 -0500 Subject: Bug #923841: support menus in glade files Instead of hardcoding a list (property, atkproperty, col) of tags that we support translatable="yes" on, support it on all tags. This lets us pick up as is used within of a GtkBuilder file. --- intltool-extract.in | 2 +- tests/cases/extract8.glade | 14 ++++++++++++++ tests/results/extract8.glade.h | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/intltool-extract.in b/intltool-extract.in index c48a9ec..eb6956d 100644 --- a/intltool-extract.in +++ b/intltool-extract.in @@ -847,7 +847,7 @@ sub type_glade { } ## handle new glade files - while ($input =~ /<(property|atkproperty|col)\s+[^>]*translatable\s*=\s*"yes"(?:\s+[^>]*context\s*=\s*"([^"]*)")?(?:\s+[^>]*comments\s*=\s*"([^"]*)")?[^>]*>([^<]+)<\/\1>/sg) { + while ($input =~ /<(\w+)\s+[^>]*translatable\s*=\s*"yes"(?:\s+[^>]*context\s*=\s*"([^"]*)")?(?:\s+[^>]*comments\s*=\s*"([^"]*)")?[^>]*>([^<]+)<\/\1>/sg) { if (!($4 =~ /^(window|label)[0-9]+$/)) { my $message = entity_decode($4); if (defined($2)) { diff --git a/tests/cases/extract8.glade b/tests/cases/extract8.glade index cf5188c..fc37b1c 100644 --- a/tests/cases/extract8.glade +++ b/tests/cases/extract8.glade @@ -2,6 +2,20 @@ + +
+ + _New Window + + + _New Tab + +
+
+ _Quit +
+
+ Testing 10 diff --git a/tests/results/extract8.glade.h b/tests/results/extract8.glade.h index fd82e2a..f5d13a8 100644 --- a/tests/results/extract8.glade.h +++ b/tests/results/extract8.glade.h @@ -1,3 +1,6 @@ +char *s = N_("_New Window"); +char *s = N_("_New Tab"); +char *s = N_("_Quit"); char *s = N_("Testing"); /* Comment on tag */ char *s = N_("A label"); -- cgit v1.2.1