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

Re: Formatting suggestion for Debian Project News' similar sections



[added debian-www in cc as maybe someone could/would help with the patch]

Hi,

On Thu, Feb 09, 2012 at 03:09:37PM +0900, AYANOKOUZI, Ryuunosuke wrote:
> Dear Publicity Team,
> 
> I'm one member of Japanese translation team for Debian Project News
> (DPN). I would suggest to use Include Pre-Processor and Macro
> Processor in DPN's index.wml file.

thank you for bringing up this, it's a really good idea! :)


> In one years, I worked on Japanese translation of DPN, and I find that
> there are some sections and/or paragraphs which are exactly same as or
> similar to previous issues. For example, "Want to continue reading
> DPN?" section is exactly same as every issues in 2011 and
> "Work-needing packages" section is similar to previous issue except
> for a part of number of orphaned and up-for-adoption packages.
> 
> You know, translating such sections each time by hand is a waste of
> translation resources. So, I would like to suggest pseudo-solutions
> for each cases in above.
> 
> 1st CASE:
> #include "/path/to/Want_to_continue_reading_DPN.wml-template"
> 
> 2nd CASE:
> <define-tag orphaned>396</define-tag>
> <define-tag upforadoption>149</define-tag>
> #include "/path/to/Work-needing_packages.wml-template"
> 
> When this is done and once translation of each included files is done,
> translators never need to mind for the translation of such sections.
> 

Sure. I'm working on a patch for this: the idea is basically replace the
paragraphs which have (almost) identical text in every issue, with a pre
defined tag + specific variables (similar to what you propose).
And then, provide gettext strings for all this tags, in order to have
them automagically replaced by gettext with the translated text.

I've already done the first part, while I'm having some problems with the
second one, for a specific tag. 
I'm stuck in trying to resolve this problem, and then the patch will be ready.
I'll not be able to work on it before next Tuesday, so I attach here the
patch (in case someone wants to dig into it :) ).

In order to work with it you'll need a full checkout of the webwml
repository (i.e. including all languages), and add a new file:
webwml/english/News/weekly/dpn.defs (attached).
The tag who creates problems with gettext is the <wnpp /> ones: even if
adding the translated strings in webwml/$lang/po/newsevents.$lang.po
gettext returns the original message (i.e. english) in the
webwml/$lang/News/weekly/2012/04/index.$lang.html.

How to work on it/ reproduce it:

1. add dpn.defs on webwml/english/News/weekly/
2. apply patch provided (and rebuild mo files for danish with: cd webwml/danish/po/ && make)
3. cd webwml/danish/News/weekly
4. make 2012/04/index.da.html


Improvements welcome!

Cheers,
Francesca
-- 
"Nostra patria è il mondo intero
e nostra legge è la libertà
ed un pensiero
ribelle in cor ci sta."		P.Gori
#use wml::debian::common_tags


### TODO:
# "interviews": text changes in case of 1 or more interviews
#
# "events": need to add a list of events inside to block of standard
# (and gettextized) text
#
# "newcontributors": 3 vars (dd, dm, uploader) + if one of them ==0 just
# skip it
#
# "dsa": 3 tags (dsa, stable announce, bpo announce) each one with own
# list, inside 2 blocks of gettextized text + if one is not added just
# skip it
#
# "nnwp": gettextized block + list
#
#
#



# here the only variable is the number (expressed in letters) of the issue, there's probably a
# smarter way to do it, but for now this one works.
# example:
# <intro issue="fourth" />

<bind-gettext-domain domain="newsevents" />
<define-tag intro>
<preserve issue />
<set-var %attributes />
<gettext domain="newsevents"><p>Welcome to this year's <get-var issue /> issue of DPN, the newsletter for the
Debian community. Topics covered in this issue include:</p></gettext>
<restore  issue />
</define-tag>

## rc-paragraph. We have three different vars:
# release: is the codename for the current testing 
# testing: is the number of bugs as defined by this UDD query →
# http://udd.debian.org/bugs.cgi?release=wheezy_and_sid&patch=&pending=&security=&wontfix=&upstream=&unreproducible=&forwarded=&claimed=&deferred=&notmain=&notwheezy=&base=&standard=&merged=&done=&outdatedwheezy=&outdatedsid=&needmig=&newerubuntu=&fnewer=&fnewerval=7&rc=1&sortby=source&sorto=asc&cpopcon=1&cseverity=1&ctags=1
# tobefixed: is the number of bugs as defined by this UDD query →
# http://udd.debian.org/bugs.cgi?release=wheezy_and_sid&patch=ign&pending=ign&security=ign&wontfix=&upstream=&unreproducible=&forwarded=&claimed=ign&deferred=ign&notmain=ign&notwheezy=&base=&standard=&merged=ign&done=ign&outdatedwheezy=&outdatedsid=&needmig=&newerubuntu=&fnewer=&fnewerval=7&rc=1&sortby=source&sorto=asc&cpopcon=1&cseverity=1&ctags=1
#
# example:
# <rcstats release="Wheezy"
# 	testing="613"
# 	tobefixed="410" />

<define-tag rcstats>
<preserve release />
<preserve testing />
<preserve tobefixed />
<set-var %attributes />
<gettext domain="newsevents"><p>According to the <a href="http://udd.debian.org/bugs.cgi";>Bugs Search
interface of the Ultimate Debian Database</a>, the upcoming release, Debian  <q><get-var release /></q>,
is currently affected by <get-var testing /> Release-Critical bugs. Ignoring bugs which are easily solved
or on the way to being solved, roughly speaking, about <get-var tobefixed /> Release-Critical bugs remain to be solved for the
release to happen.</p>
<p>There are also some <a href="http://wiki.debian.org/ProjectNews/RC-Stats";>hints on how to
interpret</a> these numbers.</p></gettext>
<restore release />
<restore testing />
<restore tobefixed />
</define-tag>

## this one regards wnpp, and variables are:
# link: link to the mail report from wnnp@debian.org to
# debian-devel@lists.debian.org for the current week
#
# orphaned: the number of packages orphaned according to $link
# rfa: the number of packages up for adoption according to $link
#
# example:
# <wnpp link="http://http://lists.debian.org/debian-devel/2012/02/msg00710.html";
# 	orphaned="409"
# 	rfa="142" />

<define-tag wnpp>
<preserve link />
<preserve orphaned />
<preserve rfa />
<set-var %attributes />
<gettext domain="newsevents"><p><a href="<get-var link />">Currently</a> <a href="$(DEVEL)/wnpp/orphaned"><get-var orphaned /> packages are orphaned</a>
and <a href="$(DEVEL)/wnpp/rfa"><get-var rfa /> packages are up for adoption</a>: please visit the complete list of <a href="$(DEVEL)/wnpp/help_requested">packages
which need your help</a>.</p></gettext>
<restore link />
<restore orphaned />
<restore rfa />
</define-tag>


# this is the final paragraph: no vars in here, you just need to put the
# tag as it is at the end of the file (just before the editor line)
# example:
# <continue-dpn />

<define-tag continue-dpn>
<gettext domain="newsevents"><p>Please help us create this newsletter. We still need more volunteer writers
to watch the Debian community and report about what is going on. Please see the  
<a href="http://wiki.debian.org/ProjectNews/HowToContribute";>contributing page</a> to find out how to help.
We're looking forward to receiving your mail at <a href="mailto:debian-publicity@lists.debian.org";>debian-publicity@lists.debian.org</a>.</p></gettext>
</define-tag>

Index: english/News/weekly/Makefile
===================================================================
RCS file: /cvs/webwml/webwml/english/News/weekly/Makefile,v
retrieving revision 1.55
diff -u -u -r1.55 Makefile
--- english/News/weekly/Makefile	25 Apr 2011 14:04:10 -0000	1.55
+++ english/News/weekly/Makefile	29 Feb 2012 15:12:10 -0000
@@ -38,7 +38,9 @@
 # When building the html files we have to change into the right directory
 # so wml gets all the relative links right.
 %.$(LANGUAGE).html : %.wml $(TEMPLDIR)/weeklynews/footer.wml \
