trans-coord-devel
[Top][All Lists]
Advanced

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

trans-coord/gnun/server/gnun ChangeLog GNUmakef...


From: Yavor Doganov
Subject: trans-coord/gnun/server/gnun ChangeLog GNUmakef...
Date: Thu, 31 Jul 2008 16:00:26 +0000

CVSROOT:        /sources/trans-coord
Module name:    trans-coord
Changes by:     Yavor Doganov <yavor>   08/07/31 16:00:26

Modified files:
        gnun/server/gnun: ChangeLog GNUmakefile README gnun.mk gnun.texi 

Log message:
        Implement deferred generation of ordinary articles when there are
        fuzzy strings based on the value of the GRACE variable.  Requested
        by the Italian team; seconded by the Serbian and Russian teams.
        * gnun.mk (no-grace-articles): New variable.
        * GNUmakefile (AWK, validate-article): New variables.
        ($(subst /po/,/,$(1).html)): Use a complex conditional to compare
        the date of the last revision of the PO file and regenerate the
        translation only if there are no fuzzy strings, or if the grace
        period is over.
        * gnun.texi (Runtime Variables): Document GRACE.
        (triggers): Update the crontab example.
        * README: Add GNU Awk as dependency.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.94&r2=1.95
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/README?cvsroot=trans-coord&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun.mk?cvsroot=trans-coord&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun.texi?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.94
retrieving revision 1.95
diff -u -b -r1.94 -r1.95
--- ChangeLog   30 Jun 2008 14:12:56 -0000      1.94
+++ ChangeLog   31 Jul 2008 16:00:25 -0000      1.95
@@ -1,3 +1,18 @@
+2008-07-31  Yavor Doganov  <address@hidden>
+
+       Implement deferred generation of ordinary articles when there are
+       fuzzy strings based on the value of the GRACE variable.  Requested
+       by the Italian team; seconded by the Serbian and Russian teams.
+       * gnun.mk (no-grace-articles): New variable.
+       * GNUmakefile (AWK, validate-article): New variables.
+       ($(subst /po/,/,$(1).html)): Use a complex conditional to compare
+       the date of the last revision of the PO file and regenerate the
+       translation only if there are no fuzzy strings, or if the grace
+       period is over.
+       * gnun.texi (Runtime Variables): Document GRACE.
+       (triggers): Update the crontab example.
+       * README: Add GNU Awk as dependency.
+
 2008-06-30  Yavor Doganov  <address@hidden>
 
        * gnun.mk (TEMPLATE_LINGUAS): List `ar' after `af'.

Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- GNUmakefile 30 Jun 2008 14:12:56 -0000      1.52
+++ GNUmakefile 31 Jul 2008 16:00:26 -0000      1.53
@@ -21,6 +21,7 @@
 PO4A-TRANSLATE := po4a-translate
 SED := sed
 M4 := m4
+AWK := gawk
 
 PO4A-GETTEXTIZEFLAGS :=
 PO4A-TRANSLATEFLAGS := --keep=0
@@ -211,6 +212,13 @@
 exit 1
 endef
 
+# The command to validate an ordinary article, and create a hook in
+# case validation fails.  Used only in article-rules.
+define validate-article
+$(VALIDATESKIP) ./validate-html-notify $(NOTIFYSKIP) $(transl-addr) \
+  $$@ || (PO=$(1).po ; $$(touch-hook))
+endef
+
 # Ensure that generic.LANG.html is always present for the homepage and
 # articles' generation.
 
@@ -501,9 +509,33 @@
          "s/\(<!--#include virtual=\".*$$$$inc\)\(.html\" -->\)/\1.$(2)\2/g" \
          $(1).m4; \
        done
+# If GRACE is not defined, which is the usual case for local manual
+# builds, update the target and validate the result.
+ifndef GRACE
        $(M4) $(1).m4 > $$@
