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: Pavel Kharitonov
Subject: trans-coord/gnun/server/gnun ChangeLog GNUmakef...
Date: Tue, 31 Jul 2012 10:51:18 +0000

CVSROOT:        /sources/trans-coord
Module name:    trans-coord
Changes by:     Pavel Kharitonov <ineiev>       12/07/31 10:51:18

Modified files:
        gnun/server/gnun: ChangeLog GNUmakefile NEWS gnun-init-po.in 
        gnun/server/gnun/doc: gnun.texi 

Log message:
        Add `optional-templates'.
        Fix a bug in `report' (the `important' directories should
        include their subdirectories).
        
        * GNUmakefile: Add rules for optional templates.
        (localized-includes, template-translated-base, template-pots):
        Add optional-templates.
        (compendia/compendum.pot): Exclude POTs of optional templates
        from the prerequisites.
        (gnun-init-po.in): Accept *.pot.opt POTs as well as *.pot.
        (important-dir-pos): Include files from subdirectories.
        (optional-template-lang-rules, optional-template-rules): New
        functions.
        * doc/gnun-texi (Main Variables): Add `extra-templates' and
        `optional-templates' items and `hardcoded templates' anchor.
        * NEWS: Update.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.285&r2=1.286
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.132&r2=1.133
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/NEWS?cvsroot=trans-coord&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun-init-po.in?cvsroot=trans-coord&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/doc/gnun.texi?cvsroot=trans-coord&r1=1.57&r2=1.58

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -b -r1.285 -r1.286
--- ChangeLog   28 Jun 2012 19:15:06 -0000      1.285
+++ ChangeLog   31 Jul 2012 10:51:17 -0000      1.286
@@ -1,3 +1,22 @@
+2012-07-31  Pavel Kharitonov  <address@hidden>
+
+       Add `optional-templates'.
+       Fix a bug in `report' (the `important' directories should
+       include their subdirectories).
+
+       * GNUmakefile: Add rules for optional templates.
+       (localized-includes, template-translated-base, template-pots):
+       Add optional-templates.
+       (compendia/compendum.pot): Exclude POTs of optional templates
+       from the prerequisites.
+       (gnun-init-po.in): Accept *.pot.opt POTs as well as *.pot.
+       (important-dir-pos): Include files from subdirectories.
+       (optional-template-lang-rules, optional-template-rules): New
+       functions.
+       * doc/gnun-texi (Main Variables): Add `extra-templates' and
+       `optional-templates' items and `hardcoded templates' anchor.
+       * NEWS: Update.
+
 2012-06-28  Yavor Doganov  <address@hidden>
 
        Release 0.6.

Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -b -r1.132 -r1.133
--- GNUmakefile 28 Jun 2012 09:19:43 -0000      1.132
+++ GNUmakefile 31 Jul 2012 10:51:17 -0000      1.133
@@ -95,7 +95,7 @@
                      server/html5-header server/html5-head-include-1 \
                      server/body-include-1 server/body-include-2 \
                      server/footer server/footer-short server/footer-min \
-                     $(extra-templates)
+                     $(extra-templates) $(optional-templates)
 
 # Issue a command to substitute localized includes in a HTML file.
 # Usage: $(call substitute-localized-includes,$(lang)) file.$(lang).html
@@ -112,15 +112,20 @@
                  footer-text \
                  outdated
 template-translated-base := $(addprefix $(template-dir)/,$(template-files))
-template-translated-base += $(addprefix $(rootdir)/,$(extra-templates))
+template-translated-base += $(addprefix $(rootdir)/,$(extra-templates) \
+                                                    $(optional-templates))
 # Guard with a conditional to avoid silent `ls' failures during
 # variables' computation when only the package is being built.
 ifneq ($(_have-Makefile),yes)
 template-pots := $(addsuffix .pot, \
                   $(addprefix $(template-dir)/po/,$(template-files)) \
                   $(foreach template,$(extra-templates), \
-                    $(addprefix $(rootdir)/, \
-                      $(dir $(template)))po/$(notdir $(template))))
+                    $(dir $(addprefix $(rootdir)/, \
+                            $(template)))po/$(notdir $(template)))) \
+                 $(addsuffix .pot.opt, \
+                  $(foreach template,$(optional-templates), \
+                    $(dir $(addprefix $(rootdir)/, \
+                            $(template)))po/$(notdir $(template))))
 endif
 template-lang = $(addsuffix .$(1).html,$(template-translated-base))
 template-translated := $(foreach t-lang,$(TEMPLATE_LINGUAS), \
@@ -313,7 +318,7 @@
 compendia: $(foreach lang,$(TEMPLATE_LINGUAS), \
              compendia/fuzzified-compendium.$(lang).po)
 
-compendia/compendium.pot: $(template-pots) $(ALL_POTS)
+compendia/compendium.pot: $(filter-out %.pot.opt,$(template-pots)) $(ALL_POTS)
        $(addfile)
 # The `--use-first' option is needed to avoid stacked "translations"
 # of the header (msgid="").
@@ -772,11 +777,45 @@
   $(eval $(call extra-template-lang-rules,$(strip $(1)),$(t-lang))))
 endef
 
