[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trans-coord/gnun/server/gnun ChangeLog GNUmakefile
From: |
Yavor Doganov |
Subject: |
trans-coord/gnun/server/gnun ChangeLog GNUmakefile |
Date: |
Fri, 30 May 2008 15:13:23 +0000 |
CVSROOT: /sources/trans-coord
Module name: trans-coord
Changes by: Yavor Doganov <yavor> 08/05/30 15:13:23
Modified files:
gnun/server/gnun: ChangeLog GNUmakefile
Log message:
What's new, pussy cat? Who-oo-oo-who... --Tom Jones
Initial implementation of the whatsnew/gnusflashes translations
handling.
(wn-po, wn-html, gnusfl, gnunews): New variables.
(all): Depend on $(gnunews).
($(template-dir)/po/whatsnew.proto)
($(template-dir)/po/whatsnew.pot)
($(template-dir)/whatsnew.%.include)
($(rootdir)/gnusflashes.%.include)
($(template-dir)/po/whatsnew.%.html): New rules.
(verbatim-templates): Add `whatsnew.html' and `whatsnew.include'.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.72&r2=1.73
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.35&r2=1.36
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- ChangeLog 28 May 2008 19:16:57 -0000 1.72
+++ ChangeLog 30 May 2008 15:13:22 -0000 1.73
@@ -1,3 +1,16 @@
+2008-05-30 Yavor Doganov <address@hidden>
+
+ Initial implementation of the whatsnew/gnusflashes translations
+ handling.
+ * GNUmakefile (wn-po, wn-html, gnusfl, gnunews): New variables.
+ (all): Depend on $(gnunews).
+ ($(template-dir)/po/whatsnew.proto)
+ ($(template-dir)/po/whatsnew.pot)
+ ($(template-dir)/whatsnew.%.include)
+ ($(rootdir)/gnusflashes.%.include)
+ ($(template-dir)/po/whatsnew.%.html): New rules.
+ (verbatim-templates): Add `whatsnew.html' and `whatsnew.include'.
+
2008-05-28 Yavor Doganov <address@hidden>
* GNUmakefile ($(rootdir)/home.$(1).shtml): Delete the conditional
Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- GNUmakefile 28 May 2008 19:16:57 -0000 1.35
+++ GNUmakefile 30 May 2008 15:13:23 -0000 1.36
@@ -84,6 +84,18 @@
endif
### End of variables declaration (templates) ###
+### Special variables for whatsnew (a.k.a. gnunews) ###
+# Compute everything based on the present PO files.
+wn-po := $(wildcard $(template-dir)/po/whatsnew.*.po)
+wn-html := $(wn-po:%.po=%.html)
+gnusfl := $(subst $(template-dir)/po/whatsnew,$(rootdir)/gnusflashes, \
+ $(wn-po:%.po=%.include))
+gnunews := $(template-dir)/po/whatsnew.pot $(wn-html) $(gnusfl)
+ifeq ($(VERBOSE),yes)
+$(info gnunews = $(gnunews))
+endif
+### End of variables declaration (whatsnew) ###
+
### Special variables for the home pages ###
home-lang = $(rootdir)/home.$(1).shtml
home-translated := $(foreach h-lang,$(HOME_LINGUAS), \
@@ -114,7 +126,7 @@
### End of variables declaration (all articles) ###
.PHONY: all vcs-add-always
-all: $(template-translated) $(home-translated) $(ALL_POTS) \
+all: $(template-translated) $(gnunews) $(home-translated) $(ALL_POTS) \
$(articles-translated) vcs-add-always
# The command to add a file to the repository.
@@ -222,6 +234,110 @@
$(foreach t-lang,$(TEMPLATE_LINGUAS),$(eval $(call template-rules,$(t-lang))))
### End of the templates-specific rules ###
+### Specific rules for the What's New system (a.k.a. GNU news).
+# There is a lot of duplication with article-rules, but at least one
+# command in every recipe has to be different. Also, we don't want
+# whatsnew to be in gnun.mk as if it is it will be build by the
+# article-rules anyway. The `whatsnew' targets are built before the
+# homepages in order any newly generated gnusflashes.LANG.include to
+# be #include'd automatically in the corresponding homepage.
+$(template-dir)/po/whatsnew.proto: $(template-dir)/whatsnew.html
+ $(VALIDATESKIP) ./validate-html-notify $(NOTIFYSKIP) $(web-addr) $<
+ $(mail-error-proto) ./make-prototype --input=$< \
+ --generic=generic.html --translinks=$(basename $@).translinks \
+ --output=$@ \
+ || ($(RM) $@ $(basename $@).translinks ; exit 1)
+ $(SED) --in-place "s/\$$Date.*\$$/<gnun>\0<\/gnun>/g" $@
+# Temporary escape of <!--#include --> directives, in order to
+# workaround a bug introduced in Po4a 0.33.
+ $(SED) --in-place 's/<!--\#include .*-->/<gnun>\0<\/gnun>/g' $@
+
+$(template-dir)/po/whatsnew.pot: $(template-dir)/po/whatsnew.proto \
+ $(template-dir)/whatsnew.include
+ $(addfile)
+# The generation of whatsnew.pot is special, as it contains all
+# strings for building whatsnew.LANG.html and whatsnew.LANG.include.
+ $(PO4A-GETTEXTIZE) $(PO4A-XHTMLFLAGS) $(PO4A-GETTEXTIZEFLAGS) \
+ --master $< --master $(template-dir)/whatsnew.include --po
address@hidden
+ if ([ ! -f $@ ] \
+ || [ "`diff -U 0 $@ address@hidden | grep -v "^\(---\|+++\|@@\)" \
+ | grep -v '^[-+]\"POT-Creation-Date:' | wc -c`" -ne 0 ]); then \
+ mv address@hidden $@ ; \
+ fi; \
+ touch $@
+ $(RM) address@hidden
+
+# Reordering the prerequisites would save the redundant usage of the
+# $* automatic variable but $(addfile) wouldn't work.
+.PRECIOUS: $(template-dir)/whatsnew.%.include
+$(template-dir)/whatsnew.%.include: $(template-dir)/whatsnew.include \
+ $(template-dir)/po/whatsnew.%.po
+ $(addfile)
+ PO=$(template-dir)/po/whatsnew.$*.po ; \
+ ./mailfail $(NOTIFYSKIP) $(transl-addr) \
+ "[GNUN Error] $${PO#../../} is not a valid PO file" \
+ $(VALIDATESKIP) $(MSGFMT) --check --verbose \
+ --output-file=/dev/null $$PO || (touch $$PO ; exit 1)
+# The <dd> element is not wrapped on purpose, for easy generation of
+# gnusflashes.LANG.include.
+# FIXME: Unfortunately, if the translator wraps the msgstr with M-q,
+# then grep in the gnusflashes recipe skips all those wrapped news as
+# there is no match. Figure out how to avoid this problem or
+# alternatively, say louder that deliberate wrapping of msgstr is a
+# BAD thing.
+ PO=$(template-dir)/po/whatsnew.$*.po OUT=$@ ; \
+ $(PO4A-TRANSLATE) $(PO4A-XHTMLFLAGS) $(PO4A-TRANSLATEFLAGS) \
+ -o "translated=W<dd>" --master $< --po $$PO --localized $$OUT
+
+# Derive the targets from whatsnew.LANG.include. Pattern rules rule.
+$(rootdir)/gnusflashes.%.include: $(template-dir)/whatsnew.%.include
+ $(addfile)
+ echo "<!--Automatically generated by GNUN; do not edit!-->" -> $@
+ grep --max-count=3 '<dd>.*</dd>' $< >> $@
+ $(SED) --in-place "s/\(\/\?\)dd>/\1p>/g" $@ || (touch $< ; exit 1)
+
+# This target is deliberately generated in the wrong sub-directory,
+# otherwise it will be built by template-rules which we want to avoid
+# at all cost.
+$(template-dir)/po/whatsnew.%.html: $(template-dir)/po/whatsnew.proto \
+ $(template-dir)/po/whatsnew.translinks \
+ $(template-dir)/po/whatsnew.%.po \
+ generic.%.html
+ [ -f $(template-dir)/$(@F) ] \
+ || (touch $(template-dir)/$(@F) ; \
+ $(CVSSKIP) $(CVS) add $(template-dir)/$(@F))
+ PO=$(template-dir)/po/whatsnew.$*.po ; ./mailfail \
+ $(NOTIFYSKIP) $(transl-addr) \
+ "[GNUN Error] $${PO#../../} is not a valid PO file" \
+ $(VALIDATESKIP) $(MSGFMT) --check --verbose --output-file=/dev/null \
+ $$PO || (touch $$PO ; exit 1)
+ PO=$(template-dir)/po/whatsnew.$*.po \
+ OUT=$(template-dir)/po/whatsnew.$*.m4 ; $(PO4A-TRANSLATE) \
+ $(PO4A-XHTMLFLAGS) $(PO4A-TRANSLATEFLAGS) --master $< \
+ --po $$PO --localized $$OUT
+ $(SED) --in-place \
+ "s/\(<gnun>include(\`.*\)\([.]html')<\/gnun>\)/\1.$*\2/g" \
+ $(template-dir)/po/whatsnew.$*.m4
+ $(SED) --in-place "s/<gnun>\(.*\)<\/gnun>/\1/g" \
+ $(template-dir)/po/whatsnew.$*.m4
+ $(SED) --in-place \
+ ':egin;N;$$!begin;s/\([ \t]*\n[ \t]*\)\{3,\}<!--/\n\n<!--/g' \
+ $(template-dir)/po/whatsnew.$*.m4
+ for inc in $(localized-includes); do \
+ $(SED) --in-place \
+ "s/\(<!--#include virtual=\".*$$inc\)\(.html\" -->\)/\1.$*\2/g" \
+ $(template-dir)/po/whatsnew.$*.m4; \
+ done
+ $(SED) --in-place \
+ "s/\(<!--#include virtual=\".*whatsnew\)\(.include\" -->\)/\1.$*\2/g"
\
+ $(template-dir)/po/whatsnew.$*.m4
+ $(M4) $(template-dir)/po/whatsnew.$*.m4 > $@
+ $(VALIDATESKIP) ./validate-html-notify $(NOTIFYSKIP) $(transl-addr) \
+ $@ || (sleep 2 ; touch $(template-dir)/po/whatsnew.$*.po ; exit 1)
+# Copy the target where it belongs.
+ cp $@ $(template-dir)
+### End of the whatsnew-specific rules ###
+
### Specific rules for the homepages ###
$(rootdir)/po/home.proto: $(rootdir)/home.shtml
# Delete the target if the script exits with a non-zero status in
@@ -362,7 +478,8 @@
header.pt-br.html footer.pt-br.html \
header.ru.html footer.ru.html \
header.tr.html footer.tr.html \
- header.zh-cn.html footer.zh-cn.html)
+ header.zh-cn.html footer.zh-cn.html \
+ whatsnew.html whatsnew.include)
.PHONY: sync
sync: