[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: %translation_notes



* Gerfried Fuchs <alfie@ist.org> [2002-11-14 14:54]:
>  Yes, that fix seems to work like a charm.  It extracts the domain
> additionally and drops that string if it's for the wrong domain.  The
> only "problem" that might occur with that is that each <gettext> string
> now _must_ have a domain.  I am going to fix the ones that don't have
> one currently.

 No, the <gettext> string must not have a domain, fixed so far :)  Only
thing now is that translations don't work  *hmmm*

 This is how far I got, please find attached the diff.

 Thanks for any hints.  About the tc.data file I will at least commit
it that far that it is only one string for portuguese, swedish and
german.  Still in the others.pot file, but that is the best I can do
currently.

 Have fun,
Alfie
-- 
  * TEST
 -- Ryuichi Arafune, changelog.Debian for imagemagick (4:5.4.6-4)
Index: wmlxgettext.pl
===================================================================
RCS file: /cvs/webwml/webwml/english/po/wmlxgettext.pl,v
retrieving revision 1.3
diff -u -r1.3 wmlxgettext.pl
--- wmlxgettext.pl	5 Nov 2002 21:56:35 -0000	1.3
+++ wmlxgettext.pl	14 Nov 2002 14:18:34 -0000
@@ -8,6 +8,8 @@
 my $messages = {};
 my @msgids = ();
 
+my $domain = shift @ARGV;
+
 sub escape {
         my $text = shift;
         $text =~ s/\\/\\\\/g;
@@ -42,10 +44,14 @@
         #  Remove comments if they contain <gettext> or </gettext>
         $text =~ s/^[ \t]*#.*<\/?gettext\b//mg;
         $lineno = 1;
-        while ($text =~ m{\G(.*?)(<gettext\b[^>]*>)(.*?)</gettext>}gs) {
-                $msgid = escape($3);
+        while ($text =~ m{\G(.*?)(<gettext\b(?:\s+domain="([^"]+)")?[^>]*>)(.*?)</gettext>}gs) { # " -- to fix vim syntax hilighting :)
+                $msgid = escape($4);
                 $lineno += countNewline ($1.$2);
-                $nextlineno = countNewline ($3);;
+                $nextlineno = countNewline ($4);;
+                if ($3 && ($domain ne $3)) {
+                   $lineno += $nextlineno;
+                   next;  # wrong domain
+                }
                 $comment = '';
                 if ($1 =~ m/(((^|\n)[ \t]*#.*)+)\n?[^\n]*$/) {
                         $comment = $1;
Index: Makefile
===================================================================
RCS file: /cvs/webwml/webwml/english/po/Makefile,v
retrieving revision 1.31
diff -u -r1.31 Makefile
--- Makefile	5 Nov 2002 22:16:41 -0000	1.31
+++ Makefile	14 Nov 2002 14:18:34 -0000
@@ -36,7 +36,7 @@
   ddp.wml events_common.wml fixes_link.wml footer.wml languages.wml \
   links.tags.wml mirrors.wml news.wml recent_list.wml security_tags.wml \
   todoitem.wml translation-check.wml url.wml votebar.wml \
-  weeklynews/footer.wml)
+  weeklynews/footer.wml) $(ENGLISHDIR)/devel/website/tc.data
 
 POTFILES = $(addprefix $(ENGLISHDIR)/po/,$(addsuffix .pot,$(DOMAINS)))
 MOFILES = $(addsuffix .mo,$(DOMAINS))
@@ -51,37 +51,37 @@
 endif
 
 $(ENGLISHDIR)/po/templates.pot: # $(templates_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(templates_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl templates $(templates_FILES) > $@
 
 $(ENGLISHDIR)/po/bugs.pot: # $(bugs_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(bugs_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl bugs $(bugs_FILES) > $@
 
 $(ENGLISHDIR)/po/countries.pot: # $(countries_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(countries_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl countries $(countries_FILES) > $@
 
 $(ENGLISHDIR)/po/doc.pot: # $(doc_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(doc_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl doc $(doc_FILES) > $@
 
 $(ENGLISHDIR)/po/l10n.pot: # $(l10n_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(l10n_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl l10n $(l10n_FILES) > $@
 
 $(ENGLISHDIR)/po/langs.pot: # $(langs_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(langs_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl langs $(langs_FILES) > $@
 
 $(ENGLISHDIR)/po/organization.pot: # $(organization_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(organization_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl organization $(organization_FILES) > $@
 
 $(ENGLISHDIR)/po/ports.pot: # $(ports_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(ports_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl ports $(ports_FILES) > $@
 
 $(ENGLISHDIR)/po/search.pot: # $(search_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(search_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl search $(search_FILES) > $@
 
 $(ENGLISHDIR)/po/vendors.pot: # $(vendors_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(vendors_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl vendors $(vendors_FILES) > $@
 
 $(ENGLISHDIR)/po/others.pot: # $(others_FILES)
-	$(ENGLISHDIR)/po/wmlxgettext.pl $(others_FILES) > $@
+	$(ENGLISHDIR)/po/wmlxgettext.pl others $(others_FILES) > $@
 
 %.mo: %.$(LANGUAGE).po $(ENGLISHDIR)/po/%.pot
 	msgmerge -q $*.$(LANGUAGE).po $(ENGLISHDIR)/po/$*.pot |\

Attachment: pgpsEXkn7iYrx.pgp
Description: PGP signature


Reply to: