[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: |
Sat, 03 Sep 2011 04:45:27 +0000 |
CVSROOT: /sources/trans-coord
Module name: trans-coord
Changes by: Pavel Kharitonov <ineiev> 11/09/03 04:45:27
Modified files:
gnun/server/gnun: ChangeLog GNUmakefile NEWS THANKS
Log message:
GRACE period counts from the first incomplete translation.
In older versions it was measured from the latest update
of the POT file.
The incompleteness is tested via msgfmt --statistics
rather than only relying on presence of fuzzy strings.
Introduce grace period for out-of-date marks.
* GNUmakefile (OUTDATED-GRACE): New variable.
(extract-outdated-date, insert-outdated-date)
(remove-outdated-date, grace-is-over): New functions.
(mark-outdated): Don't check whether the translation is outdated.
(update-po): insert and delete `Oudated-Since' field in the header
when appropriate.
(home-rules): use `extract-outdated-date' with `mark-outdated'.
(article-rules): for articles affected by GRACE period
check OUTDATED-GRACE before marking them outdated; estimate
the periods more correctly.
* NEWS:
* THANKS: Update.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.195&r2=1.196
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.85&r2=1.86
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/NEWS?cvsroot=trans-coord&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/THANKS?cvsroot=trans-coord&r1=1.8&r2=1.9
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -b -r1.195 -r1.196
--- ChangeLog 30 Aug 2011 14:59:44 -0000 1.195
+++ ChangeLog 3 Sep 2011 04:45:27 -0000 1.196
@@ -1,3 +1,26 @@
+2011-09-03 Pavel Kharitonov <address@hidden>
+
+ GRACE period counts from the first incomplete translation.
+ In older versions it was measured from the latest update
+ of the POT file.
+
+ The incompleteness is tested via msgfmt --statistics
+ rather than only relying on presence of fuzzy strings.
+
+ Introduce grace period for out-of-date marks.
+ * GNUmakefile (OUTDATED-GRACE): New variable.
+ (extract-outdated-date, insert-outdated-date)
+ (remove-outdated-date, grace-is-over): New functions.
+ (mark-outdated): Don't check whether the translation is outdated.
+ (update-po): insert and delete `Oudated-Since' field in the header
+ when appropriate.
+ (home-rules): use `extract-outdated-date' with `mark-outdated'.
+ (article-rules): for articles affected by GRACE period
+ check OUTDATED-GRACE before marking them outdated; estimate
+ the periods more correctly.
+ * NEWS:
+ * THANKS: Update.
+
2011-08-30 Pavel Kharitonov <address@hidden>
Add server/html5-*.html to verbatim-templates.
Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -b -r1.85 -r1.86
--- GNUmakefile 30 Aug 2011 14:59:44 -0000 1.85
+++ GNUmakefile 3 Sep 2011 04:45:27 -0000 1.86
@@ -38,6 +38,14 @@
-o "untranslated=W<gnun> W<script>" \
-o "translated=W<pre>"
+# Default period to delay notice about translation being out of date
+ifdef GRACE
+ OUTDATED-GRACE := 60
+else
+# no OUTDATED-GRACE by default when there is no GRACE
+ OUTDATED-GRACE := -1
+endif
+
# Determine the VCS to use. The conditional is for efficiency --
# there's no need to spawn a shell to determine the value when all VCS
# operations will be skipped anyway. For the time being, Bzr is used
@@ -176,16 +184,14 @@
# Add notice about the translation being out of date
define mark-outdated
- $(MSGFMT) --statistics -o /dev/null $$$$PO 2>&1 \
- | ($(EGREP) '(fuzzy|untranslated)' > /dev/null \
- && $(SED) --in-place \
+$(SED) --in-place \
"/^<!--#set var=\"PO_FILE\"/,+3d;\
/^<!--#include virtual=\"\/server\/banner/a\
<!--#set var=\"PO_FILE\"\n \
value='<a href=\"http://www.gnu.org$$$${PO#$(rootdir)}\">\n\
http://www.gnu.org$$$${PO#$(rootdir)}</a>' -->\n\
-<!--#include virtual=\"/server/outdated.$(2).html\" -->" $(1); \
- ) || true
+<!--#include virtual=\"/server/outdated.$(2).html\" -->" $(1) \
+ || true
endef
# The command to check the validity of a PO file.
@@ -195,11 +201,39 @@
$(VALIDATESKIP) $(MSGFMT) --check --verbose --output-file=/dev/null $$$$PO
endef
+# Get the generation date of the oldest POT with incomplete
+# translation stored in `Outdated-Since' field of the header.
+define extract-outdated-date
+($(SED) --quiet \
+ '1,/^msgstr/d;/^$$$$/q 0;/^"Outdated-Since:/{s/^"Outdated-Since:
\(.*\).."$$$$/\1/;p;q 1;}' $(1); \
+ test $$$$? != 0 \
+)
+endef
+
+# Copy POT generation date to `Outdated-Since' field.
+define insert-outdated-date
+($(call extract-outdated-date,$(1)) > /dev/null \
+ || $(SED) --in-place \
+ '/^"POT-Creation-Date:/{p;s/^"POT-Creation-Date:/"Outdated-Since:/}'
$(1))
+endef
+
+# Remove `Outdated-Since' field from the header.
+define remove-outdated-date
+$(SED) --in-place \
+ '/^msgid ""$$$$/,/^$$$$/{s/^"Outdated-Since: //;t rm;p;:rm d}' $(1)
+endef
+
# The command to update a PO file from the POT. The target is
# `touched' in order `make' to consider it up-to-date even if there
# is nothing to merge.
define update-po
-$(MSGMERGE) --update --previous $$@ $$< && touch $$@
+$(MSGMERGE) --update --previous $$@ $$< && touch $$@ \
+ && if $(MSGFMT) --statistics -o /dev/null $$@ 2>&1 \
+ | $(EGREP) '(fuzzy|untranslated)' > /dev/null; then \
+ $(call insert-outdated-date,$$@); \
+ else \
+ $(call remove-outdated-date,$$@); \
+ fi;
endef
# The command to mail errors from make-prototype.
@@ -525,7 +559,9 @@
"s/\(<!--#include file=\"gnusflashes*\)\(.include\"
-->\)/\1.$(1)\2/g" \
$(rootdir)/po/home.$(1).m4
$(M4) $(rootdir)/po/home.$(1).m4 > $$@
- PO=$(rootdir)/po/home.$(1).po; $(call mark-outdated,$$@,$(1))
+ PO=$(rootdir)/po/home.$(1).po; \
+ ($(call extract-outdated-date,$$$$PO) >/dev/null \
+ && $(call mark-outdated,$$@,$(1))) || true
$(VALIDATESKIP) $(VALIDATE-HTML-NOTIFY) $(NOTIFYSKIP) $(transl-addr) \
$$@ || (PO=$(rootdir)/po/home.$(1).po ; $$(touch-hook))
endef
@@ -561,6 +597,14 @@
&& $(announce) && $(validate-article))
endef
+define grace-is-over
+(timestamp="`$(call extract-outdated-date,$(1))`"; \
+ test -n "$$$${timestamp}" \
+ && test "`date --date="$(2) days ago" +%s`" \
+ -ge "`date --date="$$$${timestamp}" +%s`" \
+)
+endef
+
define article-rules
$(1).po: $(basename $(1)).pot
PO=$$@ ; $(check-po)
@@ -630,29 +674,29 @@
$(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 POT-Creation-Date in the PO with the current value of the grace
-# period and invoke regeneration only if the grace period is over.
+# 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 the target is of zero size, it means that it was just touched by
# $(addfile) -- GRACE is ignored in this case to avoid committing
# empty files to the repository.
- if ! $(GREP) --quiet "^#, fuzzy" $(1).po || ! test -s $$@; \
- then \
+ if ! $(call extract-outdated-date,$(1).po) > /dev/null \
+ || ! test -s $$@; then \
$(output-article-html); \
- else \
- if [ "`date --date="$(GRACE) days ago" +%Y%m%d`" -ge \
- "`$(AWK) '/POT-Creation-Date/ { gsub(/-/, ""); print $$$$2 }' \
- $(1).po`" ]; \
- then \
+ elif $(call grace-is-over,$(1).po,$(GRACE)) ; then \
$(output-article-html); \
else \
sleep 1; touch $(1).po; \
- fi; \
fi
else
@echo 'Ignoring grace period for article "$(notdir $(basename $(1)))"'
$(output-article-html);
endif
- PO=$(1).po; $(call mark-outdated,$$@,$(2))
+ ($(if $(findstring $(basename $(1)),$(no-grace-articles)), \
+ echo 'Ignoring delay for article "$(notdir $(basename $(1)))"', \
+ $(call grace-is-over,$(1).po,$(OUTDATED-GRACE))) \
+ && (PO=$(1).po; $(call mark-outdated,$$@,$(2)))) || true
endef
$(foreach base,$(ALL_BASE),$(eval $(call article-pot-rules,$(base))))
Index: NEWS
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/NEWS,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- NEWS 31 Aug 2011 12:57:03 -0000 1.32
+++ NEWS 3 Sep 2011 04:45:27 -0000 1.33
@@ -34,6 +34,14 @@
** Bugs fixed in 0.5.
+*** GRACE period counts from the first incomplete translation.
+ In older versions it was measured from the latest update
+ of the POT file.
+
+*** Completeness of translations is determined via msgfmt --statistics
+ rather than grep "^#, fuzzy"; the latter let new English passages
+ penetrate into translations.
+
*** `gnun-validate-html' once again properly supports nested
SSI directives, including `virtual' and `file' type, absolute
and relative paths, with different quotes (CGI includes are
Index: THANKS
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/THANKS,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- THANKS 28 Aug 2011 09:37:10 -0000 1.8
+++ THANKS 3 Sep 2011 04:45:27 -0000 1.9
@@ -16,6 +16,8 @@
+------------------+---------------------------+
|Karl Berry | address@hidden|
+------------------+---------------------------+
+|Richard Stallman | address@hidden|
++------------------+---------------------------+
Local Variables:
mode: text
- trans-coord/gnun/server/gnun ChangeLog GNUmakef...,
Pavel Kharitonov <=