[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trans-coord/gnun/server/gnun ChangeLog GNUmakef...
From: |
Pavel Kharitonov |
Subject: |
trans-coord/gnun/server/gnun ChangeLog GNUmakef... |
Date: |
Sun, 20 Nov 2011 11:41:14 +0000 |
CVSROOT: /sources/trans-coord
Module name: trans-coord
Changes by: Pavel Kharitonov <ineiev> 11/11/20 11:41:14
Modified files:
gnun/server/gnun: ChangeLog GNUmakefile NEWS
gnun/server/gnun/doc: gnun.texi web-trans.texi
Log message:
Add a variable for extra templates to gnun.mk.
Define rules to regenerate them.
Replace `for' cycles for sedding localized includes with
`$(foreach)' cycles.
* GNUmakefile (substitute-localized-includes):
(extra-template-lang-rules, extra-template-rules): New functions.
(localized-includes, template-translated-base, template-pots):
Add extra templates.
* doc/gnun.texi, doc/web-trans.texi, NEWS: Update.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.213&r2=1.214
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.101&r2=1.102
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/NEWS?cvsroot=trans-coord&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/doc/gnun.texi?cvsroot=trans-coord&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/doc/web-trans.texi?cvsroot=trans-coord&r1=1.18&r2=1.19
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -b -r1.213 -r1.214
--- ChangeLog 15 Nov 2011 16:28:49 -0000 1.213
+++ ChangeLog 20 Nov 2011 11:41:13 -0000 1.214
@@ -1,3 +1,16 @@
+2011-11-20 Pavel Kharitonov <address@hidden>
+
+ Add a variable for extra templates to gnun.mk.
+ Define rules to regenerate them.
+ Replace `for' cycles for sedding localized includes with
+ `$(foreach)' cycles.
+
+ * GNUmakefile (substitute-localized-includes):
+ (extra-template-lang-rules, extra-template-rules): New functions.
+ (localized-includes, template-translated-base, template-pots):
+ Add extra templates.
+ * doc/gnun.texi, doc/web-trans.texi, NEWS: Update.
+
2011-11-15 Pavel Kharitonov <address@hidden>
* configure.ac: Add some checks for GNUness of `sed'.
Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -b -r1.101 -r1.102
--- GNUmakefile 13 Nov 2011 11:19:02 -0000 1.101
+++ GNUmakefile 20 Nov 2011 11:41:13 -0000 1.102
@@ -80,13 +80,20 @@
rootdir := ../..
+include gnun.mk
+
# FIXME: footer-short and footer-min are remnants from the old-new
# design; they should go at some point.
localized-includes := header head-include-1 head-include-2 banner \
body-include-1 body-include-2 footer \
- footer-short footer-min
+ footer-short footer-min $(extra-templates)
-include gnun.mk
+# Issue a command to substitute localized includes in a HTML file.
+# Usage: $(call substitute-localized-includes,$(lang)) file.$(lang).html
+define substitute-localized-includes
+$(SED) --in-place $(foreach inc, $(localized-includes), \
+ -e 's%\(<!--#include virtual=\".*$(inc)\)\(.html\" -->\)%\1.$(1)\2%g')
+endef
### Special variables for the `www' master templates ###
template-dir := $(rootdir)/server
@@ -96,8 +103,12 @@
footer-text \
outdated
template-translated-base := $(addprefix $(template-dir)/,$(template-files))
+template-translated-base += $(addprefix $(rootdir)/,$(extra-templates))
template-pots := $(addsuffix .pot, \
- $(addprefix $(template-dir)/po/,$(template-files)))
+ $(addprefix $(template-dir)/po/,$(template-files)) \
+ $(foreach template,$(extra-templates), \
+ $(addprefix $(rootdir)/, \
+ $(dir $(template)))po/$(notdir $(template))))
template-lang = $(addsuffix .$(1).html,$(template-translated-base))
template-translated := $(foreach t-lang,$(TEMPLATE_LINGUAS), \
$(call template-lang,$(t-lang)))
@@ -530,6 +541,43 @@
$(foreach t-lang,$(TEMPLATE_LINGUAS),$(eval $(call template-rules,$(t-lang))))
### End of the templates-specific rules ###
+### Specific rules for extra templates ###
+# Essentially duplicate rules for templates, but define per-template
+# rules rather than use static patterns
+define extra-template-lang-rules
+.PRECIOUS: $(1).$(2).po
+$(1).$(2).po: $(1).pot
+ [ -f $$@ ] || (cp $$< $$@ ; $(VCSSKIP) $(vcs) add $$@)
+ -PO=$$@ ; $(check-po)
+ $(call update-po,$$@,$$<)
+
+$(subst /po/,/,$(1)).$(2).html: $(subst /po/,/,$(1)).html \
+ $(1).$(2).po
+ PO=$(1).$(2).po ; $(check-po) \
+ || (touch $$$$PO ; exit 1)
+ $$(addfile)
+ PO=$(1).$(2).po OUT=$$@ ; $(generate-html)
+ $(SED) --in-place \
+ ':egin;N;$$$$!begin;s/\([ \t]*\n[ \t]*\)\{3,\}<!--/\n\n<!--/g' $$@
+endef
+
+define extra-template-rules
+.PRECIOUS: $(1).pot
+$(1).pot: $(subst /po/,/,$(1)).html
+ $$(addfile)
+ $$(generate-pot)
+
+$(foreach t-lang,$(TEMPLATE_LINGUAS),\
+ $(eval $(call extra-template-lang-rules,$(strip $(1)),$(t-lang))))
+endef
+
+$(foreach template, $(extra-templates),\
+ $(eval $(call extra-template-rules, \
+ $(addprefix $(rootdir)/, \
+ $(dir $(template)))po/$(notdir $(template)))))
+
+### End of rules for extra templates ###
+
# generate-translinks is desined to be used from eval'ed expression,
# this is why we can't invoke it from whatsnew rules and rather
# indirectly define a rule to build the file.
@@ -651,11 +699,8 @@
$(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
+ $(call substitute-localized-includes,$*) \
+ $(template-dir)/po/whatsnew.$*.m4
$(SED) --in-place \
"s/\(<!--#include virtual=\".*whatsnew\)\(.include\" -->\)/\1.$*\2/g"
\
$(template-dir)/po/whatsnew.$*.m4
@@ -735,11 +780,7 @@
$(SED) --in-place \
':egin;N;$$$$!begin;s/\([ \t]*\n[ \t]*\)\{3,\}<!--/\n\n<!--/g' \
$(rootdir)/po/$(2).$(1).m4
- for inc in $(localized-includes); do \
- $(SED) --in-place \
- "s/\(<!--#include virtual=\".*$$$$inc\)\(.html\" -->\)/\1.$(1)\2/g" \
- $(rootdir)/po/$(2).$(1).m4; \
- done
+ $(call substitute-localized-includes,$(1)) $(rootdir)/po/$(2).$(1).m4
[ ! -f $(rootdir)/gnusflashes.$(1).include ] || $(SED) --in-place \
"s/\(<!--#include file=\"gnusflashes*\)\(.include\"
-->\)/\1.$(1)\2/g" \
$(rootdir)/po/$(2).$(1).m4
@@ -846,11 +887,7 @@
$(SED) --in-place \
':egin;N;$$$$!begin;s/\([ \t]*\n[ \t]*\)\{3,\}<!--/\n\n<!--/g' \
$(1).m4
- for inc in $(localized-includes); do \
- $(SED) --in-place \
- "s/\(<!--#include virtual=\".*$$$$inc\)\(.html\" -->\)/\1.$(2)\2/g" \
- $(1).m4; \
- done
+ $(call substitute-localized-includes,$(2)) $(1).m4
# If GRACE is not defined, which is the usual case for local manual
# builds, update the target and validate the result.
ifndef GRACE
Index: NEWS
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/NEWS,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- NEWS 13 Nov 2011 11:19:03 -0000 1.37
+++ NEWS 20 Nov 2011 11:41:13 -0000 1.38
@@ -2,6 +2,9 @@
* Changes in GNUnited Nations 0.5 (201?-??-??)
+** New variable in gnun.mk: `extra-templates'. It adds flexibility
+ to the set of templates.
+
** Support for localized URLs. GNUN replaces links to selected
images with their localized versions when available.
Index: doc/gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/gnun.texi,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- doc/gnun.texi 13 Nov 2011 11:19:03 -0000 1.28
+++ doc/gnun.texi 20 Nov 2011 11:41:14 -0000 1.29
@@ -836,6 +836,9 @@
@file{server/address@hidden and
@file{server/address@hidden
+Additional templates are defined via the @var{extra-templates} variable
+in @file{server/gnun/gnun.mk}.
+
@cindex HOME_LINGUAS
@cindex homepage, defining
@cindex defining homepage
Index: doc/web-trans.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/web-trans.texi,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- doc/web-trans.texi 13 Nov 2011 11:19:03 -0000 1.18
+++ doc/web-trans.texi 20 Nov 2011 11:41:14 -0000 1.19
@@ -261,6 +261,9 @@
submit them in the usual way, together with the translation of the
essay.
+Additional templates are defined via the @var{extra-templates} variable
+in @file{server/gnun/gnun.mk}.
+
If you don't want to translate the templates for whatever reason---do
not worry, the web-translators will install empty templates (which means
the English strings will be used).
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- trans-coord/gnun/server/gnun ChangeLog GNUmakef...,
Pavel Kharitonov <=