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: Wed, 05 Mar 2008 18:52:29 +0000

CVSROOT:        /cvsroot/trans-coord
Module name:    trans-coord
Changes by:     Yavor Doganov <yavor>   08/03/05 18:52:29

Modified files:
        gnun/server/gnun: ChangeLog GNUmakefile TODO gnun.texi 

Log message:
        * GNUmakefile (check-po): Use mailfail to mail the error from
        msgfmt to translators.
        (mail-error-proto): New variable.
        ($(rootdir)/po/home.proto, $(1).proto $(1).translinks): Use it.
        (report): New target.
        
        * gnun.texi (report): New node.
        (Runtime Variables): Document the `TEAM' variable.
        (New Translation): Add a `po-msgcat' Emacs Lisp example by
        Kaloian.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/TODO?cvsroot=trans-coord&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun.texi?cvsroot=trans-coord&r1=1.8&r2=1.9

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- ChangeLog   4 Mar 2008 22:01:45 -0000       1.18
+++ ChangeLog   5 Mar 2008 18:52:28 -0000       1.19
@@ -1,3 +1,16 @@
+2008-03-05  Yavor Doganov  <address@hidden>
+
+       * GNUmakefile (check-po): Use mailfail to mail the error from
+       msgfmt to translators.
+       (mail-error-proto): New variable.
+       ($(rootdir)/po/home.proto, $(1).proto $(1).translinks): Use it.
+       (report): New target.
+
+       * gnun.texi (report): New node.
+       (Runtime Variables): Document the `TEAM' variable.
+       (New Translation): Add a `po-msgcat' Emacs Lisp example by
+       Kaloian.
+
 2008-03-04  Yavor Doganov  <address@hidden>
 
        * GNUmakefile (verbatim-templates): Add `header.tr.html' and

Index: GNUmakefile
===================================================================
RCS file: /cvsroot/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- GNUmakefile 4 Mar 2008 21:41:46 -0000       1.4
+++ GNUmakefile 5 Mar 2008 18:52:28 -0000       1.5
@@ -129,7 +129,15 @@
 
 # The command to check the validity of a PO file.
 define check-po
-$(VALIDATESKIP) $(MSGFMT) --check --verbose --output-file=/dev/null $$@
+./mailfail $(NOTIFYSKIP) $(transl_addr) \
+  "[GNUN Error] $$(subst $$(rootdir),,$$@) is not a valid PO file" \
+  $(VALIDATESKIP) $(MSGFMT) --check --verbose --output-file=/dev/null $$@
+endef
+
+# The command to mail errors from make-prototype.
+define mail-error-proto
+./mailfail $(NOTIFYSKIP) $(web_addr),$(devel_addr) \
+  "[GNUN Error] Incompatible change in $(subst $(rootdir),,$<)"
 endef
 
 # Ensure that generic.LANG.html is always present for the homepage and
@@ -185,12 +193,13 @@
 
 ### Specific rules for the homepages ###
 $(rootdir)/po/home.proto: $(rootdir)/home.shtml
-# Delete the target if the script exits with a non-zero status
-# in order to prevent further messing up in the chain.  For
-# extra safety, exit with an error so that make does not
-# proceed to the next command.
+# Delete the target if the script exits with a non-zero status in
+# order to prevent further messing up in the chain.  For extra safety,
+# exit with an error so that make does not proceed to the next
+# command.
        $(VALIDATESKIP) $(VALIDATE-HTML-NOTIFY) $(NOTIFYSKIP) $(web_addr) $<
-       $(MAKE-PROTOTYPE) --home --input=$< --generic=generic.html --output=$@ 
|| ($(RM) $@ ; exit 1)
+       $(mail-error-proto) $(MAKE-PROTOTYPE) --home --input=$< \
+         --generic=generic.html --output=$@ || ($(RM) $@ ; exit 1)
        $(SED) --in-place "s/\$$Date.*\$$/<gnun>\0<\/gnun>/g" $@
 
 $(rootdir)/po/home.pot: $(rootdir)/po/home.proto
@@ -239,8 +248,10 @@
 define article_pot_rules
 $(1).proto $(1).translinks: $(subst /po/,/,$(1).html)
        $(VALIDATESKIP) $(VALIDATE-HTML-NOTIFY) $(NOTIFYSKIP) $(transl_addr) $$<
-       $(MAKE-PROTOTYPE) --input=$$< --generic=generic.html 
--output=$(1).proto --translinks=$(1).translinks || \
-         ($(RM) $(1).proto $(1).translinks ; exit 1)
+       $$(mail-error-proto) $(MAKE-PROTOTYPE) --input=$$< \
+         --generic=generic.html --output=$(1).proto \
+         --translinks=$(1).translinks \
+           || ($(RM) $(1).proto $(1).translinks ; exit 1)
        $(SED) --in-place "s/\$$$$Date.*\$$$$/<gnun>\0<\/gnun>/g" $(1).proto
 
 $(1).pot: $(1).proto
@@ -328,3 +339,17 @@
        cd $(rootdir) ; \
          $(CVSSKIP) $(CVS) commit -m \
          "Automatic sync from the master www repository."
+
+# Special target to check which translations need updating.
+.PHONY: report
+report: 
+ifndef TEAM
+$(error Please specify a language code, for example TEAM=fr)
+endif
+ifneq ($(TEAM),$(findstring $(TEAM),$(sort $(GENERIC_LINGUAS))))
+$(error There are no translations for language "$(TEAM)")
+endif
+       @cd $(rootdir) ; LC_ALL=C find -name '*.$(TEAM).po' -printf "%p: " \
+         -exec msgfmt --statistics -o /dev/null '{}' \; 2>&1 \
+           | sort | egrep '(fuzzy|untranslated)' \
+         || echo "All translations seem to be up-to-date."

Index: TODO
===================================================================
RCS file: /cvsroot/trans-coord/trans-coord/gnun/server/gnun/TODO,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- TODO        4 Mar 2008 21:52:22 -0000       1.5
+++ TODO        5 Mar 2008 18:52:28 -0000       1.6
@@ -42,18 +42,8 @@
 ** Add a `check' target (probably using Autoconf or DejaGNU) that would
    test the environment and all the tools we use.
 
