summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanilo Šegan <danilo@segan.org>2012-01-30 21:59:47 +0100
committerDanilo Šegan <danilo@segan.org>2012-01-30 21:59:47 +0100
commitc7dca2f9a9b6c8c6d5b6821bfc965177c5d2f4fd (patch)
treea1b70e309e53245d9062057594694cc852c753a3
parentf723f40a9513a1baa922d96ddd0ac038c09f205b (diff)
parent2aaa95f609b5936f82f8281bf2f850a3e14eae2d (diff)
downloadintltool-c7dca2f9a9b6c8c6d5b6821bfc965177c5d2f4fd.tar.gz
Add support for translatable attribute (well, any) tags in glade files. Patch by Ryan Lortie.
-rw-r--r--intltool-extract.in2
-rw-r--r--tests/cases/extract8.glade14
-rw-r--r--tests/results/extract8.glade.h3
3 files changed, 18 insertions, 1 deletions
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 @@
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
<glade-interface>
+ <menu id='app-menu'>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_New Window</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_New Tab</attribute>
+ </item>
+ </section>
+ <section>
+ <attribute name="label" translatable="yes">_Quit</attribute>
+ </section>
+ </menu>
+
<widget class="GtkWindow" id="window1">
<property name="title" translatable="yes">Testing</property>
<property name="border_width">10</property>
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 <property> tag */
char *s = N_("A label");