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
=== modified file 'intltool-extract.in'
--- intltool-extract.in 2012-02-04 23:29:56 +0000
+++ intltool-extract.in 2012-08-23 03:41:22 +0000
@@ -847,7 +847,7 @@
847 }847 }
848848
849 ## handle new glade files849 ## handle new glade files
850 while ($input =~ /<(\w+)\s+[^>]*translatable\s*=\s*"yes"(?:\s+[^>]*context\s*=\s*"([^"]*)")?(?:\s+[^>]*comments\s*=\s*"([^"]*)")?[^>]*>([^<]+)<\/\1>/sg) {850 while ($input =~ /<(\w+)\s+[^>]*translatable\s*=\s*["']yes["'](?:\s+[^>]*context\s*=\s*["']([^"']*)["'])?(?:\s+[^>]*comments\s*=\s*["']([^"']*)["'])?[^>]*>([^<]+)<\/\1>/sg) {
851 if (!($4 =~ /^(window|label)[0-9]+$/)) {851 if (!($4 =~ /^(window|label)[0-9]+$/)) {
852 my $message = entity_decode($4);852 my $message = entity_decode($4);
853 if (defined($2)) {853 if (defined($2)) {
854854
=== added file 'tests/cases/extract-gtkbuilder-single.ui'
--- tests/cases/extract-gtkbuilder-single.ui 1970-01-01 00:00:00 +0000
+++ tests/cases/extract-gtkbuilder-single.ui 2012-08-23 03:41:22 +0000
@@ -0,0 +1,29 @@
1<interface>
2 <object class='GtkDialog' id='dialog1'>
3 <child internal-child='vbox'>
4 <object class='GtkVBox' id='vbox1'>
5 <property name='border-width'>10</property>
6 <child internal-child='action_area'>
7 <object class='GtkHBox' id='hbox1'>
8 <property name='border-width'>20</property>
9 <child>
10 <object class='GtkLabel' id='help'>
11 <property name='label' translatable='yes'>help</property>
12 </object>
13 </child>
14 <child>
15 <object class='GtkLabel' id='user-help'>
16 <property name='label' translatable='yes' context='user'>help</property>
17 </object>
18 </child>
19 <child>
20 <object class='GtkLabel' id='developer-help'>
21 <property name='label' translatable='yes' context='developer'>help</property>
22 </object>
23 </child>
24 </object>
25 </child>
26 </object>
27 </child>
28 </object>
29</interface>
030
=== added file 'tests/results/extract-gtkbuilder-single.ui.h'
--- tests/results/extract-gtkbuilder-single.ui.h 1970-01-01 00:00:00 +0000
+++ tests/results/extract-gtkbuilder-single.ui.h 2012-08-23 03:41:22 +0000
@@ -0,0 +1,3 @@
1char *s = N_("help");
2char *s = C_("user", "help");
3char *s = C_("developer", "help");
04
=== modified file 'tests/selftest.pl.in'
--- tests/selftest.pl.in 2011-10-08 18:08:58 +0000
+++ tests/selftest.pl.in 2012-08-23 03:41:22 +0000
@@ -289,6 +289,12 @@
289system("$INTLTOOL_EXTRACT --type=gettext/gsettings --quiet --update cases/$case") == 0 or $failed = 1;289system("$INTLTOOL_EXTRACT --type=gettext/gsettings --quiet --update cases/$case") == 0 or $failed = 1;
290check_extract_result($case);290check_extract_result($case);
291291
292print "39. Allow single quotes, like translatable='yes': ";
293$case = "extract-gtkbuilder-single.ui";
294system("$INTLTOOL_EXTRACT --type=gettext/glade --quiet --update cases/$case") == 0 or $failed = 1;
295check_extract_result($case);
296
297
292system("rm -f cases/*.*") if $srcdir ne ".";298system("rm -f cases/*.*") if $srcdir ne ".";
293system("rm -rf C az extract9 fr fr_BE fr_FR merge6 schemasmerge1 schemasmerge2 spacepreserve test test-quoted merge6.xml");299system("rm -rf C az extract9 fr fr_BE fr_FR merge6 schemasmerge1 schemasmerge2 spacepreserve test test-quoted merge6.xml");
294300

Subscribers

People subscribed via source and target branches