-** Handle errors properly.
-   When make-prototype fails, a proper mail with the error message
-   should be sent to www-discuss.  Likewise, if a translator commits a
-   PO file that is not valid (perhaps this will be very common, at
-   least in the beginning).
-
 * Expected problems
 
-** make-prototype.scm uses a regexp to split the articles in pieces.
-   That regexp might not fit to all articles, that's why it has to be
-   tested with as many as possible.
-
 ** RTL.
 
 ** Complicated articles like /philosophy/eldred-amicus.
@@ -66,6 +56,7 @@
    certain period.  For language teams, a `msgfmt --statistics'-similar
    output would be sufficient, as a start (probably omiting files that
    are 100% complete).  (This could be done with a script too.)
+   (Partially done.)
 
 ** When commiting automated changes, find a way to generate meaningful
    CVS log entries, describing the changes.  Something like:

Index: gnun.texi
===================================================================
RCS file: /cvsroot/trans-coord/trans-coord/gnun/server/gnun/gnun.texi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- gnun.texi   4 Mar 2008 18:49:13 -0000       1.8
+++ gnun.texi   5 Mar 2008 18:52:28 -0000       1.9
@@ -4,7 +4,7 @@
 @settitle GNUnited Nations Manual
 @c FIXME: Would be nice to have it in the format `%:b %:d, %:y', but
 @c in English.
address@hidden lastupdate 04.03.2008
address@hidden lastupdate 05.03.2008
 @afourpaper
 @c %**end of header
 
@@ -485,6 +485,12 @@
 @code{devel_addr}, @code{web_addr} and @code{transl_addr} control the
 recipients; normally they should be set to the @acronym{GNUN}
 maintainers, webmasters and translators accordingly.
+
address@hidden address@hidden
+The translation team which articles need to be checked for
+completeness.  This variable is applicable only for the @code{report}
+target, and is mandatory for it.  @xref{report}.
+
 @end table
 
 Note that @code{VCS=yes,always} is a valid combination: because POT
@@ -530,6 +536,7 @@
 
 @menu
 * sync::
+* report::
 * clean::
 * distclean::
 @end menu
@@ -573,6 +580,25 @@
 @code{VCS=always} has no effect on this target, as well as
 @code{VALIDATE}.
 
address@hidden report
address@hidden The @code{report} target
+
+This target exists solely for convenience to translators, enabling
+them to check which articles are not 100% translated and have to be
+updated.  The way to check this is by running @command{make report
address@hidden, where @var{lang} is the language code, as usual.
+Thus, to check all French translations, one would run
+
address@hidden
+make report TEAM=fr
address@hidden example
+
address@hidden:} This target checks only the PO files; if there are
+translations that are maintained in the old-fashioned way, they are
+not reported since there is no reasonable way to check if they are
+up-to-date.  In fact, this is one of the main reasons GNUN is being
+developed, if you recall.
+
 @node clean
 @subsubsection The @code{clean} target
 
@@ -829,6 +855,35 @@
 the repository.  Either way, the build system will treat it is a valid
 PO file.
 
+For those lucky Emacs users, here is a code snippet that you can put
+in your @file{.emacs}; doing @kbd{M-x po-msgcat} while in PO mode will
+wrap all long lines:
+
address@hidden
+(defun po-msgcat ()
+  "Filter current po-mode buffer through `msgcat' tool."
+  (interactive)
+  (if (eq major-mode 'po-mode)
+      (let ((tmp-file (make-temp-file "po-msgcat."))
+           (tmp-buf (generate-new-buffer "*temp*")))
+       (unwind-protect
+           (progn
+             (write-region (point-min) (point-max) tmp-file nil 1)
+             (if (zerop
+                  (call-process
+                   "msgcat" nil tmp-buf t (shell-quote-argument tmp-file)))
+                 (let ((saved (point))
+                       (inhibit-read-only t))
+                   (delete-region (point-min) (point-max))
+                   (insert-buffer tmp-buf)
+                   (goto-char (min saved (point-max))))
+               (with-current-buffer tmp-buf
+                 (error (buffer-string)))))
+         (kill-buffer tmp-buf)
+         (delete-file tmp-file)))))
address@hidden lisp
+
+
 It is highly desirable that you check if the PO file you finished
 translating (or editing) is valid, before committing it.  This is done
 by running @command{msgfmt -cv -o /dev/null @var{file}} or by simply




reply via email to

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