[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trans-coord/gnun/server/gnun GNUmakefile.team N...
From: |
Pavel Kharitonov |
Subject: |
trans-coord/gnun/server/gnun GNUmakefile.team N... |
Date: |
Fri, 14 Dec 2012 17:56:37 +0000 |
CVSROOT: /sources/trans-coord
Module name: trans-coord
Changes by: Pavel Kharitonov <ineiev> 12/12/14 17:56:37
Modified files:
gnun/server/gnun: GNUmakefile.team NEWS ChangeLog
gnun/server/gnun/doc: gnun.texi web-trans.texi
Log message:
Initially implement team's notifications; make more detailed
team's reports.
Update documentation.
* GNUmakefile.team: Include gnun.mk and priorities.mk from
`www' directory.
(all): Depend on `sync', `format', `notify'.
(sync-file) <sync-$(1)>: Unite `ADD_FUZZY_DIFF' invocations.
(www_gnun_dir, NOTIFICATION_PERIOD, pots):
(WWW_URL, TEAM_URL_PREFIX, TEAM_URL_POSTFIX, DIFF_PO):
(DIFF_PO_LANG, GNUN_MAIL, MAIL_TAIL, html-only, www-only):
(HAVE-EMAIL-ALIASES, HAVE-NOTTAB, comma, paren, translators):
New variables.
(sorted-files, parse-email-aliases, notify-translator):
New functions.
(priority-articles-pos, important-articles-pos):
(important-dir-pos, other-pos): Redefine using `sorted-files'.
(report.txt, notify): New targets.
(report-pos): Report more cases (HTML-only translations,
inconsistences of `www' vs. `www-$lang', new translations
ready to publish).
(report): Use modified calls of `report-pos'.
(clean): Remove new autogenerated files.
* gnun.texi (Introduction): Don't mention makefiles since they
are scripts.
(Files and Directories): New section.
(Rules): Remove non-informative section.
(Concepts): POT file is not always copied to get a new PO.
Improve the passage on changes that don't require manual
updates. Remove FIXME about layout (since that separate
section is being added). Add a reference to `Files
and Directories'.
(Concepts, Runtime Variables, Main Variables, Scripts):
(GNUmakefile.team Variables, GNUmakefile.team Targets):
(gnun-add-fuzzy-diff, gnun-init-po, gnun-merge-preconverted):
(gnun-clear-previous):
Unify formatting of ``fuzzy'' and ``previous''.
(Disadvantages): Add an item about alphabetically sorted
lists.
(Usage): Update documentation about template files.
(Runtime Variables): Don't mention `VALIDATE=yes' since it
is the default.
(no-grace-items): Slightly rephrase.
(sync): Add a comment about the target not being used.
(GNUmakefile.team Targets) <report>: Add
`report in GNUmakefile.team' anchor. Expand description.
(report): Link to `report in GNUmakefile.team'.
(triggers): Add a footnote saying that we currently run
a different command sequence.
(Main Variables): Explain how to build separate files.
(GNUmakefile.team Targets) <publish>: Add an anchor.
(PO Files): Move the passages about PO editors
to web-trans.texi; link thither. Rearrange subsections:
move `PO Tips' up, `GNU News' down. Link to `publish'
in `GNUmakefile.team Variables' rather than to that node.
(New Translation) <*GNUN-SLOT: TRANSLATOR'S NOTES*>: Add
an example, since @key{SPC} proved to be confusing anough.
(PO Tips): Replace the note about HTML entities with its
version from web-trans.texi.
(PO Files and Team): Fix a typo (`in in'). Mention automatic
notifications. Add a footnote saying that Translation
Managers can setup jobs on GNU server. Remove the note about
`priorities.mk' since it is taken from `www' working copy.
(GNUmakefile.team Variables): Now there are more than two
variables to update. Document `TEAM_URL_PREFIX',
`TEAM_URL_POSTFIX', `NOTIFICATION_PERIOD', `NOTIFY'
(GNUmakefile.team Targets) <notify>: New target.
(GNUmakefile.team Targets) <clean>: Don't specify exact file
patterns.
(GNUmakefile.team): Remove the description of would-be
features that are being implemented.
(Internals): Remove the non-informative `Rules' section;
add `Files and Directories' instead.
* web-trans.texi (PO Files): New node, moved from gnun.texi.
(Submitting as PO): Adjust the reference to `PO Files'.
(New Team): Remove the note about HTML entities (moved
to gnun.texi).
(Web-based Systems): Move to `PO Files'.
(Savannah Patch): Remove; it describes deprecated resource.
(Savannah Projects) <www>: "although s||almost |anything
happening in @samp{www} directly affects them".
* NEWS: Update.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile.team?cvsroot=trans-coord&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/NEWS?cvsroot=trans-coord&r1=1.74&r2=1.75
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.315&r2=1.316
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/doc/gnun.texi?cvsroot=trans-coord&r1=1.70&r2=1.71
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/doc/web-trans.texi?cvsroot=trans-coord&r1=1.38&r2=1.39
Patches:
Index: GNUmakefile.team
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile.team,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- GNUmakefile.team 9 Dec 2012 12:21:18 -0000 1.21
+++ GNUmakefile.team 14 Dec 2012 17:56:37 -0000 1.22
@@ -43,6 +43,8 @@
# "www" repository; must end with a trailing slash.
wwwdir := ../www/
+www_gnun_dir := $(wwwdir)server/gnun/
+
# Adjust these variables if you don't have the programs in your PATH.
MSGMERGE := msgmerge
MSGMERGEFLAGS := --previous --backup=none
@@ -56,12 +58,56 @@
HG := hg
# Baz can be used alternatively; its commands are compatible.
TLA := tla
+# Default period of notifications.
+NOTIFICATION_PERIOD := 7
+# URL specifications; used in notifications to generate URLs of items.
+# Root URL for "www" files.
+WWW_URL := http://www.gnu.org/
+# Prefix and postfix of URLs of team's files.
+TEAM_URL_PREFIX := http://cvs.savannah.gnu.org/viewvc/*checkout*/www-bg/
+TEAM_URL_POSTFIX := ?root=www-bg
+# The program to generate differences of two versions of a PO file.
+# Those files will be sent with notifications as attachments.
+ifndef DIFF_PO
+DIFF_PO := $(shell which gnun-diff-po)
+# Detect a UTF-8 locale (msgexec doesn't like processing UTF-8-encoded POs
+# in an incompatible locale).
+ifneq (,$(DIFF_PO))
+DIFF_PO_LANG := $(shell \
+ locale \
+ | if locale | egrep -q "^LC_ALL=."; then \
+ grep "^LC_ALL"; \
+ else \
+ cat; \
+ fi \
+ | egrep -q -i "=.*utf-?8" \
+ || locale -a | sed 's/^/LC_ALL=/' | egrep -m 1 "en_US\.utf-?8" \
+ || locale -a | sed 's/^/LC_ALL=/' | egrep -m 1 "\.utf-?8" || true;)
+DIFF_PO := $(DIFF_PO_LANG) $(DIFF_PO)
+endif
+endif
# The program to add differences against previous msgids
# to fuzzy translations (and remove those differences from up-to-date
# translations).
ifndef ADD_FUZZY_DIFF
ADD_FUZZY_DIFF := $(shell which gnun-add-fuzzy-diff)
endif
+# The program to send notifications.
+ifndef GNUN_MAIL
+ifneq (,$(DIFF_PO))
+# Use mutt since mail doesn't accept attachments.
+GNUN_MAIL := mutt
+else # eq (,$(DIFF_PO))
+GNUN_MAIL := mail
+endif # neq (,$(DIFF_PO))
+endif # ndef GNUN_MAIL
+# Invoke with NOTIFY=yes to actually enable notifications
+ifneq (yes,$(NOTIFY))
+GNUN_MAIL := { echo $(GNUN_MAIL)
+MAIL_TAIL := cat; };
+else
+MAIL_TAIL :=
+endif
translations := $(shell find . -name '*.$(TEAM).po' | sort)
log := "Automatic merge from the master repository."
@@ -101,7 +147,7 @@
endef
.PHONY: all
-all: sync
+all: sync format notify
# Update the master and the team repositories.
.PHONY: update
@@ -191,63 +237,161 @@
| $(MSGCAT) --use-first --less-than=2 -o $(1) - $(1); \
$(MSGMERGE) $(MSGMERGEFLAGS) $(MSGMERGEVERBOSE) -C
$$$${www_po} \
--update $1 $$$${www_po%.$(TEAM).po}.pot 2>&1; \
- $(if $(ADD_FUZZY_DIFF), $(ADD_FUZZY_DIFF) -i $1;) \
- echo " " `$(MSGFMT) -o /dev/null --statistics $1 2>&1`; \
$(RM) $(1)-tmp.www.po $(1)-tmp.po; \
} \
else \
echo -n "$$$${file#./}: Merging new translation"; \
$(MSGMERGE) $(MSGMERGEFLAGS) $(MSGMERGEVERBOSE) \
--update $1 $$$${www_po%.$(TEAM).po}.pot 2>&1; \
+ fi; \
$(if $(ADD_FUZZY_DIFF), $(ADD_FUZZY_DIFF) -i $1;) \
echo " " `$(MSGFMT) -o /dev/null --statistics $1 2>&1`; \
- fi; \
fi
sync: sync-$(1)
endef
$(foreach file, $(patsubst ./%, %, $(translations)), \
$(eval $(call sync-file,$(file))))
+# Import translated file lists from www.
+-include $(www_gnun_dir)gnun.mk
# Assign priorities to translations for report.
--include priorities.mk
-priority-articles-pos := \
+-include $(www_gnun_dir)priorities.mk
+
+define sorted-files
+priority-articles-$(1) := \
$(filter $(foreach article,${priority-articles},\
- ./${article}.${TEAM}.po), ${translations})
-important-articles-pos := \
+ ./${article}.${TEAM}.po), $(2))
+important-articles-$(1) := \
$(filter $(foreach article,${important-articles},\
- ./${article}.${TEAM}.po), ${translations})
-important-dir-pos := \
-$(filter-out ${priority-articles-pos} ${important-articles-pos},\
- $(filter $(addsuffix /%, $(addprefix ./,${important-directories})), \
- ${translations}))
-other-pos := \
- $(filter-out ${priority-articles-pos} ${important-articles-pos} \
- ${important-dir-pos}, ${translations})
+ ./${article}.${TEAM}.po), $(2))
+important-dir-$(1) := \
+$$(filter-out $${priority-articles-$(1)} $${important-articles-$(1)}, \
+ $$(filter $$(addsuffix /%, $(addprefix ./,${important-directories})), $(2)))
+other-$(1) := \
+ $$(filter-out $${priority-articles-$(1)} $${important-articles-$(1)} \
+ $${important-dir-$(1)}, $(2))
+endef
+
+$(eval $(call sorted-files,pos,${translations}))
+
+# Figure out what translatable articles live in www.
+ifeq (,$(ALL_DIRS))
+pots := $(shell find $(wwwdir) -name \*.pot ! -path \*/server/gnun/\*)
+else # ! eq (,$(ALL_DIRS))
+template-pots := $(addsuffix .pot, \
+ $(foreach template,$(extra-templates), \
+ $(dir $(addprefix $(wwwdir), \
+ $(template)))po/$(notdir $(template)))) \
+ $(addsuffix .pot.opt, \
+ $(foreach template,$(optional-templates), \
+ $(dir $(addprefix $(wwwdir), \
+ $(template)))po/$(notdir $(template))))
+no-grace-items := $(no-grace-articles)
+no-grace-pot := $(no-grace-items:%=%.pot)
+articles := $(foreach dir,$(ALL_DIRS),$(addprefix $(dir)/po/,$(value $(dir))))
+articles-pot := $(addprefix $(wwwdir),$(articles:%=%.pot))
+root-articles := $(foreach root-article,$(ROOT), \
+ $(addprefix $(wwwdir)po/,$(root-article)))
+root-articles-pot := $(root-articles:%=%.pot)
+pots := $(articles-pot) $(root-articles-pot)
+endif # ! eq (,$(ALL_DIRS))
+
+# Team's translations that lack PO file.
+html-only := $(shell echo $(pots) | sed 's/ /\n/g' \
+ | while read pot; do \
+ po=$${pot%pot}$(TEAM).po; \
+ team_po=`echo $$po | sed 's,/po/,/,; s,^$(wwwdir),./,'`; \
+ html=$${pot%pot}$(TEAM).html; html=$${html/\/po\//\/}; \
+ if ! test -f $$po && ! test -f $$team_po && test -f $$html; then \
+ echo $${team_po}; \
+ fi; \
+ done)
+$(eval $(call sorted-files,html,${html-only}))
+
+# Team's translations that lack PO file.
+www-only := $(shell echo $(pots) | sed 's/ /\n/g' \
+ | while read pot; do \
+ po=$${pot%pot}$(TEAM).po; \
+ team_po=`echo $$po | sed 's,/po/,/,; s,^$(wwwdir),./,'`; \
+ html=$${pot%pot}$(TEAM).html; html=$${html/\/po\//\/}; \
+ if test -f $$po && ! test -f $$team_po; then \
+ echo $${team_po}; \
+ fi; \
+ done)
+$(eval $(call sorted-files,www,${www-only}))
# Function to report a group of PO files.
define report-pos
address@hidden(if $(1), $(if $(2), echo " "$(strip $(2)); echo;) \
- for file in $(1); do \
address@hidden(if $(strip $($(1)-pos)$($(1)-html)$($(1)-www)), \
+ $(if $(2), echo " "$(strip $(2)); echo;) \
+ $(if $($(1)-pos), \
+ for file in $($(1)-pos); do \
statistics=`LC_ALL=C $(MSGFMT) --statistics -o /dev/null $$file 2>&1 \
| egrep '(fuzzy|untranslated)'`; \
- test -n "$$statistics" && echo "$${file#./}:" $$statistics \
- || true ; \
- done; $(if $(2), echo;))
+ if test -n "$$statistics"; then \
+ echo "$${file#./}:" $$statistics; \
+ fi; \
+ www_po=$(wwwdir)`dirname $$file`/po/`basename $$file`; \
+ if ! test -f $${www_po%.$(TEAM).po}.pot; then \
+ echo "$${file#./}: no POT in \`www'."; \
+ continue; \
+ fi; \
+ if test -f $$www_po; then \
+ if $(cmp-POs) $$www_po $$file; then \
+ $(RM) $$file-diff.html; \
+ else \
+ www_statistics=$(LC_ALL=C $(MSGFMT) --statistics -o /dev/null \
+ $$www_po 2>&1 \
+ | egrep '(fuzzy|untranslated)'); \
+ case ".$${www_statistics}.$$statistics." in \
+ .?*.. $(paren) \
+ echo \
+ "$${file#./}: the team version seems ready to post."; \
+ ;; \
+ * $(paren) \
+ echo \
+ "$${file#./}: www and team revisions are not consistent."; \
+ ;; \
+ esac; \
+ $(if $(DIFF_PO), $(DIFF_PO) \
+ --title "$${file#./}: www vs. www-$(TEAM) repository" \
+ $$www_po $$file > $$file-diff.html;) \
+ fi; \
+ else \
+ if test ".$$statistics" = .;then \
+ echo \
+ "$${file#./}: new translation seems ready to post."; \
+ fi; \
+ fi; \
+ done;) \
+ $(if $($(1)-www), \
+ for file in $($(1)-www); do \
+ echo "$${file#./}: present in \`www'$(comma) absent in \`www-$(TEAM)'.";
\
+ done;) \
+ $(if $($(1)-html), \
+ for file in $($(1)-html); do \
+ echo \
+ "$${file#./}: HTML-only translation$(comma) needs conversion to PO."; \
+ done;) \
+ $(if $(2), echo;))
endef
# Helper target to check which articles have to be updated.
.PHONY: report
report:
ifeq (,${priority-articles}${important-articles}${important-directories})
- $(call report-pos,${other-pos},)
+ $(call report-pos,other)
else #!eq (,${priority-articles}${important-articles}${important-directories})
- $(call report-pos,${priority-articles-pos},Priority Articles)
- $(call report-pos,${important-articles-pos},Important Articles)
- $(call report-pos,${important-dir-pos},\
+ $(call report-pos,priority-articles,Priority Articles)
+ $(call report-pos,important-articles,Important Articles)
+ $(call report-pos,important-dir,\
Other Articles from Important Directories)
- $(call report-pos,${other-pos},Other Translations)
+ $(call report-pos,other,Other Translations)
endif #!eq (,${priority-articles}${important-articles}${important-directories})
+report.txt: $(translations) $(wildcard priorities.mk)
+ $(MAKE) report | grep -v '^make\[' > $@
+
# Helper target to rewrap all PO files; avoids spurious diffs when
# they get remerged by the official build.
# Formatting is defined per-file as dependencies of the main target
@@ -296,11 +440,198 @@
$(foreach file, $(patsubst ./%, %, $(translations)), \
$(eval $(call publish-file,$(file))))
+# Email aliases are defined through the file named `email-aliases'.
+# Lines beginning with `#' are ignored.
+# Every line should contain two or more colon-separated
+# fields. The first field is the identifier, the second
+# field is space-separated list of email addresses,
+# the third field is notification period in days
+# ($(NOTIFICATION_PERIOD) by default): a notification
+# is sent either when it changes, or when the period is over.
+# The fourth field is comma-separated list of flags
+# (`no-diffs' to disable sending PO differences in attachments,
+# `www' to report translations to be published).
+# The lines without a colon are ignored.
+HAVE-EMAIL-ALIASES := $(shell test -s email-aliases && echo yes)
+
+# Per-translator notification rules are defined in the `nottab' file.
+# The lines beginning with `#' are ignored.
+# Every line should contain exactly two colon-separated fields:
+# the first is an extended regular expression, the second is
+# space-separated list of email aliases to notify about the files
+# whose names match the expression. The lines without a colon
+# are ignored.
+HAVE-NOTTAB := $(shell test -s nottab && echo yes)
+
+.PHONY: notify
+# The variables to use closing parentheses and commas in arguments
+# of make functions.
+paren := )
+comma := ,
+# The function to find options for the translator $(1);
+# they are assigned to the shell variables `email', `period', `flags'.
+define parse-email-aliases
+$(if $(HAVE-EMAIL-ALIASES), \
+ record=`grep -v '^#' email-aliases | grep '^$(subst .,\\.,$1):' \
+ | head -n 1 | sed "s/^[^:]\+://"`; \
+ email=$$$${record%%:*}; flags=; period=; \
+ if test "x$$$$email" != "x$$$$record"; then \
+ period=$$$${record#*:}; \
+ case "x$$$$period" in \
+ *:* $(paren) flags=$$$${period#*:}; period=$$$${period%%:*}; ;; \
+ esac; \
+ fi, echo "Note: no email alias for \`$1' found.")
+endef
+ifneq (,$(HAVE-NOTTAB))
+# Extract identifiers of all translators.
+translators := $(shell \
+ sed '/^\#/d;/:/!d;s/^[^:]*://;s/:.*//;s/[[:space:]]\+/\n/g' nottab | sort -u)
+define notify-translator
+.PRECIOUS: $(1).note
+.INTERMEDIATE: $(1).note.tmp
+# The empty lines and lines beginning with a space are passed
+# from report.txt to $(1).note.tmp unchanged. Other lines begin
+# with filenames (up to the first `:'); they come to $(1).note.tmp
+# when and only when the filename matches one of regexps requested
+# for that translator via nottab.
+$(1).note.tmp: report.txt nottab $(wildcard email-aliases)
+ @regex="`egrep -v '^#' nottab \
+ | egrep ':(.+ )?$(subst .,\\.,$1)( |$$$$)' \
+ | while read line; do \
+ line=$$$${line//./\.}; \
+ echo -n "|($$$${line%%:*})"; \
+ done`"; \
+ if test "x$$$$regex" = x; then \
+ regex=':(actually this must be impossible)'; \
+ else \
+ regex="($$$${regex#|})"; \
+ fi; \
+ sed "s/^/@/" report.txt \
+ | while read line; do \
+ line="address@hidden"; \
+ if echo "$$$$line" | egrep -q "^( |$$$$)"; then \
+ echo "$$$$line"; continue; \
+ fi; \
+ file="$$$${line%%:*}"; \
+ if echo $$$$file | egrep -q "$$$$regex"; then \
+ echo "$$$$line"; \
+ fi; \
+ done > $(1).note.tmp
+ @$(parse-email-aliases); \
+case ",$$$$flags," in \
+ *,www,* ) ;; \
+ * ) \
+ sed --in-place -e '/:.* seems ready to post\.$$$$/d' $(1).note.tmp \
+ ;; \
+esac
+
+# Final notification file for the translator prepended with
+# the timestamp of the latest notification.
+$(1).note: $(1).note.tmp
+ @if test -s $(1).note && sed "1d" < $(1).note \
+ | cmp -s - $(1).note.tmp &>/dev/null; then \
+ touch $(1).note; \
+ else \
+ cp $(1).note.tmp $(1).note; \
+ fi
+
+.PHONY: inform-$(1)
+# Extract the list of emails and period for the translator
+# from email-aliases. Send the notification to the list of emails
+# when $(1).note is updated (that is, the timestamp is absent)
+# or when the period has passed. When sending, update
+# the timestamp in $(1).note.
+# URLs of the PO files to the report are added for convenience because
+# the notification is emailed.
+inform-$(1): $(1).note
+ifneq (,$(HAVE-EMAIL-ALIASES))
+ @$(parse-email-aliases); \
+ case "x$$$$period" in \
+ x ) period=$(NOTIFICATION_PERIOD); ;; \
+ esac; \
+ test "x$$$$email" != x \
+ || { echo "Note: no email for \`$1' found in email-aliases."; exit 0; }; \
+ period=$$$$(($$$$period*24*3600)); notify=yes; \
+ timestamp=`head -n1 $(1).note | grep '^#'`; \
+ if test "x$$$$timestamp" != x; then \
+ if test $$$$((`date +%s` - $$$${timestamp#?})) -lt $$$$period; then \
+ notify=no; \
+ fi; \
+ fi; \
+ grep -q : $(1).note &>/dev/null || notify=no; \
+ if test $$$$notify = yes; then \
+ echo "Sending notification for \`$1' ($$$$email)..."; \
+ case ",$$$$flags," in \
+ *,no-diffs,* ) \
+ echo "Note: attachments for \`$1' are disabled."; \
+ attachments=; \
+ ;; \
+ * ) \
+ attachments=$(if $(DIFF_PO),`\
+egrep 'revisions are not consistent\.$$$$' $(1).note \
+| sed 's/:.*//;s/$$$$/-diff.html/' \
+| while read f; do if test -s $$$$f; then echo $$$$f; fi; done;`); \
+ ;; \
+ esac; \
+ if test "x$$$$attachments" != x; then \
+ attachments="-a $$$$attachments --"; \
+ fi; \
+ grep -v '^#' $(1).note | sed "s/^/@/" \
+ | while read line; do \
+ line="address@hidden"; \
+ echo -n "$$$$line"; \
+ if echo "$$$$line" | grep -q "^[^ ]" ; then \
+ file=$$$${line%%:*}; name=$$$${file##*/}; dir=$$$${file%/*}/; \
+ if test ".$$$$dir" = ".$$$$file/"; then dir=""; fi; \
+ head=" ("; \
+ if test -f $$$$file; then \
+ echo; \
+ echo -n
"$$$${head}$(TEAM_URL_PREFIX)$$$$file$(TEAM_URL_POSTFIX)"; \
+ head=" "; \
+ fi; \
+ if test -f $(wwwdir)$$$${dir}po/$$$$name; then \
+ echo; \
+ echo -n "$$$${head}$(WWW_URL)$$$${dir}po/$$$$name"; \
+ head=" "; \
+ fi; \
+ if echo "$$$$line" | grep -qF "HTML-only translation"; then \
+ echo; \
+ echo -n "$$$${head}$(WWW_URL)$$$$dir$$$${name%po}html"; \
+ head=" "; \
+ fi; \
+ pot=$$$${name%.$(TEAM).po}.pot; \
+ if test -f $(wwwdir)$$$${dir}po/$$$$pot; then \
+ echo; \
+ echo -n "$$$${head}$(WWW_URL)$$$${dir}po/$$$$pot"; \
+ elif test -f $(wwwdir)$$$${dir}po/$$$$pot.opt; then \
+ echo; \
+ echo -n "$$$${head}$(WWW_URL)$$$${dir}po/$$$$pot.opt"; \
+ fi; \
+ echo ')'; \
+ fi; \
+ echo; \
+ done \
+ | $(GNUN_MAIL) -s "Automatic Notification for \`"$1"'" \
+ $$$$attachments $$$$email; $(MAIL_TAIL) \
+ sed --in-place '1{/^#/d;}' $(1).note; \
+ sed --in-place "1i#`date +%s`" $(1).note; \
+ else \
+ echo "Skipping notification for \`$1'..."; \
+ fi
+endif #ifneq (,$(HAVE-EMAIL-ALIASES))
+notify: inform-$(1)
+endef
+$(foreach translator, $(translators), \
+ $(eval $(call notify-translator,$(translator))))
+else # eq (,$(HAVE-NOTTAB))
+notify: ; @echo Nobody to notify.
+endif # eq (,$(HAVE-NOTTAB))
+
# Helper target to delete common auto-generated files.
.PHONY: clean
clean:
- @echo -n Deleting unnecessary auto-generated files...
+ @echo Deleting auto-generated files...
@for file in $(translations); do \
- $(RM) $$file~ $${file/.po/.mo} $$file.bak; \
+ $(RM) $$file~ $${file/.po/.mo} $$file.bak $$file-diff.html; \
done
- @echo " done."
+ @$(RM) report.txt *.note *.note.tmp
Index: NEWS
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/NEWS,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- NEWS 9 Dec 2012 12:21:18 -0000 1.74
+++ NEWS 14 Dec 2012 17:56:37 -0000 1.75
@@ -2,6 +2,14 @@
* Changes in GNUnited Nations 0.7 (????-??-??)
+** `report' in GNUmakefile.team provides more details.
+
+** Notifications are initially implemented in GNUmakefile.team
+ (see (gnun)GNUmakefile.team Targets).
+
+** GNUmakefile.team uses priorities.mk from `www' working copy;
+ no separate file is needed.
+
** `gnun-add-fuzzy-diff' is used in GNUmakefile.team when available
unless it is disabled.
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.315
retrieving revision 1.316
diff -u -b -r1.315 -r1.316
--- ChangeLog 9 Dec 2012 12:21:18 -0000 1.315
+++ ChangeLog 14 Dec 2012 17:56:37 -0000 1.316
@@ -1,3 +1,89 @@
+2012-12-14 Pavel Kharitonov <address@hidden>
+
+ Initially implement team's notifications; make more detailed
+ team's reports.
+
+ Update documentation.
+
+ * GNUmakefile.team: Include gnun.mk and priorities.mk from
+ `www' directory.
+ (all): Depend on `sync', `format', `notify'.
+ (sync-file) <sync-$(1)>: Unite `ADD_FUZZY_DIFF' invocations.
+ (www_gnun_dir, NOTIFICATION_PERIOD, pots):
+ (WWW_URL, TEAM_URL_PREFIX, TEAM_URL_POSTFIX, DIFF_PO):
+ (DIFF_PO_LANG, GNUN_MAIL, MAIL_TAIL, html-only, www-only):
+ (HAVE-EMAIL-ALIASES, HAVE-NOTTAB, comma, paren, translators):
+ New variables.
+ (sorted-files, parse-email-aliases, notify-translator):
+ New functions.
+ (priority-articles-pos, important-articles-pos):
+ (important-dir-pos, other-pos): Redefine using `sorted-files'.
+ (report.txt, notify): New targets.
+ (report-pos): Report more cases (HTML-only translations,
+ inconsistences of `www' vs. `www-$lang', new translations
+ ready to publish).
+ (report): Use modified calls of `report-pos'.
+ (clean): Remove new autogenerated files.
+ * gnun.texi (Introduction): Don't mention makefiles since they
+ are scripts.
+ (Files and Directories): New section.
+ (Rules): Remove non-informative section.
+ (Concepts): POT file is not always copied to get a new PO.
+ Improve the passage on changes that don't require manual
+ updates. Remove FIXME about layout (since that separate
+ section is being added). Add a reference to `Files
+ and Directories'.
+ (Concepts, Runtime Variables, Main Variables, Scripts):
+ (GNUmakefile.team Variables, GNUmakefile.team Targets):
+ (gnun-add-fuzzy-diff, gnun-init-po, gnun-merge-preconverted):
+ (gnun-clear-previous):
+ Unify formatting of ``fuzzy'' and ``previous''.
+ (Disadvantages): Add an item about alphabetically sorted
+ lists.
+ (Usage): Update documentation about template files.
+ (Runtime Variables): Don't mention `VALIDATE=yes' since it
+ is the default.
+ (no-grace-items): Slightly rephrase.
+ (sync): Add a comment about the target not being used.
+ (GNUmakefile.team Targets) <report>: Add
+ `report in GNUmakefile.team' anchor. Expand description.
+ (report): Link to `report in GNUmakefile.team'.
+ (triggers): Add a footnote saying that we currently run
+ a different command sequence.
+ (Main Variables): Explain how to build separate files.
+ (GNUmakefile.team Targets) <publish>: Add an anchor.
+ (PO Files): Move the passages about PO editors
+ to web-trans.texi; link thither. Rearrange subsections:
+ move `PO Tips' up, `GNU News' down. Link to `publish'
+ in `GNUmakefile.team Variables' rather than to that node.
+ (New Translation) <*GNUN-SLOT: TRANSLATOR'S NOTES*>: Add
+ an example, since @key{SPC} proved to be confusing anough.
+ (PO Tips): Replace the note about HTML entities with its
+ version from web-trans.texi.
+ (PO Files and Team): Fix a typo (`in in'). Mention automatic
+ notifications. Add a footnote saying that Translation
+ Managers can setup jobs on GNU server. Remove the note about
+ `priorities.mk' since it is taken from `www' working copy.
+ (GNUmakefile.team Variables): Now there are more than two
+ variables to update. Document `TEAM_URL_PREFIX',
+ `TEAM_URL_POSTFIX', `NOTIFICATION_PERIOD', `NOTIFY'
+ (GNUmakefile.team Targets) <notify>: New target.
+ (GNUmakefile.team Targets) <clean>: Don't specify exact file
+ patterns.
+ (GNUmakefile.team): Remove the description of would-be
+ features that are being implemented.
+ (Internals): Remove the non-informative `Rules' section;
+ add `Files and Directories' instead.
+ * web-trans.texi (PO Files): New node, moved from gnun.texi.
+ (Submitting as PO): Adjust the reference to `PO Files'.
+ (New Team): Remove the note about HTML entities (moved
+ to gnun.texi).
+ (Web-based Systems): Move to `PO Files'.
+ (Savannah Patch): Remove; it describes deprecated resource.
+ (Savannah Projects) <www>: "although s||almost |anything
+ happening in @samp{www} directly affects them".
+ * NEWS: Update.
+
2012-12-09 Pavel Kharitonov <address@hidden>
* GNUmakefile.team (ADD_FUZZY_DIFF): New variable.
Index: doc/gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/gnun.texi,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- doc/gnun.texi 9 Dec 2012 12:21:18 -0000 1.70
+++ doc/gnun.texi 14 Dec 2012 17:56:37 -0000 1.71
@@ -63,7 +63,7 @@
@node Introduction
@chapter Introduction to GNUnited Nations
-GNUnited Nations (abbreviated GNUN) is a collection of makefiles and
+GNUnited Nations (abbreviated GNUN) is a collection of
scripts that are supposed to make the life of @url{http://gnu.org}
translators easier. Although it is specifically developed for the GNU
Project's website, it could be customized, at least in theory, to fit
@@ -189,8 +189,8 @@
particular language.
The first time though, there is no @address@hidden@var{lang}.po}
-yet, so a translator must manually copy @address@hidden to
address@hidden@address@hidden, where @var{lang} represents the
+yet, so a translator must make @address@hidden@var{lang}.po} from
address@hidden@var{article}.pot}, where @var{lang} represents the
target language. @xref{New Translation}, for details.
Then comes the initial translation of messages in
@@ -227,7 +227,7 @@
articles. If the original article changes, GNUN will automatically
rebuild @address@hidden, and will merge the changes to
@address@hidden@var{lang}.po}. Any outdated translations will be
-marked as fuzzy, any new strings will be added with empty translations,
+marked as ``fuzzy,'' any new strings will be added with empty translations,
waiting to be translated. In the same run
@address@hidden@var{lang}.html} will be rebuilt so the relevant
strings in the translation will be substituted with the original English
@@ -235,22 +235,20 @@
@address@hidden@var{lang}.po}.
Those changes in the original article that do not affect the
-translatable strings will not lead to changes in
+translatable strings (or just delete whole strings) will not lead
+to changes in
@address@hidden@var{lang}.po}. Thus, no actions from translators
will be needed. @address@hidden@var{lang}.html} will be
automatically regenerated to reflect the changes.
address@hidden FIXME: The following paragraphs should go to a separate section
address@hidden that explains those details like exact paths in www, diagram with
address@hidden the basic directory layout, additional files like .translinks,
etc.
-
The POT for every article under GNUN's control is kept in the `www'
repository under a special directory @file{po/}, which is a
sub-directory of the relevant directory in the `www' tree. So, for
@indicateurl{http://www.gnu.org/philosophy/free-sw.html} that is
@file{philosophy/po/}. Except @file{free-sw.pot}, this directory holds
the canonical source of every translation, like @file{free-sw.bg.po},
address@hidden, etc.
address@hidden, etc. For more details,
address@hidden and Directories}.
Several additional features are implemented, like automatic update of
the list of the available translations. For example, if a new
@@ -353,6 +351,12 @@
feasible with current build server hardware. Additionally, any errors
interrupt the build so they have to be fixed before the next articles
are processed.
+
address@hidden
+In some rare cases (most notably, for alphabetically sorted lists)
+the structure of the translation should diverge from the structure
+of the original document. So far, our system has developped no means
+of taking such issues into account.
@end itemize
@node Usage
@@ -367,9 +371,8 @@
@end flushright
@sp 1
-GNUN currently consists of a few makefiles, scripts and optional
address@hidden@var{lang}.html} files, intended to contain
-article-independent but team-specific information. They are designed
+GNUN currently consists of a few makefiles, scripts and template files.
+They are designed
to reside in the @file{server/gnun} directory, but this may change.
In all examples in this manual, ``invoking'' means executing on the
command line @code{make -C server/gnun address@hidden
@@ -571,7 +574,7 @@
@cindex deferred generation of articles
@anchor{GRACE}
@item address@hidden
-If defined, ordinary articles that have fuzzy strings and are not older
+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
@@ -607,7 +610,7 @@
@code{cvs|svn|bzr add}-ing all necessary files.
@cindex validation
-When validation is enabled (i.e. with @code{VALIDATE=yes}), the
+When validation is enabled, the
original English articles are validated first, before any commands
that generate the other files, and @command{make} exits with an error
on the first encountered article. This is done on purpose, to prevent
@@ -660,8 +663,8 @@
server templates, gnunews, and all articles defined in the variable
@code{no-grace-articles} (@pxref{GRACE,,grace period}).
-This target can be rebuilt more often than @code{all}; however, it is
-currently not used.
+This target can be rebuilt more often than @code{all}; however,
+currently it is not used.
@node update-localized-URLs
@subsubsection The @code{update-localized-URLs} Target
@@ -673,6 +676,9 @@
This target is meant to be rebuilt nightly.
address@hidden As of Dec 2012 this target doesn't seem to be used very actively;
address@hidden in cron jobs, raw VCS invocations are issued instead.
address@hidden Should we remove it? --- ineiev
@node sync
@subsubsection The @code{sync} Target
@cindex synchronization, repository
@@ -741,7 +747,9 @@
all other translations are reported as less important.
There is also a script, @command{gnun-report}, to generate HTML reports.
address@hidden
address@hidden GNUmakefile.team profides another @code{report}
+target, which produces a more detailed report.
address@hidden in GNUmakefile.team}.
@node triggers
@subsubsection The @code{triggers} Target
@@ -787,7 +795,9 @@
To summarize, for effective operation GNUN should be invoked
automatically as @code{make; cvs|svn|bzr commit -m @dots{}; make
triggers}. To illustrate this, here is a concrete example showing the
-official job running at fencepost.gnu.org:
+official job once running at address@hidden days we
+run a more complicated script instead of this cron job in order
+to address some exceptional situations like concurrent builds.}:
@example
@group
@@ -844,6 +854,14 @@
automagically, without manual intervention. If not, that is a bug that
should be reported and fixed.
+You can also request building files separately this way:
+
address@hidden
address@hidden
+make -C server/gnun ../../philosophy/not-ipr.bg.html
address@hidden group
address@hidden example
+
@table @samp
@cindex TEMPLATE_LINGUAS
@cindex templates, defining
@@ -901,7 +919,7 @@
@cindex previous, diff
@item FUZZY_DIFF_LINGUAS
Add your language code here if you want GNUN to add differences to
-previous @code{msgid}s in your PO files. The differences are shown in
+``previous'' @code{msgid}s in your PO files. The differences are shown in
the default @command{wdiff} format. @xref{wdiff, wdiff, The word
difference finder, wdiff, GNU wdiff}, for more information.
@@ -934,78 +952,23 @@
@node PO Files
@section Working with PO Files
address@hidden PO, editing
-
-We anticipate that some gnu.org translators will find this format odd
-or inconvenient, if they never happened to work with PO files before.
-Don't worry, you will soon get accustomed to it. It is the
-established format for translations in the Free World, and you should
-have no problems if you have translated software before.
-
-The most efficient way to edit a PO file is using a specialized PO
-editor, because each of them represents and treats gettext messages in
-a consistent and predictable way. It is possible to edit a PO file
-with an ordinary plain text editor, but extra effort would be
-necessary to make it valid. Here is a list of widely used PO editors:
-
address@hidden
address@hidden PO editors
address@hidden
-PO mode. We recommend using GNU Emacs in PO mode, because Emacs is
-the program that is suitable for performing any task when it comes to
-maintaining the GNU Project's website. Provided that you have GNU
-gettext installed, any @file{.po} file you visit should automatically
-switch to PO mode. You can enable/disable it with @code{M-x po-mode
address@hidden On some GNU/Linux distros such as gNewSense, PO mode is
-available in a separate package, @code{gettext-el}. See
address@hidden://www.gnu.org/software/gettext}.
-
address@hidden
-Gtranslator---the GNOME PO editor. See
address@hidden://projects.gnome.org/@/gtranslator/}.
-
address@hidden
-Lokalize---the KDE 4 editor. See
address@hidden://userbase.kde.org/@/Lokalize}.
-
address@hidden
-KBabel---the KDE 3 editor. No longer supported, but might be
-available on some old systems.
address@hidden
-Poedit---another popular editor that is based on the @code{wxWidgets}
-graphical toolkit. See @uref{http://www.poedit.net}.
-
address@hidden
-Virtaal---a relevantly new editor that supports also the XLIFF format
-and uses the Translate Toolkit API. See
address@hidden://translate.sourceforge.net/@/wiki/@/virtaal}.
-
address@hidden
address@hidden @heresy
address@hidden Please forgive them, they don't know what they are doing...
-po.vim---ftplugin for the Vim editor. The best option for people who
-use Vim as their editor. See
address@hidden://www.vim.org/@/scripts/@/script.php?script_id=2530}.
address@hidden @end heresy
-
address@hidden
-Various web-based editors. @xref{Savannah VCS, , , web-trans, GNU Web
-Translators Manual}.
address@hidden itemize
+This section provides GNUN-specific information about woking
+with PO files. For general information, @pxref{PO Files, ,
+Working with PO Files, web-trans, GNU Web Translators Manual}.
@menu
* New Translation:: How to start a new translation.
+* PO Tips:: Tips and hints for translators.
* Migrating:: How to migrate an existing translation to a PO
format under GNUN's control.
-* GNU News:: How to handle ``whatsnew'' (a.k.a. ``gnunews'').
-* PO Tips:: Tips and hints for translators.
* generic.LANG.html:: Specifying information that will propagate in
every translation in a certain language.
* languages.txt:: Specifying canonical names for languages.
* PO Files and Team:: How to maintain translations in the team's
repository.
* Compendia:: Using translation memory.
+* GNU News:: Obsolete: How to handle ``whatsnew''.
@end menu
@@ -1136,7 +1099,7 @@
It is recommended that you wrap all lines in the comments to be less
than 80 lines; that looks better from a purely aesthetic point of view
and improves the performance of @file{GNUmakefile.team}'s @code{publish}
-rule (@pxref{GNUmakefile.team Variables}).
+rule (@pxref{publish}).
There are some special messages that appear in the POT and PO:
@@ -1147,14 +1110,21 @@
This is for translator's notes that are injected in the resulting
translation. @xref{Notes Slot}, for more information. If your
translation does not have notes, you @emph{must} translate this as a
-space, that is, @key{SPC}.
+space:
+
address@hidden
address@hidden
+msgid "*GNUN-SLOT: TRANSLATOR'S NOTES*"
+msgstr " "
address@hidden group
address@hidden example
@cindex credits, translators
@cindex translators' credits
@item *GNUN-SLOT: TRANSLATOR'S CREDITS*
This is again optional, and should contain the name (and address) of
the person who made the translation. ``Translate'' this string as a
-space (@key{SPC}) if you do not want your name to appear there.
+space if you do not want your name to appear there.
@xref{Credits Slot}.
@end table
@@ -1293,117 +1263,6 @@
meets the linking criteria for gnu.org. Please follow the FSF HTML
Style Sheet when adding URIs or other information.
address@hidden Migrating
address@hidden Transforming Existing Translation in PO Format
address@hidden migration, translations
address@hidden conversion of existing translations
-
-Migrating an existing translation to a PO file format is basically
-editing the header as described in the previous section, and
-populating each of the messages by copying the already translated text
-and/or markup from the existing translation in HTML format in the
-relevant message.
-
-Typically, you will visit @file{po/address@hidden (in PO mode) and
address@hidden@var{lang}.html} (in HTML mode) in another buffer. Then you
-can copy a paragraph or an element from the latter and yank it in the
-relevant message in the former. Be extra careful, since this is the
-time to check @emph{precisely} that the translation corresponds to the
-original. Further changes will be reflected, but if your ``initial''
-PO file is not a 100% match, that would not necessarily mean that it
-is an improvement. Since it is very easy to do this kind of check,
-because the relevant @code{msgid} and @code{msgstr} appear one above
-the other in the same buffer (or the similar concept in other PO
-editors), please @emph{do} perform this initial sanity check even if
-you are confident that the translation you have been yanking strings
-from is a completely up-to-date translation.
-
-There is also a semi-automatic way to produce an initial PO file. You
-checkout the revision of the English page, @file{foo.html}, that
-corresponds to the latest revision of the translation,
address@hidden@var{lang}.html}. Then you run @command{gnun-preconvert}
-which invokes @command{po4a-gettextize} (@xref{gnun-preconvert}.):
-
address@hidden
-gnun-preconvert foo.lang.html foo.html
address@hidden example
-
-If some passages in @address@hidden don't match the structure
-of @file{foo.html}, error messages will be displayed. Check them,
-adjust the files and try again. When you succeed, the result will be
-written to foo.lang.po. After that, run
address@hidden (@xref{gnun-merge-preconverted}.):
-
address@hidden
-gnun-merge-preconverted -C compendium.lang.po foo.lang.po foo.pot
address@hidden example
-
-If you have no compendium, just omit the address@hidden
-compendium.lang.po}'' part.
-
-You get @address@hidden where all messages are marked as
-``fuzzy'' (unless you use a compendium); you still should make sure that
-the translations correspond to the original and remove those ``fuzzy''
-marks. The script adds differences against previous @code{msgid}s to
-facilitate checking.
-
-There is no need to delete the existing HTML translation, GNUN will
-automatically overwrite it. The only thing a translator should do is to
-commit the PO file in the repository.
-
-When an essay has been translated by several people through the years,
-it is important that this information is recorded and reflected in the
-PO file. In the future, special targets may be added to enable the FSF
-to check who translated a particular article, and when.
-
-A recommended way to do this is as follows:
-
address@hidden
address@hidden
-# French translation of http://www.gnu.org/philosophy/@/bsd.html
-# Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
-# This file is distributed under the same license as the gnu.org article.
-# C@'edric Corazza <cedric.corazza@@wanadoo.fr>, 2006, 2008.
-# address@hidden Dominguez <taz@@gnu.org>, 2007.
address@hidden group
address@hidden example
-
-In this example, it is clear that C@'edric made the initial
-translation, address@hidden made some changes in 2007, and the original
-translator returned in 2008 and continued maintaining it.
-
address@hidden GNU News
address@hidden Special Handling for GNU News
address@hidden gnunews
address@hidden whatsnew
address@hidden gnusflashes
-
address@hidden attention:} The practice of news handling that is
-described here has been obsolete for some time now, as they are being
-fed automatically from Planet GNU (@uref{http://planet.gnu.org}).
-Nevertheless, the information below is accurate to the extent that the
-support for the old-fashioned way is still available.
-
-The GNU website has infrastructure for supporting ``What's New'', also
-known as ``GNU News''. Entries are added in a special plain text
-file, @file{server/whatsnew.txt} and are used to build
address@hidden/whatsnew.include} and @file{gnusflashes.include}. The
-former is used by @file{server/whatsnew.html}, while the latter was
-included in the homepage.
-
-GNUN has additional rules for building @file{whatsnew.pot}, which
-contains a combination of all necessary strings for
address@hidden/address@hidden,
address@hidden/address@hidden and
address@hidden@var{lang}.include}. There is nothing unusual in this
-POT file, so it should be translated like any other. When you commit
address@hidden@var{lang}.po}, it will be used to generate all three
-localized files.
-
-Note that localized RSS feeds are not supported on purpose, as it would
-be annoying for subscribers if new items appear in English and then once
-again translated.
-
@node PO Tips
@subsection Useful Hints for Editing PO Files
@cindex tips, translators
@@ -1471,9 +1330,10 @@
@end example
@item
-There is absolutely no reason to use HTML entities in translations as a
-replacement for common non-ASCII characters. They are harder to write
-and serve no purpose.
+Do not use HTML entities for non-ASCII letters as in the English
+original. They are harder to type and read. So, if there is
address@hiddenü} and this is a character from the alphabet of your
+language, just write it as @samp{@"u} directly.
@item
Wrapping of @code{msgstr} using @kbd{M-q} in Emacs (or other means) is
@@ -1486,6 +1346,85 @@
is rendered incorrectly by the web browser.
@end itemize
address@hidden Migrating
address@hidden Transforming Existing Translation in PO Format
address@hidden migration, translations
address@hidden conversion of existing translations
+
+Migrating an existing translation to a PO file format is basically
+editing the header as described in the previous section, and
+populating each of the messages by copying the already translated text
+and/or markup from the existing translation in HTML format in the
+relevant message.
+
+Typically, you will visit @file{po/address@hidden (in PO mode) and
address@hidden@var{lang}.html} (in HTML mode) in another buffer. Then you
+can copy a paragraph or an element from the latter and yank it in the
+relevant message in the former. Be extra careful, since this is the
+time to check @emph{precisely} that the translation corresponds to the
+original. Further changes will be reflected, but if your ``initial''
+PO file is not a 100% match, that would not necessarily mean that it
+is an improvement. Since it is very easy to do this kind of check,
+because the relevant @code{msgid} and @code{msgstr} appear one above
+the other in the same buffer (or the similar concept in other PO
+editors), please @emph{do} perform this initial sanity check even if
+you are confident that the translation you have been yanking strings
+from is a completely up-to-date translation.
+
+There is also a semi-automatic way to produce an initial PO file. You
+checkout the revision of the English page, @file{foo.html}, that
+corresponds to the latest revision of the translation,
address@hidden@var{lang}.html}. Then you run @command{gnun-preconvert}
+which invokes @command{po4a-gettextize} (@xref{gnun-preconvert}.):
+
address@hidden
+gnun-preconvert foo.lang.html foo.html
address@hidden example
+
+If some passages in @address@hidden don't match the structure
+of @file{foo.html}, error messages will be displayed. Check them,
+adjust the files and try again. When you succeed, the result will be
+written to foo.lang.po. After that, run
address@hidden (@xref{gnun-merge-preconverted}.):
+
address@hidden
+gnun-merge-preconverted -C compendium.lang.po foo.lang.po foo.pot
address@hidden example
+
+If you have no compendium, just omit the address@hidden
+compendium.lang.po}'' part.
+
+You get @address@hidden where all messages are marked as
+``fuzzy'' (unless you use a compendium); you still should make sure that
+the translations correspond to the original and remove those ``fuzzy''
+marks. The script adds differences against ``previous'' @code{msgid}s to
+facilitate checking.
+
+There is no need to delete the existing HTML translation, GNUN will
+automatically overwrite it. The only thing a translator should do is to
+commit the PO file in the repository.
+
+When an essay has been translated by several people through the years,
+it is important that this information is recorded and reflected in the
+PO file. In the future, special targets may be added to enable the FSF
+to check who translated a particular article, and when.
+
+A recommended way to do this is as follows:
+
address@hidden
address@hidden
+# French translation of http://www.gnu.org/philosophy/@/bsd.html
+# Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnu.org article.
+# C@'edric Corazza <cedric.corazza@@wanadoo.fr>, 2006, 2008.
+# address@hidden Dominguez <taz@@gnu.org>, 2007.
address@hidden group
address@hidden example
+
+In this example, it is clear that C@'edric made the initial
+translation, address@hidden made some changes in 2007, and the original
+translator returned in 2008 and continued maintaining it.
+
@node generic.LANG.html
@subsection The @address@hidden File
@cindex team information
@@ -1594,11 +1533,16 @@
@end example
All members and the team leader commit in their project's
-repository---when a translation is ready, the leader checks it in in the
-official `www' repository. If an original article changes,
-a build could be invoked to synchronize (i.e. merge) the changes and
+repository---when a translation is ready, the leader checks it in
+the official `www' repository. If an original article changes, a
+build could be invoked to synchronize (i.e. merge) the changes and
optionally automatically commit them so that the draft PO files are
-updated. A translator would then normally update the PO file, and
+updated; at the same time, automatic notifications are sent to the
+persons interested in particular address@hidden following
+sections describe in more details how to setup these automatic
+actions; however, if you have any difficulties with that, please ask
+GNU Web Translation Managers to make it for your team using our
+server.}. A translator would then normally update the PO file, and
commit it again in the project's Sources repository, from where the
coordinator will pick it up and install it in `www'.
@@ -1637,10 +1581,6 @@
@end group
@end example
address@hidden priorities.mk
-Add @file{priorities.mk} in order to make the @code{report} target sort
-the files by priority.
-
The next sections explain how to adopt the makefile for your team and
how to invoke a ``build''.
@@ -1653,7 +1593,8 @@
@node GNUmakefile.team Variables
@subsubsection Adopting @file{GNUmakefile.team} for a Specific Team
-To adjust the makefile for your team, you need to edit two variables.
+To adjust the makefile for your team, you need to edit the next
+variables.
@table @samp
@item TEAM
@@ -1667,6 +1608,13 @@
repository at @file{~/projects/www}, the value of @code{wwwdir} should
be @code{../www/} or @file{/home/@var{user}/projects/www/}. Note the
slash at the end, it is important.
+
address@hidden TEAM_URL_PREFIX
address@hidden TEAM_URL_POSTFIX
+These variables are used to transform the path to a file in team's
+working copy into a URL for this file; they are only needed for
+automatic email notifications. It is expected that typically
+the URL will point to some sort of Web interface for the repository.
@end table
If two variants of one language share the same project and repository
@@ -1679,13 +1627,27 @@
@table @samp
@item ADD_FUZZY_DIFF
-The program to manage differences to previous @code{msgid}s added to
+The program to manage differences to ``previous'' @code{msgid}s added to
``fuzzy'' translations when merging PO files. When undefined,
the makefile tries to find @command{gnun-add-fuzzy-diff} and assigns
the result to this variable. @xref{gnun-add-fuzzy-diff}.
Define to empty string to disable the feature.
address@hidden address@hidden
address@hidden NOTIFICATION_PERIOD
address@hidden reminder period, default
address@hidden notification period, default
+Default period of reminders sent by the @code{notify} target.
+
address@hidden mail, notifications
address@hidden NOTIFY
address@hidden NOTIFY=yes
+Make the @code{notify} target actually send notifications.
+
address@hidden NOTIFY=no
+Do not send email notifications about errors. This is the default.
+
@item VERBOSE=yes
Print more information from @command{cvs}, @command{svn} and
@command{msgmerge}; off by default. Note that @code{VERBOSE} can be
@@ -1719,8 +1681,97 @@
for it.
@item report
address@hidden in GNUmakefile.team}
Verifies which translations are complete, and prints a list (with
-statistics) of those that need to be updated.
+statistics) of those that need to be updated. Also, it reports
+the translations that are not consistent with the revisions from
address@hidden repository.
+
+More fine-grained notifications are implemented as the @code{notify}
+target.
+
address@hidden notify
address@hidden outdated translations, notifications
+Invokes the @code{report} target, filters its output for different
+translators and sends them notifications.
+
+As an addition to the output of the @code{report} target, URLs for
+relevant files are written; also, when @dfn{www} and team revisions
+are not consistent, their differences generated with
address@hidden are optionally attached (@pxref{gnun-diff-po},
+for more details).
+
address@hidden nottab
+The list of files to report against are configured with @file{nottab}
+file. The lines of this file that begin with `#' are ignored;
+other lines should contain two fields separated by `:'.
+
+The first field is an extended grep regular expression; the files are
+selected for the report if their names match this expression.
address@hidden Expressions, , Regular Expressions, grep,
+GNU Grep manual}.
+
+The second field is a space-separated list of single-word translators'
+identifiers for which the line applies. The file may look like this:
+
address@hidden
+^gnu/gnu-history: alice bob carol
+^distros/(common-distros|distros|screenshot): dan alice
+^(licenses|philosophy)/: eve bob frank
+^licenses/: dan
address@hidden example
+
address@hidden email-aliases
+Email addresses of the translators are kept in a separate file,
address@hidden Like @file{nottab}, this file contains lines
+separated by `:'; the lines beginning with `#' are ignored.
+
+The first field is translators' identifier, the second is
+space-separated list of translators' email addresses. These two
+fields are mandatory.
+
address@hidden reminder period
address@hidden notification period
+The third field is the personal reminder period in days. After that
+period the message is sent again even though its contents don't
+change. Otherwise, the @code{notify} target only sends messages when
+something changes. Naturally, no message is sent when no action
+is needed in the requested set of translations.
+
+The team-wide default period is defined in its GNUmakefile.team using
+the @code{NOTIFICATION_PERIOD} variable.
+
+The fourth field provides comma-separated options for the report.
+Currently recognized options are:
+
address@hidden @code
address@hidden no-diffs
+Disables sending @dfn{www} vs. @address@hidden differences
+as attachments.
+
address@hidden www
+Report cases that suggest actions by the team leader, that is,
+when the translation in the team repository is full whereas
+in @dfn{www} it is incomplete or absent.
address@hidden table
+
+This is an example of @file{email-aliases}:
+
address@hidden
+alice:alice@@example.com abc@@test.net
+# Disable `dan' temporarily.
+#dan:miller@@test.by:5:no-diffs,www
+bob:brh@@invalid.tr:3
+# Note that the third field is empty; the default value for period
+# will be used.
+carol:carol@@localhost.br translator@@example.bg::no-diffs
+eve:eve@@test.gr:2:www
+frank:gnun-notifications@@example.gr:1:www,no-diffs
address@hidden example
+
+The @file{email-aliases} file should be kept privately because it
+may contain personal email addresses of people. How to do this
+is out of scope of GNUN and this manual.
@item format
A convenience rule to re-wrap all files upto the standard length. Most
@@ -1738,6 +1789,7 @@
line, wherever it may occur.
@item publish
address@hidden
The @code{publish} rule's task is to copy all modified files to the
official @dfn{www} repository. It depends on the @code{format} target
to ensure that all files are re-wrapped to the standard line length
@@ -1746,7 +1798,7 @@
files are in a satisfactory condition to be published, and this rule is
just a convenience to avoid multiple manual @command{cp} invocations.
As a rule of thumb, before running this rule it is sane to run
address@hidden and correct any @dfn{fuzzy} messages and other problems, if
address@hidden and correct any ``fuzzy'' messages and other problems, if
necessary.
The @code{publish} rule does not depend on @code{sync} explicitly,
@@ -1777,23 +1829,18 @@
@end example
@item clean
-Deletes all backup and auto-generated files that some PO editors leave
-behind, address@hidden@var{file}.po~}, @address@hidden and
address@hidden@var{file}.mo}.
+Deletes all backup and auto-generated files.
@end table
@code{make VCS=yes} is the recommended command to be run periodically.
To check the status of the translations, run @code{make report}.
Feel free to replace all strings with equivalents in your native
-language and of course---do not hesitate to extend this file and modify
-it as much as you like. For example, useful extra functionality would
-be a target that will check which files have not yet been committed in
-the official repository, or which files have to be updated there
-(i.e. they were updated by the team members but not installed by the
-coordinator). Either way, if you come up with something interesting, it
-would be nice to send a message to @email{bug-gnun@@gnu.org}, so that
address@hidden gets updated for all teams' benefit.
+language and of course---do not hesitate to extend this file and
+modify it as much as you like. If you come up with
+something interesting, it would be nice to send a message to
address@hidden@@gnu.org}, so that @file{GNUmakefile.team} gets
+updated for all teams' benefit.
@node GNUmakefile.team and Cron
@subsubsection Automatic Synchronization and Status Reports
@@ -1874,6 +1921,38 @@
GNUN checks a specific file, @file{exclude.pot}, and when that file
contains the string, it won't be added to @file{compendium.pot}.
address@hidden GNU News
address@hidden Special Handling for GNU News
address@hidden gnunews
address@hidden whatsnew
address@hidden gnusflashes
+
address@hidden attention:} The practice of news handling that is
+described here has been obsolete for some time now, as they are being
+fed automatically from Planet GNU (@uref{http://planet.gnu.org}).
+Nevertheless, the information below is accurate to the extent that the
+support for the old-fashioned way is still available.
+
+The GNU website has infrastructure for supporting ``What's New'', also
+known as ``GNU News''. Entries are added in a special plain text
+file, @file{server/whatsnew.txt} and are used to build
address@hidden/whatsnew.include} and @file{gnusflashes.include}. The
+former is used by @file{server/whatsnew.html}, while the latter was
+included in the homepage.
+
+GNUN has additional rules for building @file{whatsnew.pot}, which
+contains a combination of all necessary strings for
address@hidden/address@hidden,
address@hidden/address@hidden and
address@hidden@var{lang}.include}. There is nothing unusual in this
+POT file, so it should be translated like any other. When you commit
address@hidden@var{lang}.po}, it will be used to generate all three
+localized files.
+
+Note that localized RSS feeds are not supported on purpose, as it would
+be annoying for subscribers if new items appear in English and then once
+again translated.
+
@node Webmaster Tips
@section Tips and Hints for Webmasters
@cindex tips, webmasters
@@ -2031,10 +2110,81 @@
of programs that may also be useful for the translators.
@menu
+* Files and Directories:: What, where, when.
* Scripts:: Helper scripts.
-* Rules:: The knotty rules explained.
@end menu
address@hidden Files and Directories
address@hidden Files and Directories
+
address@hidden FIXME: More detailed description is desirable.
+
+This is a brief diagram of @dfn{www} working copy.
+
address@hidden
address@hidden
+Root
+ |
+ +--gnu
+ | |
+ | |
+ | +--linux-and-gnu.html #
+ | address@hidden @@
+ | +--manifesto.html #
+ | address@hidden @@
+ | address@hidden
+ | |
+ | +--------------------------po
+ | |
+ +--home.html # address@hidden %
+ address@hidden @@ +--manifesto.pot @@
+ +--planetfeeds.html #/@@ +--manifesto.proto * @@
+ address@hidden @@ +--manifesto.translist @@
+ +--po address@hidden * @@
+ | | address@hidden @@
+ | +--home.pot @@ address@hidden @@
+ | +--home.proto * @@ address@hidden %
+ | +--home.translist @@ address@hidden
+ | address@hidden %
+ | address@hidden * @@
+ | address@hidden @@
+ | address@hidden @@
+ | +--planetfeeds.proto * @@
+ | +--planetfeeds.pot.opt @@
+ | address@hidden %
+ | address@hidden
+ |
+ +--server
+ | |
+ | +-------------------------gnun
+ | | |
+ | +--sitemap.html #/@@ +--GNUmakefile * #
+ | address@hidden @@ +--config.mk * #
+ | +--po +--gnun.mk #
+ | | | +--language.txt #
+ | | +--sitemap.pot @@ address@hidden #
+ | | +--sitemap.proto * @@ +--compendia
+ | | address@hidden % |
+ | | address@hidden @@ address@hidden #
+ | | +--body-include-2.pot @@ address@hidden @@
+ | | +--body-include-2.proto * @@
+ | | address@hidden %
+ | | address@hidden
+ | |
+ | +--body-include-2.html #
+ | address@hidden @@
+ | address@hidden
+ address@hidden
+
+Legend:
+* The file is maintained locally, without committing it to CVS.
+# The file is edited manually.
+@@ The file is regenerated automatically.
+% The file is edited both manually and automatically.
+#/@@ The file is generated automatically, but outside of GNUN.
address@hidden group
address@hidden example
+
@node Scripts
@section GNUN Scripts
@@ -2045,7 +2195,7 @@
They all can be invoked separately, as stand-alone programs.
@menu
-* gnun-add-fuzzy-diff:: Add differences to previous
+* gnun-add-fuzzy-diff:: Add differences to ``previous''
@code{msgid}s.
* gnun-diff-po:: Compare two revisions of a PO file.
* gnun-init-po:: Initialize a new translation.
@@ -2064,7 +2214,7 @@
@cindex previous, diff
This script adds comments with differences of current @code{msgid}s
-against previous ones to fuzzy translations in a PO file. To produce
+against ``previous'' ones to ``fuzzy'' translations in a PO file. To produce
the differences @command{wdiff} is used. This may be useful to figure
out what has changed. In fact, it wraps around a @command{sed} script
used in GNUN internally.
@@ -2147,7 +2297,7 @@
@item -d
@itemx --disable-diffs
-Don't add diffs to previous messages.
+Don't add diffs to ``previous'' messages.
@item -g
@itemx --team="@var{team <list>}"
@@ -2206,7 +2356,7 @@
This script takes @command{po4a-gettextize} output, adds current
@code{msgid}s as ``previous'' values, merges the file with the new
-POT, and adds differences against previous values like
+POT, and adds differences against ``previous'' values like
@command{gnun-add-fuzzy-diff} does.
@example
@@ -2405,9 +2555,9 @@
convenience only, for those who find it hard to remember the various
@samp{gettext} tools and their options.
address@hidden deletes the @dfn{previous} messages in a
address@hidden deletes the ``previous'' messages in a
PO file, which is a good thing to do after the corresponding translation
-is updated and the @dfn{fuzzy} marker removed. It can also be used to
+is updated and the ``fuzzy'' marker removed. It can also be used to
wrap long lines in PO files.
Usage:
@@ -2424,11 +2574,6 @@
Print usage information on stdout.
@end table
address@hidden Rules
address@hidden How the Recipes Work
-
-Read the source code, then please tell us :-)
-
@node Bugs
@chapter Reporting Bugs
@cindex bugs, reporting
Index: doc/web-trans.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/web-trans.texi,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- doc/web-trans.texi 7 Dec 2012 16:39:28 -0000 1.38
+++ doc/web-trans.texi 14 Dec 2012 17:56:37 -0000 1.39
@@ -5,7 +5,7 @@
@settitle GNU Web Translators Manual
@c FIXME: Would be nice to have it in the format `%:b %:d, %:y', but
@c in English.
address@hidden lastupdate 07.12.2012
address@hidden lastupdate 14.12.2012
@afourpaper
@c %**end of header
@@ -249,7 +249,7 @@
create an empty @address@hidden@var{lang}.po} file and then
translate all messages with a PO editor. @xref{New Translation, , ,
gnun, The GNUnited Nations Manual}. For an almost complete list of PO
-editors, @pxref{PO Files, , , gnun, The GNUnited Nations Manual}.
+editors, @pxref{PO Files}.
@item
When you are pleased with the translation, check that the PO file is
@@ -472,12 +472,6 @@
@item
The PO file header and initial comments should be completed as
documented.
-
address@hidden
-Do not use HTML entities for non-ASCII letters as in the English
-original. They are harder to type and read. So, if there is
address@hiddenü} and this is a character from the alphabet of your
-language, just write it as @samp{@"u} directly.
@end itemize
@item
@@ -598,6 +592,7 @@
@menu
* Review:: The importance of peer review.
* Commits:: What to modify, and how.
+* PO Files:: Tools to edit translations.
* Savannah:: Using Savannah resources.
* Co-leaders:: Promoting co-leaders, when necessary.
@end menu
@@ -836,6 +831,105 @@
moderated. If you absolutely do not desire receiving all traffic, just
disable mail delivery in Mailman's user interface.
address@hidden PO Files
address@hidden Working with PO Files
address@hidden PO, editing
+
+We anticipate that some gnu.org translators will find this format odd
+or inconvenient, if they never happened to work with PO files
address@hidden www.gnu.org-specific information about editing
+PO files, @pxref{PO Files, , Working with PO Files, gnun,
+The GNUnited Nations Manual}.}.
+Don't worry, you will soon get accustomed to it. It is the
+established format for translations in the Free World, and you should
+have no problems if you have translated software before.
+
+The most efficient way to edit a PO file is using a specialized PO
+editor, because each of them represents and treats gettext messages in
+a consistent and predictable way. It is possible to edit a PO file
+with an ordinary plain text editor, but extra effort would be
+necessary to make it valid. Here is a list of widely used PO editors:
+
address@hidden
address@hidden PO editors
address@hidden
+PO mode. We recommend using GNU Emacs in PO mode, because Emacs is
+the program that is suitable for performing any task when it comes to
+maintaining the GNU Project's website. Provided that you have GNU
+gettext installed, any @file{.po} file you visit should automatically
+switch to PO mode. You can enable/disable it with @code{M-x po-mode
address@hidden On some GNU/Linux distros such as gNewSense, PO mode is
+available in a separate package, @code{gettext-el}. See
address@hidden://www.gnu.org/software/gettext}.
+
address@hidden
+Gtranslator---the GNOME PO editor. See
address@hidden://projects.gnome.org/@/gtranslator/}.
+
address@hidden
+Lokalize---the KDE 4 editor. See
address@hidden://userbase.kde.org/@/Lokalize}.
+
address@hidden
+KBabel---the KDE 3 editor. No longer supported, but might be
+available on some old systems.
+
address@hidden
+Poedit---another popular editor that is based on the @code{wxWidgets}
+graphical toolkit. See @uref{http://www.poedit.net}.
+
address@hidden
+Virtaal---a relevantly new editor that supports also the XLIFF format
+and uses the Translate Toolkit API. See
address@hidden://translate.sourceforge.net/@/wiki/@/virtaal}.
+
address@hidden
address@hidden @heresy
address@hidden Please forgive them, they don't know what they are doing...
+po.vim---ftplugin for the Vim editor. The best option for people who
+use Vim as their editor. See
address@hidden://www.vim.org/@/scripts/@/script.php?script_id=2530}.
address@hidden @end heresy
+
address@hidden
+Various web-based editors.
address@hidden itemize
+
address@hidden Web-based Systems
+
+An alternative way to maintain translations is to use one of the
+existing online editors. There are plans to install a web-based system
+for managing @file{.po} files at Savannah, including online editing and
+statistics. Until it happens, teams who wish to use this functionality
+may setup such a server on a host of their own, or use one of the
+existing free hosting platforms such as Launchpad
+(@uref{http://translations.launchpad.net}).
+
+Here is a short and probably incomplete list of such systems:
+
address@hidden
address@hidden
address@hidden://translate.sourceforge.net/@/wiki/@/pootle}
+
address@hidden
address@hidden://code.google.com/p/vertaal}
+
address@hidden
address@hidden://code.google.com/p/narro}
+
address@hidden
address@hidden://dev.launchpad.net}
+
address@hidden itemize
+
+If you decide to use such a system, please make sure that no
+translations are published in HTML format there.
+
+Note that to keep the @file{.pot} files regularly updated (assuming such
+a web-based system runs @command{msgmerge} automatically), you'll have
+to take care of the one-way regular sync from the @samp{www} CVS
+repository.
+
@node Savannah
@subsection Taking Advantage of Savannah
@@ -887,7 +981,6 @@
* Savannah Support::
* Savannah Tasks::
* Savannah Bugs::
-* Savannah Patch::
* Savannah News::
* Savannah Mailing Lists::
* Savannah VCS::
@@ -981,18 +1074,6 @@
have such policy.
@end itemize
address@hidden Savannah Patch
address@hidden Patch Tracker
-
-This tracker doesn't make much sense for translation projects, as the
-original on which the translation is based is volatile and the
-translation @dfn{patch} is 100% guaranteed not to apply cleanly very
-soon after it is submitted. Even ignoring this detail, this specific
-feature is slowly marching towards complete deprecation, as there are
-much better ways to submit patches nowadays.
-
-You should disable this feature, as it causes only confusion.
-
@node Savannah News
@subsubsection News Tracker
@@ -1046,41 +1127,6 @@
collaborative maintenance---if it eases only you, project members just
won't use it so that won't be a net win.
address@hidden Web-based Systems
-
-An alternative way to maintain translations is to use one of the
-existing online editors. There are plans to install a web-based system
-for managing @file{.po} files at Savannah, including online editing and
-statistics. Until it happens, teams who wish to use this functionality
-may setup such a server on a host of their own, or use one of the
-existing free hosting platforms such as Launchpad
-(@uref{http://translations.launchpad.net}).
-
-Here is a short and probably incomplete list of such systems:
-
address@hidden
address@hidden
address@hidden://translate.sourceforge.net/@/wiki/@/pootle}
-
address@hidden
address@hidden://code.google.com/p/vertaal}
-
address@hidden
address@hidden://code.google.com/p/narro}
-
address@hidden
address@hidden://dev.launchpad.net}
-
address@hidden itemize
-
-If you decide to use such a system, please make sure that no
-translations are published in HTML format there.
-
-Note that to keep the @file{.pot} files regularly updated (assuming such
-a web-based system runs @command{msgmerge} automatically), you'll have
-to take care of the one-way regular sync from the @samp{www} CVS
-repository.
-
@node Co-leaders
@subsection Promoting Members as Co-leaders
@@ -1725,9 +1771,9 @@
team leaders (and co-leaders) should be members of this project.
Note that this project has no direct relationship with translators,
-although anything happening in @samp{www} directly affects them. The
address@hidden project is managed separately and has a different (entirely
-unrelated) process for approving contributors.
+although almost anything happening in @samp{www} directly affects
+them. The @samp{www} project is managed separately and has
+a different (entirely unrelated) process for approving contributors.
@item trans-coord
An organizational project especially created for co-ordination and