+define optional-template-lang-rules
+ifeq ($(wildcard $(1).$(2).po),)
+$(subst /po/,/,$(1)).$(2).html: $(subst /po/,/,$(1)).html
+       $$(addfile)
+       cp $$< $$@
+else
+.PRECIOUS: $(1).$(2).po
+$(1).$(2).po: $(1).pot.opt $(MASTER-$(2))
+       -PO=$$@ ; $(check-po)
+       $(call update-po,$$@,$$<,$(2))
+
+$(subst /po/,/,$(1)).$(2).html: $(subst /po/,/,$(1)).html \
+                            $(1).$(2).po
+       PO=$(1).$(2).po ; $(check-po) || (touch $$$$PO ; exit 1)
+       $(call generate-html,$(2),$(1).$(2).po,$$@)
+       $(SED) --in-place \
+         ':egin;N;$$$$!begin;s/\([ \t]*\n[ \t]*\)\{3,\}<!--/\n\n<!--/g' $$@
+endif #eq ($(wildcard $(1).$(2).po),)
+endef
+
+define optional-template-rules
+.PRECIOUS: $(1).pot.opt
+$(1).pot.opt: $(subst /po/,/,$(1)).html
+       $$(addfile)
+       $$(generate-pot)
+
+$(foreach t-lang,$(TEMPLATE_LINGUAS),\
+  $(eval $(call optional-template-lang-rules,$(strip $(1)),$(t-lang))))
+endef
+
 $(foreach template, $(extra-templates),\
   $(eval $(call extra-template-rules, \
-          $(addprefix $(rootdir)/, \
-           $(if $(findstring $(dir $(template)),./),,\
-             $(dir $(template)))po/$(notdir $(template))))))
+          $(dir $(addprefix $(rootdir)/, \
+                  $(template)))po/$(notdir $(template)))))
+
+$(foreach template, $(optional-templates),\
+  $(eval $(call optional-template-rules, \
+          $(dir $(addprefix $(rootdir)/, \
+                  $(template)))po/$(notdir $(template)))))
 
 ### End of rules for extra templates ###
 
@@ -1173,7 +1212,7 @@
      ${TEAM-POS})
 important-dir-pos := \
 $(filter-out ${priority-articles-pos} ${important-articles-pos},\
-  $(filter $(addsuffix /po/%, \
+  $(filter $(addsuffix /%, \
              $(addprefix ${rootdir}/,${important-directories})), \
     ${TEAM-POS}))
 other-pos := \

Index: NEWS
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/NEWS,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- NEWS        28 Jun 2012 19:15:06 -0000      1.59
+++ NEWS        31 Jul 2012 10:51:17 -0000      1.60
@@ -1,5 +1,21 @@
 GNUnited Nations NEWS - User visible changes.
 
+* Changes in GNUnited Nations 0.7 (????-??-??)
+
+** New variable in gnun.mk: `optional-templates'.  It is used for low
+   priority SSI templates; it won't generate empty PO files, so
+   the scripts reporting outdated translations won't take them into
+   account unless the team decides to commit a translation.
+
+   Since the POTs of the optional templates have the `.pot.opt'
+   extention, `gnun-init-po' script assumes that the POT file name may
+   end on either `.pot' or `.pot.opt'.
+
+** Bugs fixed in 0.7.
+
+***  The `report' target didn't take into account the subdirectories of
+     `important' directories.
+
 * Changes in GNUnited Nations 0.6 (2012-06-28)
 
 ** New target in GNUmakefile: `validate-all'.

Index: gnun-init-po.in
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/gnun-init-po.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gnun-init-po.in     5 Jun 2012 10:13:08 -0000       1.1
+++ gnun-init-po.in     31 Jul 2012 10:51:17 -0000      1.2
@@ -118,7 +118,8 @@
 fi
 
 # Figure out language suffix and PO file name.
-article=${1%.pot}
+article=${1%.opt}
+article=${article%.pot}
 article=${article##*/}
 
 if test -z "${language}" && test -n "${compendia}"; then

Index: doc/gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/gnun.texi,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- doc/gnun.texi       28 Jun 2012 19:09:53 -0000      1.57
+++ doc/gnun.texi       31 Jul 2012 10:51:17 -0000      1.58
@@ -852,7 +852,7 @@
 @item TEMPLATE_LINGUAS
 A space-separated list with languages.  Add here your language code
 @emph{if and only if} you have all the SSI templates translated, and
-have already committed all template files:
+have already committed all @anchor{hardcoded templates}template files:
 
 @itemize @minus
 @item @file{server/@/po/@/address@hidden
@@ -874,8 +874,38 @@
 @item @file{server/address@hidden
 @end itemize
 
-Additional templates can be defined via the @var{extra-templates}
-variable in @file{server/@/gnun/@/gnun.mk}.
address@hidden extra-templates
address@hidden templates, additional
address@hidden defining templates
address@hidden
address@hidden extra-templates
+
+The @var{extra-templates} variable lists additional templates under GNUN
+control; they are rebuilt from corresponding
address@hidden@var{lang}.po files like those hardcoded in GNUmakefile
+(@pxref{hardcoded templates});
+when the @address@hidden file is absent, GNUN initializes
+and commits a file with empty @code{msgstr}s.
+
address@hidden optional-templates
address@hidden templates, optional
address@hidden defining templates
address@hidden
address@hidden optional-templates
+
+The @var{optional-templates} variable defines optional templates under
+GNUN control.  Those are the templates of low priority items, like news
+lines included in some pages.  They are managed like the additional
+templates listed in the @var{extra-templates} variable, except
+
address@hidden @minus
address@hidden @address@hidden is not added when absent, and
address@hidden their POTs end in @code{.pot.opt} rather than @code{.pot}.
address@hidden itemize
+
+This way, the scripts reporting outdated translations and translations
+that hasn't been converted to PO files won't complain about them unless
+the team decides to actually commit @address@hidden
 
 @cindex FUZZY_DIFF_LINGUAS
 @cindex previous, diff



reply via email to

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