-	                   $(TEMPLDIR)/weeklynews/header.wml $(GETTEXTDEP)
+	                   $(TEMPLDIR)/weeklynews/header.wml $(GETTEXTDEP) \
+			   $(ENGLISHDIR)/News/weekly/dpn.defs
+		
 ifeq "$(LANGUAGE)" "ja"
 	cd $(@D) && $(subst ../../convert,$(ABS_DIR)/../../convert,$(WML)) $(notdir $(<))
 else
Index: english/News/weekly/2012/04/index.wml
===================================================================
RCS file: /cvs/webwml/webwml/english/News/weekly/2012/04/index.wml,v
retrieving revision 1.1
diff -u -u -r1.1 index.wml
--- english/News/weekly/2012/04/index.wml	20 Feb 2012 15:34:57 -0000	1.1
+++ english/News/weekly/2012/04/index.wml	29 Feb 2012 15:12:10 -0000
@@ -4,9 +4,10 @@
 # $Rev: 3226 $
 # Status: [frozen]
 
+#include "$(ENGLISHDIR)/News/weekly/dpn.defs"
+
+<intro issue="fourth" />
 
-<p>Welcome to this year's fourth issue of DPN, the newsletter for the
-Debian community. Topics covered in this issue include:</p>
 <toc-display/>
 
 <toc-add-entry name="EOLlenny">Goodbye Lenny!</toc-add-entry>
@@ -214,19 +215,9 @@
 # to get Debian 7.0 released.
 # in the view of the release managers 637 need to be dealt with for the
 # release to happen.
-
-	<p>According to the <a href="http://udd.debian.org/bugs.cgi";>Bugs Search
-        interface of the Ultimate Debian Database</a>, the upcoming release,
-	Debian 7.0 <q>Wheezy</q>, is currently affected by
-613 Release-Critical bugs. Ignoring bugs which are easily solved
-	or on the way to being solved, roughly speaking, about
-410 Release-Critical bugs remain to be solved for the
-	release to happen.</p>
-
-	<p>There are also some <a
-	href="http://wiki.debian.org/ProjectNews/RC-Stats";>hints on how to
-	interpret</a> these numbers.</p>
-
+<rcstats release="Wheezy"
+	testing="613"
+	tobefixed="410" />
 
 <toc-add-entry name="dsa">Important Debian Security Advisories</toc-add-entry>
 
@@ -276,21 +267,13 @@
 
 <toc-add-entry name="wnpp">Work-needing packages</toc-add-entry>
 
-<p><a href="http://lists.debian.org/debian-devel/2012/02/msg00710.html";>Currently</a> <a href="$(DEVEL)/wnpp/orphaned">\
-409 packages are orphaned</a> and <a href="$(DEVEL)/wnpp/rfa">\
-142 packages are up for adoption</a>: please visit the complete 
-	list of <a href="$(DEVEL)/wnpp/help_requested">packages
-	which need your help</a>.</p>
-
+<wnpp link="http://lists.debian.org/debian-devel/2012/02/msg00710.html";
+ orphaned="409"
+ rfa="142" />
 
 <toc-add-entry name="continuedpn">Want to continue reading DPN?</toc-add-entry>
 
-<p>Please help us create this newsletter. We still need more volunteer writers
-to watch the Debian community and report about what is going on. Please see the
-<a href="http://wiki.debian.org/ProjectNews/HowToContribute";>contributing
-page</a> to find out how to help. We're looking forward to receiving your mail
-at <a href="mailto:debian-publicity@lists.debian.org";>debian-publicity@lists.debian.org</a>.</p>
-
+<continue-dpn />
 
 #use wml::debian::projectnews::footer editor="Francesca Ciceri, David Prévot, Justin B Rye"
 # Translators may also add a translator="foo, bar, baz" to the previous line
Index: english/po/Makefile
===================================================================
RCS file: /cvs/webwml/webwml/english/po/Makefile,v
retrieving revision 1.91
diff -u -u -r1.91 Makefile
--- english/po/Makefile	10 Feb 2012 22:31:26 -0000	1.91
+++ english/po/Makefile	29 Feb 2012 15:12:10 -0000
@@ -35,7 +35,8 @@
   $(ENGLISHDIR)/events/speakers/speakers.defs \
   $(ENGLISHDIR)/events/talks.defs \
   $(ENGLISHDIR)/News/news.rdf.in \