-       $(VALIDATESKIP) ./validate-html-notify $(NOTIFYSKIP) $(transl-addr) \
-         $$@ || (PO=$(1).po ; $$(touch-hook))
+       $(validate-article)
+# Check if the article is not in `no-grace-articles'.
+else ifneq ($(basename $(1)), \
+           $(findstring $(basename $(1)),$(no-grace-articles)))
+# If there are no fuzzy strings, there might be untranslated or
+# obsolete, so proceed as usual.  If there are fuzzy strings, compare
+# the PO-Revision-Date in the PO with the current value of the grace
+# period and invoke regeneration only if the grace period is over.
+       grep --quiet "^#, fuzzy" $(1).po \
+         || ($(M4) $(1).m4 > $$@ ; $(validate-article))
+       if [ "`date --date="$(GRACE) days ago" +%Y%m%d`" -ge \
+            "`$(AWK) '/PO-Revision-Date/ {gsub(/-/, ""); print $$$$(2+0)}' \
+              $(1).po`" ] ; \
+         then \
+           $(M4) $(1).m4 > $$@ ; $(validate-article) ; \
+         else \
+           sleep 1 ; touch $(1).po ; \
+       fi
+else
+       @echo 'Ignoring grace period for article "$(notdir $(basename $(1)))"'
+       $(M4) $(1).m4 > $$@
+       $(validate-article)
+endif
 endef
 
 $(foreach base,$(ALL_BASE),$(eval $(call article-pot-rules,$(base))))

Index: README
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/README,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- README      3 Jun 2008 23:16:12 -0000       1.4
+++ README      31 Jul 2008 16:00:26 -0000      1.5
@@ -5,6 +5,7 @@
 GNU Gettext (>= 0.14)
 GNU M4 (>= 1.4.8)
 GNU Guile (>= 1.6)
+GNU Awk
 Po4a 0.33
 Libxml2 (>= 2.6.24, needed for XHTML validation only)
 W3C XHMTL 1.0 DTDs (needed for XHTML validation only)

Index: gnun.mk
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/gnun.mk,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- gnun.mk     30 Jun 2008 14:12:56 -0000      1.25
+++ gnun.mk     31 Jul 2008 16:00:26 -0000      1.26
@@ -25,6 +25,11 @@
 
 ### The variables below are edited by GNUN maintainers. ###
 
+# List of articles for which GRACE do not apply; i.e. they are
+# regenerated even if there are fuzzy strings.
+no-grace-articles := $(addprefix $(rootdir)/, \
+                       server/po/takeaction)
+
 ALL_DIRS :=    copyleft \
                fun/jokes \
                gnu \

Index: gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/gnun.texi,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- gnun.texi   18 Jun 2008 09:29:27 -0000      1.35
+++ gnun.texi   31 Jul 2008 16:00:26 -0000      1.36
@@ -5,7 +5,7 @@
 @c FIXME: Would be nice to have it in the format `%:b %:d, %:y', but
 @c in English.  This is going to be changed anyway when GNUN is released
 @c as a GNU package.
address@hidden lastupdate 18.06.2008
address@hidden lastupdate 31.07.2008
 @afourpaper
 @c %**end of header
 
@@ -508,6 +508,21 @@
 recommended in general since it will show a bug in the computation of
 the basic variables.
 
address@hidden GRACE
address@hidden fuzzy strings
address@hidden grace period
address@hidden deferred generation of articles
address@hidden address@hidden
+If defined, ordinary articles that have fuzzy strings and are not older
+than @var{days} will not be regenerated.  This functionality is
+implemented specifically to prevent gratuitous replacement of translated
+strings with the English text when there are only minor formatting
+changes in the original.  The translator has time (the ``grace'' period
+as defined in this variable) to review the changes and unfuzzy the
+strings, while keeping the online translation intact.  Note that this
+variable has no effect on the homepage, the server templates, gnunews
+and all articles defined in the variable @code{no-grace-articles}.
+
 @cindex TEAM
 @cindex variable, team
 @item address@hidden
@@ -660,7 +675,7 @@
 @group
 25 16 * * *  cd $HOME/projects/www ; cvs -q update &>/dev/null ; \
                make -C server/gnun VCS=yes VALIDATE=yes NOTIFY=yes \
-               VERBOSE=yes ; cvs commit -m \
+               VERBOSE=yes GRACE=30 ; cvs commit -m \
                "Automatic update by GNUnited Nations." ; \
                make -C server/gnun triggers
 @end group




reply via email to

[Prev in Thread] Current Thread [Next in Thread]