Merge lp:~robru/intltool/intltool into lp:intltool

Proposed by Robert Bruce Park
Status: Merged
Merged at revision: 735
Proposed branch: lp:~robru/intltool/intltool
Merge into: lp:intltool
Diff against target: 70 lines (+39/-1)
4 files modified
intltool-extract.in (+1/-1)
tests/cases/extract-gtkbuilder-single.ui (+29/-0)
tests/results/extract-gtkbuilder-single.ui.h (+3/-0)
tests/selftest.pl.in (+6/-0)
To merge this branch: bzr merge lp:~robru/intltool/intltool
Reviewer Review Type Date Requested Status
Данило Шеган Approve
Robert Bruce Park (community) Approve
Review via email: mp+118633@code.launchpad.net

Description of the change

Allows single-quotes like translatable='yes' in glade XML.

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

Sorry for the late response. The change overall looks good, but it'd be even nicer if you can provide a test case in tests/ (look at cases/ and results/).

review: Needs Fixing
lp:~robru/intltool/intltool updated
736. By Robert Bruce Park

Add test case for single quotes, and fix the bug that I discovered
as a result of adding this test.

Revision history for this message
Robert Bruce Park (robru) wrote :

Thanks for insisting on the test, this has improved the quality of the patch beyond simply what meets my needs, into something that is generally applicable ;-)

Revision history for this message
Robert Bruce Park (robru) wrote :

Hey, can I get this merged now? The test I wrote is good ;-)

review: Approve
Revision history for this message
Данило Шеган (danilo) wrote :

Indeed, sorry, I somehow missed this. Should be merged now, and hopefully I can come up with a new intltool release soon as well.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'intltool-extract.in'
2--- intltool-extract.in 2012-02-04 23:29:56 +0000
3+++ intltool-extract.in 2012-08-23 03:41:22 +0000
4@@ -847,7 +847,7 @@
5 }
6
7 ## handle new glade files
8- while ($input =~ /<(\w+)\s+[^>]*translatable\s*=\s*"yes"(?:\s+[^>]*context\s*=\s*"([^"]*)")?(?:\s+[^>]*comments\s*=\s*"([^"]*)")?[^>]*>([^<]+)<\/\1>/sg) {
9+ while ($input =~ /<(\w+)\s+[^>]*translatable\s*=\s*["']yes["'](?:\s+[^>]*context\s*=\s*["']([^"']*)["'])?(?:\s+[^>]*comments\s*=\s*["']([^"']*)["'])?[^>]*>([^<]+)<\/\1>/sg) {
10 if (!($4 =~ /^(window|label)[0-9]+$/)) {
11 my $message = entity_decode($4);
12 if (defined($2)) {
13
14=== added file 'tests/cases/extract-gtkbuilder-single.ui'
15--- tests/cases/extract-gtkbuilder-single.ui 1970-01-01 00:00:00 +0000
16+++ tests/cases/extract-gtkbuilder-single.ui 2012-08-23 03:41:22 +0000
17@@ -0,0 +1,29 @@
18+<interface>
19+ <object class='GtkDialog' id='dialog1'>
20+ <child internal-child='vbox'>
21+ <object class='GtkVBox' id='vbox1'>
22+ <property name='border-width'>10</property>
23+ <child internal-child='action_area'>
24+ <object class='GtkHBox' id='hbox1'>
25+ <property name='border-width'>20</property>
26+ <child>
27+ <object class='GtkLabel' id='help'>
28+ <property name='label' translatable='yes'>help</property>
29+ </object>
30+ </child>
31+ <child>
32+ <object class='GtkLabel' id='user-help'>
33+ <property name='label' translatable='yes' context='user'>help</property>
34+ </object>
35+ </child>
36+ <child>
37+ <object class='GtkLabel' id='developer-help'>
38+ <property name='label' translatable='yes' context='developer'>help</property>
39+ </object>
40+ </child>
41+ </object>
42+ </child>
43+ </object>
44+ </child>
45+ </object>
46+</interface>
47
48=== added file 'tests/results/extract-gtkbuilder-single.ui.h'
49--- tests/results/extract-gtkbuilder-single.ui.h 1970-01-01 00:00:00 +0000
50+++ tests/results/extract-gtkbuilder-single.ui.h 2012-08-23 03:41:22 +0000
51@@ -0,0 +1,3 @@
52+char *s = N_("help");
53+char *s = C_("user", "help");
54+char *s = C_("developer", "help");
55
56=== modified file 'tests/selftest.pl.in'
57--- tests/selftest.pl.in 2011-10-08 18:08:58 +0000
58+++ tests/selftest.pl.in 2012-08-23 03:41:22 +0000
59@@ -289,6 +289,12 @@
60 system("$INTLTOOL_EXTRACT --type=gettext/gsettings --quiet --update cases/$case") == 0 or $failed = 1;
61 check_extract_result($case);
62
63+print "39. Allow single quotes, like translatable='yes': ";
64+$case = "extract-gtkbuilder-single.ui";
65+system("$INTLTOOL_EXTRACT --type=gettext/glade --quiet --update cases/$case") == 0 or $failed = 1;
66+check_extract_result($case);
67+
68+
69 system("rm -f cases/*.*") if $srcdir ne ".";
70 system("rm -rf C az extract9 fr fr_BE fr_FR merge6 schemasmerge1 schemasmerge2 spacepreserve test test-quoted merge6.xml");
71

Subscribers

People subscribed via source and target branches