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 GNUmakefile


From: Pavel Kharitonov
Subject: trans-coord/gnun/server/gnun ChangeLog GNUmakefile
Date: Sun, 04 Sep 2011 12:06:28 +0000

CVSROOT:        /sources/trans-coord
Module name:    trans-coord
Changes by:     Pavel Kharitonov <ineiev>       11/09/04 12:06:28

Modified files:
        gnun/server/gnun: ChangeLog GNUmakefile 

Log message:
        Fix previous commit.
        
        (mark-outdated): Fix quoting; add more comments.
        (update-po-status): New function.
        (update-po): Convert from variable to function;
        update-po-status after msgmerge.
        (template-rules, home-rules, article-rules): Call update-po
        uniformly whenever we msgmerged.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.196&r2=1.197
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.86&r2=1.87

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -b -r1.196 -r1.197
--- ChangeLog   3 Sep 2011 04:45:27 -0000       1.196
+++ ChangeLog   4 Sep 2011 12:06:28 -0000       1.197
@@ -1,3 +1,14 @@
+2011-09-04  Pavel Kharitonov  <address@hidden>
+
+       Fix previous commit.
+
+       * GNUmakefile (mark-outdated): Fix quoting; add more comments.
+       (update-po-status): New function.
+       (update-po): Convert from variable to function;
+       update-po-status after msgmerge.
+       (template-rules, home-rules, article-rules): Call update-po
+       uniformly whenever we msgmerged.
+
 2011-09-03  Pavel Kharitonov  <address@hidden>
 
        GRACE period counts from the first incomplete translation.

Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -b -r1.86 -r1.87
--- GNUmakefile 3 Sep 2011 04:45:27 -0000       1.86
+++ GNUmakefile 4 Sep 2011 12:06:28 -0000       1.87
@@ -182,15 +182,18 @@
   --master $$< --po $$$$PO --localized $$$$OUT
 endef
 
-# Add notice about the translation being out of date
+# Add notice about the translation being out of date.
+# Limitation: it doesn't notice that GRACE is expired
+# unless the POT file is updated at least once after
+# the HTML file is marked outdated. In practice this doesn't
+# matter since GRACE value is very high.
 define mark-outdated
-$(SED) --in-place \
-            "/^<!--#set var=\"PO_FILE\"/,+3d;\
-/^<!--#include virtual=\"\/server\/banner/a\
-<!--#set var=\"PO_FILE\"\n \
+$(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) \
+<"'!'"--#include virtual=\"/server/outdated.$(2).html\" -->" $(1) \
    || true
 endef
 
@@ -210,7 +213,8 @@
 )
 endef
 
-# Copy POT generation date to `Outdated-Since' field.
+# Copy POT generation date to `Outdated-Since' field
+# unless the latter is already present.
 define insert-outdated-date
 ($(call extract-outdated-date,$(1)) > /dev/null \
  || $(SED) --in-place \
@@ -223,17 +227,21 @@
   '/^msgid ""$$$$/,/^$$$$/{s/^"Outdated-Since: //;t rm;p;:rm d}' $(1)
 endef
 
-# The command to update a PO file from the POT.  The target is
+define update-po-status
+if $(MSGFMT) --statistics -o /dev/null $(1) 2>&1 \
+    | $(EGREP) '(fuzzy|untranslated)' > /dev/null; then \
+  $(call insert-outdated-date,$(1)); \
+else \
+  $(call remove-outdated-date,$(1)); \
+fi
+endef
+
+# The command to update a PO file ($(1)) from the POT ($(2)).  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 $$@ \
-  &&  if $(MSGFMT) --statistics -o /dev/null $$@ 2>&1 \
-          | $(EGREP) '(fuzzy|untranslated)' > /dev/null; then \
-        $(call insert-outdated-date,$$@); \
-      else \
-        $(call remove-outdated-date,$$@); \
-      fi;
+$(MSGMERGE) --update --previous $(1) $(2) && touch $(1) \
+  && $(call update-po-status,$(1))
 endef
 
 # The command to mail errors from make-prototype.
@@ -343,7 +351,7 @@
 # an old version of gettext.  The XHTML validation errors should be
 # clear even if the bug is in the server templates translations.
        -PO=$$@ ; $(check-po)
-       $(update-po)
+       $(call update-po,$$@,$$<)
 
 $(template-dir)/%.$(1).html: $(template-dir)/%.html \
                             $(template-dir)/po/%.$(1).po
@@ -516,7 +524,7 @@
 $(rootdir)/po/home.$(1).po: $(rootdir)/po/home.pot
        PO=$$@ ; $(check-po)
        $$(fixperm)
-       $(update-po)
+       $(call update-po,$$@,$$<)
 
 $(rootdir)/home.$(1).html: $(rootdir)/po/home.proto \
                           $(rootdir)/po/home.$(1).po generic.$(1).html
@@ -537,8 +545,7 @@
        PO=$(rootdir)/po/home.$(1).po ; $(check-po) || (touch $$$$PO ; exit 1)
        $$(addfile)
 # Unconditionally update the PO file; see the comment in `article-rules'.
-       $(MSGMERGE) --update --previous $(rootdir)/po/home.$(1).po \
-         $(rootdir)/po/home.pot
+       $(call update-po,$(rootdir)/po/home.$(1).po,$(rootdir)/po/home.pot)
        $$(fixperm)
        PO=$(rootdir)/po/home.$(1).po OUT=$(rootdir)/po/home.$(1).m4 ; \
          $(generate-html)
@@ -609,7 +616,7 @@
 $(1).po: $(basename $(1)).pot
        PO=$$@ ; $(check-po)
        $$(fixperm)
-       $(update-po)
+       $(call update-po,$$@,$$<)
 
 $(subst /po/,/,$(1).html): $(basename $(1)).proto $(basename $(1)).translinks \
                           $(1).po generic.$(2).html
@@ -649,7 +656,7 @@
 # translations has English strings (but no fuzzy strings in the PO)
 # since there's no match between msgid/msgstr.  Invoke msgmerge
 # unconditionally to cope with that (valid) scenario.
-       $(MSGMERGE) --update --previous $(1).po $(basename $(1)).pot
+       $(call update-po,$(1).po,$(basename $(1)).pot)
 # This is needed for only a few articles, but as it is harmless there
 # is no real need to determine them and run the command conditionally.
        $$(fixperm)



reply via email to

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