-  $(ENGLISHDIR)/News/weekly/dwn-to-rdf.pl
+  $(ENGLISHDIR)/News/weekly/dwn-to-rdf.pl \
+  $(ENGLISHDIR)/News/weekly/dpn.defs
 organization_FILES = $(ENGLISHDIR)/intro/organization.data
 ports_FILES     = $(ENGLISHDIR)/ports/menu.defs \
   $(shell export LC_COLLATE=C; echo $(ENGLISHDIR)/ports/*/menu.inc) \
Index: english/po/newsevents.pot
===================================================================
RCS file: /cvs/webwml/webwml/english/po/newsevents.pot,v
retrieving revision 1.6
diff -u -u -r1.6 newsevents.pot
--- english/po/newsevents.pot	8 Jan 2012 19:16:36 -0000	1.6
+++ english/po/newsevents.pot	29 Feb 2012 15:12:10 -0000
@@ -230,3 +230,19 @@
 msgid "The newsletter for the Debian community"
 msgstr ""
 
+#: ../../english/News/weekly/dpn.defs:33
+msgid "<p>Welcome to this year's <get-var issue /> issue of DPN, the newsletter for the\nDebian community. Topics covered in this issue include:</p>"
+msgstr ""
+
+#: ../../english/News/weekly/dpn.defs:55
+msgid "<p>According to the <a href=\"http://udd.debian.org/bugs.cgi\";>Bugs Search\ninterface of the Ultimate Debian Database</a>, the upcoming release, Debian  <q><get-var release /></q>,\nis currently affected by <get-var testing /> Release-Critical bugs. Ignoring bugs which are easily solved\nor on the way to being solved, roughly speaking, about <get-var tobefixed /> Release-Critical bugs remain to be solved for the\nrelease to happen.</p>\n<p>There are also some <a href=\"http://wiki.debian.org/ProjectNews/RC-Stats\";>hints on how to\ninterpret</a> these numbers.</p>"
+msgstr ""
+
+#: ../../english/News/weekly/dpn.defs:84
+msgid "<p><a href=\"<get-var link />\">Currently</a> <a href=\"$(DEVEL)/wnpp/orphaned\"><get-var orphaned /> packages are orphaned</a>\nand <a href=\"$(DEVEL)/wnpp/rfa\"><get-var rfa /> packages are up for adoption</a>: please visit the complete list of <a href=\"$(DEVEL)/wnpp/help_requested\">packages\nwhich need your help</a>.</p>"
+msgstr ""
+
+#: ../../english/News/weekly/dpn.defs:99
+msgid "<p>Please help us create this newsletter. We still need more volunteer writers\nto watch the Debian community and report about what is going on. Please see the  \n<a href=\"http://wiki.debian.org/ProjectNews/HowToContribute\";>contributing page</a> to find out how to help.\nWe're looking forward to receiving your mail at <a href=\"mailto:debian-publicity@lists.debian.org\";>debian-publicity@lists.debian.org</a>.</p>"
+msgstr ""
+
Index: danish/News/weekly/2012/04/index.wml
===================================================================
RCS file: /cvs/webwml/webwml/danish/News/weekly/2012/04/index.wml,v
retrieving revision 1.1
diff -u -u -r1.1 index.wml
--- danish/News/weekly/2012/04/index.wml	21 Feb 2012 11:57:42 -0000	1.1
+++ danish/News/weekly/2012/04/index.wml	29 Feb 2012 15:12:10 -0000
@@ -4,10 +4,10 @@
 # $Id: index.wml,v 1.1 2012-02-21 11:57:42 kaare Exp $
 # $Rev: 3226 $
 # Status: [frozen]
+#include "$(ENGLISHDIR)/News/weekly/dpn.defs"
 
-<p>Velkommen til årets fjerde udgave af DPN, Debian-fællesskabets nyhedsbrev. 
-Emner i denne udgave er blandt andre:</p>
 <toc-display/>
+<intro issue="fjerde" />
 
 <toc-add-entry name="EOLlenny">Farvel Lenny!</toc-add-entry>
 
@@ -194,17 +194,9 @@
 # to get Debian 7.0 released.
 # in the view of the release managers 637 need to be dealt with for the
 # release to happen.
-
-<p>Ifølge <a href="http://udd.debian.org/bugs.cgi";>Bugs Search-grænsefladen i 
-Ultimate Debian Database</a>, er den kommende udgivelse, Debian 7.0 <q>Wheezy</q>, 
-i øjeblikket påvirket af 613 udgivelseskritiske fejl.  Hvis man ignorerer fejl, 
-der er lette at løse eller er ved at blive løst, er der rundt regnet 410 
-udgivelseskritiske fejl tilbage, som skal løses for at udgivelsen kan finde 
-sted.</p>
-
-<p>Der er også nogle 
-<a href="http://wiki.debian.org/ProjectNews/RC-Stats";>tips til hvordan man kan
-fortolke</a> tallene.</p>
+<rcstats release="Wheezy"
+	testing="613"
+	tobefixed="410" />
 
 
 <toc-add-entry name="dsa">Vigtige Debian Security Advisories</toc-add-entry>
@@ -252,20 +244,13 @@
 
 <toc-add-entry name="wnpp">Pakker, der har brug for hjælp</toc-add-entry>
 
-<p>I <a href="http://lists.debian.org/debian-devel/2012/02/msg00710.html";>\
-øjeblikket</a> er <a href="$(DEVEL)/wnpp/orphaned">409 pakker forældreløse</a> 
-og <a href="$(DEVEL)/wnpp/rfa">142 pakker kan adopteres</a>: se den komplette
-liste over <a href="$(DEVEL)/wnpp/help_requested">pakker, der har brug for din 
-hjælp</a>.</p>
+<wnpp link="http://lists.debian.org/debian-devel/2012/02/msg00710.html";
+ orphaned="409"
+ rfa="142" />
 
 
 <toc-add-entry name="continuedpn">Ønsker du fortsat at læse DPN?</toc-add-entry>
 
-<p>Hjælp os med at fremstillet nyhedsbrevet.  Vi har stadig behov for flere 
-frivillige skribenter, som overvåger Debian-fællesskabet og rapportere om hvad 
-der sker.  Se <a href="http://wiki.debian.org/ProjectNews/HowToContribute";>\
-bidragssiden</a> for at finde ud af hvordan man hjælper.  Vi ser frem til at 
-modtage din mail (på engelsk) på <a href="mailto:debian-publicity@lists.debian.org";>\
-debian-publicity@lists.debian.org</a>.</p>
+<continue-dpn />
 
 #use wml::debian::projectnews::footer editor="Francesca Ciceri, David Prévot, Justin B Rye" translator="Kåre Thor Olsen"
Index: danish/po/newsevents.da.po
===================================================================
RCS file: /cvs/webwml/webwml/danish/po/newsevents.da.po,v
retrieving revision 1.7
diff -u -u -r1.7 newsevents.da.po
--- danish/po/newsevents.da.po	14 Mar 2011 19:58:34 -0000	1.7
+++ danish/po/newsevents.da.po	29 Feb 2012 15:12:10 -0000
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: Debian webwml organization\n"
-"PO-Revision-Date: 2006-08-12 17:53+0200\n"
+"PO-Revision-Date: 2012-02-27 13:06+0100\n"
 "Last-Translator: unknown\n"
 "Language-Team: unknown\n"
 "Language: \n"
@@ -21,7 +21,78 @@
 msgid "p<get-var page />"
 msgstr "s.<get-var page />"
 
-#: ../../english/News/weekly/dwn-to-rdf.pl:142
+#: ../../english/News/weekly/dpn.defs:33
+msgid ""
+"<p>Welcome to this year's <get-var issue /> issue of DPN, the newsletter for "
+"the\n"
+"Debian community. Topics covered in this issue include:</p>"
+msgstr ""
+"<p>Velkommen til årets <get-var issue /> udgave af DPN, Debian-fællesskabets "
+"nyhedsbrev. Emner i denne udgave er blandt andre:</p>"
+
+#: ../../english/News/weekly/dpn.defs:55
+msgid ""
+"<p>According to the <a href=\"http://udd.debian.org/bugs.cgi\";>Bugs Search\n"
+"interface of the Ultimate Debian Database</a>, the upcoming release, Debian  "
+"<q><get-var release /></q>,\n"
+"is currently affected by <get-var testing /> Release-Critical bugs. Ignoring "
+"bugs which are easily solved\n"
+"or on the way to being solved, roughly speaking, about <get-var tobefixed /> "
+"Release-Critical bugs remain to be solved for the\n"
+"release to happen.</p>\n"
+"<p>There are also some <a href=\"http://wiki.debian.org/ProjectNews/RC-Stats";
+"\">hints on how to\n"
+"interpret</a> these numbers.</p>"
+msgstr ""
+"<p>Ifølge <a href=\"http://udd.debian.org/bugs.cgi\";>Bugs Search-"
+"grænsefladen i Ultimate Debian Database</a>, er den kommende udgivelse, "
+"Debian <q><get-var release /></q>, i øjeblikket påvirket af <get-var "
+"testing /> udgivelseskritiske fejl.  Hvis man ignorerer fejl, der er lette "
+"at løse eller er ved at blive løst, er der rundt regnet <get-var tobefixed /"
+"> udgivelseskritiske fejl tilbage, som skal løses for at udgivelsen kan "
+"finde sted.</p>\n"
+"<p>Der er også nogle <a href=\"http://wiki.debian.org/ProjectNews/RC-Stats";
+"\">tips til hvordan man kan fortolke</a> tallene.</p>"
+
+#: ../../english/News/weekly/dpn.defs:84
+msgid ""
+"<p><a href=\"<get-var link />\">Currently</a> <a href=\"$(DEVEL)/wnpp/"
+"orphaned\"><get-var orphaned /> packages are orphaned</a>\n"
+"and <a href=\"$(DEVEL)/wnpp/rfa\"><get-var rfa /> packages are up for "
+"adoption</a>: please visit the complete list of \n"
+"<a href=\"$(DEVEL)/wnpp/help_requested\">packages which need your help</a>.</"
+"p>"
+msgstr ""
+"<p>I <a href=\"<get-var link />\">øjeblikket</a> er <a href=\"$(DEVEL)/wnpp/"
+"orphaned\"><get-var orphaned /> pakker forældreløse</a>\n"
+"og <a href=\"$(DEVEL)/wnpp/rfa\"><get-var rfa /> pakker kan adopteres</a>: "
+"se den komplette\n"
+"liste over <a href=\"$(DEVEL)/wnpp/help_requested\">pakker, der har brug for "
+"din hjælp</a>.</p>"
+
+#. this is the final paragraph: no vars in here, you just need to put the
+#. tag as it is at the end of the file (just before the editor line)
+#. example:
+#. <continue-dpn />
+#: ../../english/News/weekly/dpn.defs:98
+msgid ""
+"<p>Please help us create this newsletter. We still need more volunteer "
+"writers\n"
+"to watch the Debian community and report about what is going on. Please see "
+"the  \n"
+"<a href=\"http://wiki.debian.org/ProjectNews/HowToContribute\";>contributing "
+"page</a> to find out how to help.\n"
+"We're looking forward to receiving your mail at <a href=\"mailto:debian-";
+"publicity@lists.debian.org\">debian-publicity@lists.debian.org</a>.</p>"
+msgstr ""
+"<p>Hjælp os med at fremstillet nyhedsbrevet.  Vi har stadig behov for flere "
+"frivillige skribenter, som overvåger Debian-fællesskabet og rapportere om "
+"hvad der sker.  Se <a href=\"http://wiki.debian.org/ProjectNews/";
+"HowToContribute\">bidragssiden</a> for at finde ud af hvordan man hjælper.  "
+"Vi ser frem til at modtage din mail (på engelsk) på <a href=\"mailto:debian-";
+"publicity@lists.debian.org\">debian-publicity@lists.debian.org</a>.</p>"
+
+#: ../../english/News/weekly/dwn-to-rdf.pl:143
 msgid "The newsletter for the Debian community"
 msgstr "Debian-fællesskabets nyhedsbrev"
 

Attachment: signature.asc
Description: Digital signature


Reply to: