[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trans-coord/gnun/server/gnun GNUmakefile ChangeLog
From: |
Pavel Kharitonov |
Subject: |
trans-coord/gnun/server/gnun GNUmakefile ChangeLog |
Date: |
Thu, 19 Dec 2013 09:04:55 +0000 |
CVSROOT: /sources/trans-coord
Module name: trans-coord
Changes by: Pavel Kharitonov <ineiev> 13/12/19 09:04:55
Modified files:
gnun/server/gnun: GNUmakefile ChangeLog
Log message:
Add a means to concurrently draft versions of the same translation;
update obsolete comments and invocations.
* GNUmakefile (po-suffix): New variable.
* (find-po, ALL_POS_BASE, article-rules): Take `po-suffix'
into account.
* (optional-template-lang-rules): Update the `generate-html'
invocation (no $4 is needed any more since 2013-09-05).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.173&r2=1.174
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.392&r2=1.393
Patches:
Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -b -r1.173 -r1.174
--- GNUmakefile 13 Dec 2013 13:56:43 -0000 1.173
+++ GNUmakefile 19 Dec 2013 09:04:55 -0000 1.174
@@ -54,6 +54,10 @@
# The lower limit of the number of repeating msgids to include in compendium.
COMMONALITY := 10
+# The means that (with the `draft-suffix' variable) makes it possible
+# to concurrently draft HTML pages from different PO files.
+po-suffix :=
+
# Default period to delay notice about translation being out of date
ifdef GRACE
OUTDATED-GRACE := 60
@@ -97,8 +101,6 @@
NOTIFYSKIP := --dry-run
endif
-# FIXME: footer-short and footer-min are remnants from the old-new
-# design; they should go at some point.
localized-includes := $(localized-ssis) \
$(extra-templates) $(optional-templates)
@@ -151,7 +153,7 @@
transfer-to-po = \
$(patsubst ./%,%,$(join $(patsubst %,%po/,$(dir $(1))),$(notdir $(1))))
-find-po = $(wildcard $(1).*.po)
+find-po = $(wildcard $(1).*.po${po-suffix})
### Special variables for `no-grace' items ###
no-grace-items := \
$(addprefix $(rootdir)/,$(call transfer-to-po,$(no-grace-articles)))
@@ -182,8 +184,8 @@
ALL_POTS := $(articles-pot) $(root-articles-pot)
ALL_BASE := $(ALL_POTS:%.pot=%)
ALL_POS := $(foreach base,$(ALL_BASE),$(call find-po,$(base)))
-ALL_POS_BASE := $(ALL_POS:%.po=%)
-articles-translated := $(subst /po/,/,$(ALL_POS:%.po=%.html))
+ALL_POS_BASE := $(ALL_POS:%.po${po-suffix}=%)
+articles-translated := $(subst /po/,/,$(ALL_POS:%.po${po-suffix}=%.html))
ifeq ($(VERBOSE),yes)
$(info ALL_POTS = $(ALL_POTS))
$(info articles-translated = $(articles-translated))
@@ -469,14 +471,10 @@
# The command to generate the translated article $(3) in language $(1)
# in HTML format from a PO file $(2). The result is further manipulated
-# in the recipes. $(4) when supplied is the name of the POT.
+# in the recipes.
#
-# If a translator commits a PO file based on an old version of the
-# POT, it is not msgmerge'd as `make' considers the corresponding
-# $(2) target up-to-date. As a result, the generated HTML
-# translations have English strings (but no fuzzy strings in the PO)
-# since there's no match between msgid/msgstr. Invoke update-po
-# unconditionally to cope with that (valid) scenario.
+# The PO file must be processed with update-po before passing it
+# to this function.
define generate-html
$(PO4A_TRANSLATE) $(PO4A-XHTMLFLAGS) $(PO4A-TRANSLATEFLAGS) \
--master $$< --po $(2) --localized $(3); \
@@ -698,8 +696,7 @@
draft-suffix := .humbly-drafted-by-GNUN
# The command to validate an ordinary article; remove the generated file
-# (when VCS operations are enabled) and create a hook in case validation
-# fails.
+# (when VCS operations are enabled).
define validate-article
$(VALIDATESKIP) $(VALIDATE-HTML-NOTIFY) $(NOTIFYSKIP) $(transl-addr) \
address@hidden || ($(VCSSKIP) $(RM) address@hidden; exit 1)
@@ -750,7 +747,7 @@
$(subst /po/,/,$(1)).$(2).html: $(subst /po/,/,$(1)).html \
$(1).$(2).po
$(call update-po,$(1).$(2).po,$(1).pot.opt,$(2))
- $(call generate-html,$(2),$(1).$(2).po,$$@,$(1).pot.opt)
+ $(call generate-html,$(2),$(1).$(2).po,$$@)
$(call merge-empty-lines,$$@)
endif #eq ($(wildcard $(1).$(2).po),)
endef
@@ -807,7 +804,7 @@
# Produce article HTML file and validate it if needed.
define output-article-html
-$(call generate-html,$(2),$(1).po,address@hidden); \
+$(call generate-html,$(2),$(1).po${po-suffix},address@hidden); \
$(call insert-ssi-vars,address@hidden,$$@); \
$(SED) --in-place "s/<gnun>\(.*\)<\/gnun>/\1/g" address@hidden; \
$(call merge-empty-lines,address@hidden) \
@@ -824,10 +821,10 @@
endef
define article-rules
-$(1).po: $(basename $(1)).pot $(MASTER-$(2))
+$(1).po${po-suffix}: $(basename $(1)).pot $(MASTER-$(2))
$(call update-po,$$@,$$<,$(2))
-$(subst /po/,/,$(1).html): $(basename $(1)).proto $(1).po
+$(subst /po/,/,$(1).html): $(basename $(1)).proto $(1).po${po-suffix}
# If the server templates are missing, assume the worst and exit with
# an error to prevent the generation of broken translations -- even if
# validation is not enforced there will be Apache error. The case
@@ -843,7 +840,7 @@
endif
exit 1
endif
- $(call update-po,$(1).po,$(basename $(1)).pot,$(2))
+ $(call update-po,$(1).po${po-suffix},$(basename $(1)).pot,$(2))
-$(RM) address@hidden
# If GRACE is not defined, which is the usual case for local manual
# builds, update the target and validate the result.
@@ -854,16 +851,18 @@
$(findstring $(basename $(1)),$(no-grace-items)))
# If there are no fuzzy strings, there might be untranslated or
# obsolete, so proceed as usual. If there are fuzzy strings, compare
-# the Outdated-Since in the $(1).po with the current time shifted by value
-# of the $(GRACE) period and invoke regeneration only if the grace period
-# is over. Likewise, check against $(OUTDATED-GRACE) and insert a notice
-# into the HTML file when the grace period is over.
- if ! $(call extract-outdated-date,$(1).po) > /dev/null ; then \
+# the Outdated-Since in the $(1).po${po-suffix} with the current time
+# shifted by value of the $(GRACE) period and invoke regeneration only
+# if the grace period is over. Likewise, check against
+# $(OUTDATED-GRACE) and insert a notice into the HTML file when the
+# grace period is over.
+ if ! $(call extract-outdated-date,$(1).po${po-suffix}) > /dev/null; \
+ then \
$(output-article-html); \
- elif $(call grace-is-over,$(1).po,$(GRACE)) ; then \
+ elif $(call grace-is-over,$(1).po${po-suffix},$(GRACE)) ; then \
$(output-article-html); \
else \
- sleep 1; touch $(1).po; \
+ sleep 1; touch $(1).po${po-suffix}; \
fi
else
@echo 'Ignoring grace period for article "$(notdir $(basename $(1)))"'
@@ -877,9 +876,13 @@
$(if $(findstring .$(ANNOUNCE).,.yes.), \
$(call add-file,$$@,$$(@F).hook-ann), \
$(call add-file,$$@)); \
- mv address@hidden $$@; \
+ $(if ${po-suffix}, , mv address@hidden $$@;) \
fi; \
fi
+# When we provide a ${po-suffix}, we don't generate a real page, we just draft
+# it; so we also neither mark the page outdated, nor handle the differences
+# against the latest translated version of the original page.
+ifeq (${po-suffix},)
-$(RM) address@hidden
$(announce)
$(if $(findstring $(basename $(1)),$(no-grace-items)), \
@@ -895,6 +898,7 @@
| $(GREP) '^[<>] ' \
| $(EGREP) -v '[$$$$]Date:' | wc -c`" -eq 0 \
|| cp $(subst /po/,/,$(1:.$(2)=).html) $(1)-en.html)
+endif
endef
$(foreach base,$(ALL_BASE),$(eval $(call article-pot-rules,$(base))))
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.392
retrieving revision 1.393
diff -u -b -r1.392 -r1.393
--- ChangeLog 13 Dec 2013 13:56:42 -0000 1.392
+++ ChangeLog 19 Dec 2013 09:04:55 -0000 1.393
@@ -1,3 +1,14 @@
+2013-12-19 Pavel Kharitonov <address@hidden>
+
+ Add a means to concurrently draft versions of the same
+ translation; update obsolete comments and invocations.
+
+ * GNUmakefile (po-suffix): New variable.
+ * (find-po, ALL_POS_BASE, article-rules): Take `po-suffix'
+ into account.
+ * (optional-template-lang-rules): Update the `generate-html'
+ invocation (no $4 is needed any more since 2013-09-05).
+
2013-12-13 Pavel Kharitonov <address@hidden>
* GNUmakefile (compendia/fuzzified-compendium.$(1).po):
- trans-coord/gnun/server/gnun GNUmakefile ChangeLog,
Pavel Kharitonov <=