Merge lp:~danilo/intltool/bug-520986 into lp:intltool

Proposed by Данило Шеган
Status: Merged
Approved by: Данило Шеган
Approved revision: 720
Merged at revision: 721
Proposed branch: lp:~danilo/intltool/bug-520986
Merge into: lp:intltool
Diff against target: 409 lines (+76/-68)
16 files modified
intltool-extract.in (+24/-16)
tests/results/context.xml.in.h (+1/-1)
tests/results/extract-comments.xml.h (+9/-9)
tests/results/extract-gtkbuilder.ui.h (+1/-1)
tests/results/extract12.xml.in.h (+1/-1)
tests/results/extract13.desktop.in.h (+1/-1)
tests/results/extract14.xml.in.h (+3/-3)
tests/results/extract7.xml.h (+5/-5)
tests/results/extract8.glade.h (+8/-8)
tests/results/extract9.xml.in.h (+2/-2)
tests/results/iso88591text.xml.in.h (+3/-3)
tests/results/space-preserve.xml.in.h (+2/-2)
tests/results/test-quoted.dtd.h (+2/-2)
tests/results/test.schemas.in.h (+3/-3)
tests/results/test.scm.h (+8/-8)
tests/results/unicodetext.xml.in.h (+3/-3)
To merge this branch: bzr merge lp:~danilo/intltool/bug-520986
Reviewer Review Type Date Requested Status
Данило Шеган Approve
Review via email: mp+78715@code.launchpad.net

Description of the change

= Bug 520986 =

For the sake of diff generation and looking over.

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) :
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 2010-03-18 21:49:43 +0000
3+++ intltool-extract.in 2011-10-08 14:05:27 +0000
4@@ -55,6 +55,7 @@
5 my $gettext_type = "";
6 my $input;
7 my %messages = ();
8+my @messages_sorted = ();
9 my %loc = ();
10 my %count = ();
11 my %comments = ();
12@@ -77,7 +78,7 @@
13 "update" => \$UPDATE_ARG,
14 "quiet|q" => \$QUIET_ARG,
15 "srcdir=s" => \$SRCDIR_ARG,
16- "nomsgctxt" => \$NOMSGCTXT_ARG,
17+ "nomsgctxt" => \$NOMSGCTXT_ARG,
18 ) or &error;
19
20 &split_on_argument;
21@@ -265,20 +266,27 @@
22 return join "", map &escape_char, split //, $string;
23 }
24
25+sub add_message
26+{
27+ my ($string) = @_;
28+ push @messages_sorted, $string if !defined $messages{$string};
29+ $messages{$string} = [];
30+}
31+
32 sub type_ini {
33 ### For generic translatable desktop files ###
34 while ($input =~ /^(#(.+)\n)?^_.*=(.*)$/mg) {
35 if (defined($2)) {
36 $comments{$3} = $2;
37 }
38- $messages{$3} = [];
39+ add_message($3);
40 }
41 }
42
43 sub type_keys {
44 ### For generic translatable mime/keys files ###
45 while ($input =~ /^\s*_\w+=(.*)$/mg) {
46- $messages{$1} = [];
47+ add_message($1);
48 }
49 }
50
51@@ -340,7 +348,7 @@
52 ## differences from intltool-merge.in.in
53 if ($key =~ /^_/) {
54 $comments{entity_decode($string)} = $XMLCOMMENT if $XMLCOMMENT;
55- $messages{entity_decode($string)} = [];
56+ add_message(entity_decode($string));
57 $$translate = 2;
58 }
59 ## differences end here from intltool-merge.in.in
60@@ -457,7 +465,7 @@
61
62 if ($lookup && $translate != 2) {
63 $comments{$lookup} = $XMLCOMMENT if $XMLCOMMENT;
64- $messages{$lookup} = [];
65+ add_message($lookup);
66 } elsif ($translate == 2) {
67 translate_subnodes($fh, \@all, $language, 1, $spacepreserve);
68 }
69@@ -646,7 +654,7 @@
70 my $currentcomment = shift @eachcomment;
71 next if !$_;
72 s/\s+/ /g;
73- $messages{entity_decode_minimal($_)} = [];
74+ add_message(entity_decode_minimal($_));
75 $comments{entity_decode_minimal($_)} = $currentcomment if (defined($currentcomment));
76 }
77 }
78@@ -669,7 +677,7 @@
79 for my $str (@str_list)
80 {
81 $strcount++;
82- $messages{$str} = [];
83+ add_message($str);
84 $loc{$str} = $lineno;
85 $count{$str} = $strcount;
86 my $usercomment = '';
87@@ -737,7 +745,7 @@
88 my $before = $`;
89 $message =~ s/\\\"/\"/g;
90 $before =~ s/[^\n]//g;
91- $messages{$message} = [];
92+ add_message($message);
93 $loc{$message} = length ($before) + 2;
94 }
95 }
96@@ -749,7 +757,7 @@
97 $message =~ s/\\\"/\"/g;
98 $message = entity_decode($message);
99 $before =~ s/[^\n]//g;
100- $messages{$message} = [];
101+ add_message($message);
102 $loc{$message} = length ($before) + 2;
103 }
104 }
105@@ -763,12 +771,12 @@
106 # Glade sometimes uses tags that normally mark translatable things for
107 # little bits of non-translatable content. We work around this by not
108 # translating strings that only includes something like label4 or window1.
109- $messages{entity_decode($2)} = [] unless $2 =~ /^(window|label|dialog)[0-9]+$/;
110+ add_message(entity_decode($2)) unless $2 =~ /^(window|label|dialog)[0-9]+$/;
111 }
112
113 while ($input =~ /<items>(..[^<]*)<\/items>/sg) {
114 for my $item (split (/\n/, $1)) {
115- $messages{entity_decode($item)} = [];
116+ add_message(entity_decode($item));
117 }
118 }
119
120@@ -779,14 +787,14 @@
121 if (defined($2)) {
122 $message = entity_decode($2) . "\004" . $message;
123 }
124- $messages{$message} = [];
125+ add_message($message);
126 if (defined($3)) {
127 $comments{$message} = entity_decode($3) ;
128 }
129 }
130 }
131 while ($input =~ /<atkaction\s+action_name="([^>]*)"\s+description="([^>]+)"\/>/sg) {
132- $messages{entity_decode_minimal($2)} = [];
133+ add_message(entity_decode_minimal($2));
134 }
135 }
136
137@@ -799,7 +807,7 @@
138 if (substr($line,$i,1) eq "\"") {
139 if ($state == 2) {
140 $comments{$str} = $trcomment if ($trcomment);
141- $messages{$str} = [];
142+ add_message($str);
143 $str = '';
144 $state = 0; $trcomment = "";
145 } elsif ($state == 1) {
146@@ -914,7 +922,7 @@
147 if (defined $message) {
148 use Encode;
149 Encode::from_to ($message, "iso-8859-1", "UTF-8");
150- $messages{$message} = [];
151+ add_message($message);
152 if ($message =~ /^Bad Strref$/ ) {
153 $comments{$message} = "DO NOT Translate this Entry.";
154 $comments{$message} .= "\nTLK:position=$count";
155@@ -941,7 +949,7 @@
156 }
157 else
158 {
159- @msgids = sort keys %messages;
160+ @msgids = @messages_sorted;
161 }
162 for my $message (@msgids)
163 {
164
165=== modified file 'tests/results/context.xml.in.h'
166--- tests/results/context.xml.in.h 2008-07-25 18:00:49 +0000
167+++ tests/results/context.xml.in.h 2011-10-08 14:05:27 +0000
168@@ -1,7 +1,7 @@
169+char *s = N_("Foo");
170 /* This is the comment on the first Bar */
171 char *s = C_("1", "Bar");
172 /* This is the comment on the second Bar */
173 char *s = C_("2", "Bar");
174 /* This is the comment on Baz */
175 char *s = N_("Baz");
176-char *s = N_("Foo");
177
178=== modified file 'tests/results/extract-comments.xml.h'
179--- tests/results/extract-comments.xml.h 2005-06-26 10:54:45 +0000
180+++ tests/results/extract-comments.xml.h 2011-10-08 14:05:27 +0000
181@@ -1,19 +1,19 @@
182-/* This comment is not ignored even if it contains > (greater than)
183-sign in it, and the following string shows up as well */
184-char *s = N_("Dum-dee-dum");
185-/* If comment doesn't end on the previous line, it should be handled
186- correctly */
187-char *s = N_("Final thing to translate");
188 /* This comment is not ignored */
189 char *s = N_("First thing to translate");
190 /* This is multi line comment for the following string;
191 second line of multi-line comment */
192 char *s = N_("Something to translate");
193+/* If comment doesn't end on the previous line, it should be handled
194+ correctly */
195+char *s = N_("Final thing to translate");
196 char *s = N_("This doesn't have a comment for translators");
197-/* Comment for *both* attributes and content */
198-char *s = N_("attribute value");
199+/* This comment is not ignored even if it contains > (greater than)
200+sign in it, and the following string shows up as well */
201+char *s = N_("Dum-dee-dum");
202+char *s = N_("attribute without comment");
203 /* This comment will appear if attributes can be commented about */
204 char *s = N_("attribute with comment");
205-char *s = N_("attribute without comment");
206+/* Comment for *both* attributes and content */
207+char *s = N_("attribute value");
208 /* Comment for *both* attributes and content */
209 char *s = N_("even more content");
210
211=== modified file 'tests/results/extract-gtkbuilder.ui.h'
212--- tests/results/extract-gtkbuilder.ui.h 2010-03-18 21:49:43 +0000
213+++ tests/results/extract-gtkbuilder.ui.h 2011-10-08 14:05:27 +0000
214@@ -1,3 +1,3 @@
215-char *s = C_("developer", "help");
216 char *s = N_("help");
217 char *s = C_("user", "help");
218+char *s = C_("developer", "help");
219
220=== modified file 'tests/results/extract12.xml.in.h'
221--- tests/results/extract12.xml.in.h 2005-01-21 02:04:39 +0000
222+++ tests/results/extract12.xml.in.h 2011-10-08 14:05:27 +0000
223@@ -1,3 +1,3 @@
224+char *s = N_("Other attribute");
225 char *s = N_("Normal name");
226-char *s = N_("Other attribute");
227 char *s = N_("Other name");
228
229=== modified file 'tests/results/extract13.desktop.in.h'
230--- tests/results/extract13.desktop.in.h 2008-08-25 03:06:45 +0000
231+++ tests/results/extract13.desktop.in.h 2011-10-08 14:05:27 +0000
232@@ -1,5 +1,5 @@
233-char *s = N_("Blue");
234 /* 2. This comment should be extracted. */
235 char *s = N_("Find Files...");
236 /* 4. This comment also should be extracted. */
237 char *s = N_("Locate documents and folders on this computer by name or content");
238+char *s = N_("Blue");
239
240=== modified file 'tests/results/extract14.xml.in.h'
241--- tests/results/extract14.xml.in.h 2007-07-20 16:36:30 +0000
242+++ tests/results/extract14.xml.in.h 2011-10-08 14:05:27 +0000
243@@ -1,4 +1,4 @@
244+char *s = N_("The &lt; entity produces the < character");
245+char *s = N_("The &gt; entity produces the > character");
246+char *s = N_("The &amp;lt; entity produces the &lt; character");
247 char *s = N_("The &amp;gt; entity produces the &gt; character");
248-char *s = N_("The &amp;lt; entity produces the &lt; character");
249-char *s = N_("The &gt; entity produces the > character");
250-char *s = N_("The &lt; entity produces the < character");
251
252=== modified file 'tests/results/extract7.xml.h'
253--- tests/results/extract7.xml.h 2004-06-14 09:13:11 +0000
254+++ tests/results/extract7.xml.h 2011-10-08 14:05:27 +0000
255@@ -1,9 +1,9 @@
256 char *s = N_("<big>Welcome to The GIMP !</big>");
257-char *s = N_("Most plug-ins work on the current layer of the current image. In some cases, you will have to merge all layers (Layers-&gt;Flatten Image) if you want the plug-in to work on the whole image.");
258 char *s = N_("Nearly all image operations are performed by right-clicking on the image. And don't worry, you can undo most mistakes...");
259-char *s = N_("Not all effects can be applied to all kinds of images. This is indicated by a grayed-out menu-entry. You may need to change the image mode to RGB (Image-&gt;Mode-&gt;RGB), add an alpha-channel (Layers-&gt;Add Alpha Channel) or flatten it (Layers-&gt;Flatten Image).");
260+char *s = N_("You can get context-sensitive help for most of the GIMP's features by pressing the F1 key at any time. This also works inside the menus.");
261 char *s = N_("The GIMP uses layers to let you organize your image. Think of them as a stack of slides or filters, such that looking through them you see a composite of their contents.");
262+char *s = N_("You can perform many layer operations by right-clicking on the text label of a layer in the &quot;Layers, Channels and Paths&quot; dialog.");
263+char *s = N_("When you save an image to work on it again later, try using XCF, the GIMP's native file format (use the file extension <tt>.xcf</tt>). This preserves the layers and every aspect of your work-in-progress. Once a project is completed, you can save it as JPEG, PNG, GIF, ...");
264 char *s = N_("The layer named &quot;Background&quot; it special because it lacks transparency. This prevents you from adding a layer mask or moving the layer up in the stack. You may add transparency to it by right-clicking in the &quot;Layers, Channels and Paths&quot; dialog and selecting &quot;Add Alpha Channel&quot;.");
265-char *s = N_("When you save an image to work on it again later, try using XCF, the GIMP's native file format (use the file extension <tt>.xcf</tt>). This preserves the layers and every aspect of your work-in-progress. Once a project is completed, you can save it as JPEG, PNG, GIF, ...");
266-char *s = N_("You can get context-sensitive help for most of the GIMP's features by pressing the F1 key at any time. This also works inside the menus.");
267-char *s = N_("You can perform many layer operations by right-clicking on the text label of a layer in the &quot;Layers, Channels and Paths&quot; dialog.");
268+char *s = N_("Most plug-ins work on the current layer of the current image. In some cases, you will have to merge all layers (Layers-&gt;Flatten Image) if you want the plug-in to work on the whole image.");
269+char *s = N_("Not all effects can be applied to all kinds of images. This is indicated by a grayed-out menu-entry. You may need to change the image mode to RGB (Image-&gt;Mode-&gt;RGB), add an alpha-channel (Layers-&gt;Add Alpha Channel) or flatten it (Layers-&gt;Flatten Image).");
270
271=== modified file 'tests/results/extract8.glade.h'
272--- tests/results/extract8.glade.h 2004-10-14 10:39:17 +0000
273+++ tests/results/extract8.glade.h 2011-10-08 14:05:27 +0000
274@@ -1,13 +1,13 @@
275+char *s = N_("Testing");
276 /* Comment on <property> tag */
277 char *s = N_("A label");
278-char *s = N_("Cancel (and exit) the test.");
279+/* Multiline comments
280+should be supported as well */
281+char *s = N_("_Push me");
282+char *s = N_("Testing2");
283 char *s = N_("Click the button below");
284-char *s = N_("Testing");
285-char *s = N_("Testing2");
286+char *s = N_("This button\n"
287+ "dares you to invoke this action.");
288 char *s = N_("This action\n"
289 "does nothing interesting.");
290-char *s = N_("This button\n"
291- "dares you to invoke this action.");
292-/* Multiline comments
293-should be supported as well */
294-char *s = N_("_Push me");
295+char *s = N_("Cancel (and exit) the test.");
296
297=== modified file 'tests/results/extract9.xml.in.h'
298--- tests/results/extract9.xml.in.h 2004-10-07 08:38:19 +0000
299+++ tests/results/extract9.xml.in.h 2011-10-08 14:05:27 +0000
300@@ -1,3 +1,5 @@
301+char *s = N_("Welcome to The GIMP !");
302+char *s = N_("Nearly all image operations are performed by right-clicking on the image. And don't worry, you can undo most mistakes.");
303 char *s = N_("\n"
304 "\n"
305 "\n"
306@@ -6,5 +8,3 @@
307 "\n"
308 "\n"
309 " ");
310-char *s = N_("Nearly all image operations are performed by right-clicking on the image. And don't worry, you can undo most mistakes.");
311-char *s = N_("Welcome to The GIMP !");
312
313=== modified file 'tests/results/iso88591text.xml.in.h'
314--- tests/results/iso88591text.xml.in.h 2005-11-25 20:00:39 +0000
315+++ tests/results/iso88591text.xml.in.h 2011-10-08 14:05:27 +0000
316@@ -1,5 +1,5 @@
317+char *s = N_("Europe");
318+/* Translators: This is in France. */
319+char *s = N_("Chambéry");
320 /* Translators: This is in Chambéry in France. */
321 char *s = N_("Aix-les-Bains");
322-/* Translators: This is in France. */
323-char *s = N_("Chambéry");
324-char *s = N_("Europe");
325
326=== modified file 'tests/results/space-preserve.xml.in.h'
327--- tests/results/space-preserve.xml.in.h 2005-06-26 10:54:45 +0000
328+++ tests/results/space-preserve.xml.in.h 2011-10-08 14:05:27 +0000
329@@ -1,8 +1,8 @@
330-char *s = N_("And this message should take no more than one single row, no matter the spacing in the source file.");
331 char *s = N_("Insufficient disk space for upgrade.");
332-char *s = N_("This is not an error.");
333 char *s = N_("Upgrading your data and settings will require up to {0} of disk\n"
334 "space, but you only have {1} available.\n"
335 "\n"
336 "You will need to make more space available in your home directory before you can\n"
337 "continue.");
338+char *s = N_("This is not an error.");
339+char *s = N_("And this message should take no more than one single row, no matter the spacing in the source file.");
340
341=== modified file 'tests/results/test-quoted.dtd.h'
342--- tests/results/test-quoted.dtd.h 2006-05-23 21:08:38 +0000
343+++ tests/results/test-quoted.dtd.h 2011-10-08 14:05:27 +0000
344@@ -1,8 +1,8 @@
345 # 1 "cases/test-quoted.dtd"
346 char *s = N_("Channel requires &quot;authentication&quot;");
347-# 4 "cases/test-quoted.dtd"
348-char *s = N_("Password\\a:");
349 # 2 "cases/test-quoted.dtd"
350 char *s = N_("Please enter the username and password given to you by this channel's publisher.");
351 # 3 "cases/test-quoted.dtd"
352 char *s = N_("Username\"foo\":");
353+# 4 "cases/test-quoted.dtd"
354+char *s = N_("Password\\a:");
355
356=== modified file 'tests/results/test.schemas.in.h'
357--- tests/results/test.schemas.in.h 2004-05-06 16:24:29 +0000
358+++ tests/results/test.schemas.in.h 2011-10-08 14:05:27 +0000
359@@ -1,10 +1,10 @@
360-char *s = N_("12");
361 /* default value for /schemas/apps/clock_applet/prefs/hour_format
362 The translation should only include the localized default
363 eg. 12 or 24 */
364 char *s = N_("24");
365-char *s = N_("Display seconds in time");
366 char *s = N_("Hour format");
367-char *s = N_("Puh long.");
368 char *s = N_("Sets the hour format, may be either 12 or 24");
369+char *s = N_("Display seconds in time");
370+char *s = N_("12");
371 char *s = N_("Something random..even has >");
372+char *s = N_("Puh long.");
373
374=== modified file 'tests/results/test.scm.h'
375--- tests/results/test.scm.h 2004-10-23 09:11:26 +0000
376+++ tests/results/test.scm.h 2011-10-08 14:05:27 +0000
377@@ -1,11 +1,11 @@
378+/* silly comment */
379+char *s = N_("translatable string");
380+/* this is a fine comment for translators */
381+char *s = N_("nice string; thanks");
382+/* all well */
383+char *s = N_("multiple");
384+char *s = N_("translations; per line");
385+char *s = N_("translation");
386 /* so "what? */
387 char *s = N_("another \" string");
388 char *s = N_("here");
389-/* all well */
390-char *s = N_("multiple");
391-/* this is a fine comment for translators */
392-char *s = N_("nice string; thanks");
393-/* silly comment */
394-char *s = N_("translatable string");
395-char *s = N_("translation");
396-char *s = N_("translations; per line");
397
398=== modified file 'tests/results/unicodetext.xml.in.h'
399--- tests/results/unicodetext.xml.in.h 2005-11-25 20:00:39 +0000
400+++ tests/results/unicodetext.xml.in.h 2011-10-08 14:05:27 +0000
401@@ -1,5 +1,5 @@
402+char *s = N_("Europe");
403+/* Translators: This is in France. */
404+char *s = N_("Chambéry");
405 /* Translators: This is in Chambéry in France. */
406 char *s = N_("Aix-les-Bains");
407-/* Translators: This is in France. */
408-char *s = N_("Chambéry");
409-char *s = N_("Europe");

Subscribers

People subscribed via source and target branches