[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trans-coord/gnun/server/gnun AUTHORS ChangeLog ...
From: |
Pavel Kharitonov |
Subject: |
trans-coord/gnun/server/gnun AUTHORS ChangeLog ... |
Date: |
Fri, 25 Nov 2011 08:10:28 +0000 |
CVSROOT: /sources/trans-coord
Module name: trans-coord
Changes by: Pavel Kharitonov <ineiev> 11/11/25 08:10:28
Modified files:
gnun/server/gnun: AUTHORS ChangeLog GNUmakefile Makefile.am NEWS
configure.ac gnun.mk
gnun/server/gnun/doc: gnun.texi
Added files:
gnun/server/gnun: add-fuzzy-diff gnun-add-fuzzy-diff.in
Log message:
Add wdiffs to previous msgids.
* add-fuzzy-diff.in, gnun-add-fuzzy-diff.in: New files.
* configure.ac (HAVE_WDIFF): New conditional.
* GNUmakefile (ADD-FUZZY-DIFF): New variable.
(update-po): Add diffs when the language code is present in
FUZZY_DIFF_LINGUAS.
* Makefile.am: Add add-fuzzy-diff and gnun-fuzzy-diff to scripts.
* gnun.mk (FUZZY_DIFF_LINGUAS): New variable.
* doc/gnun.texi (Webmasters Tips): Move the menu down.
* AUTHORS, NEWS, doc/gnun.texi: Update.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/AUTHORS?cvsroot=trans-coord&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.214&r2=1.215
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.102&r2=1.103
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/Makefile.am?cvsroot=trans-coord&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/NEWS?cvsroot=trans-coord&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/configure.ac?cvsroot=trans-coord&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun.mk?cvsroot=trans-coord&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/add-fuzzy-diff?cvsroot=trans-coord&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun-add-fuzzy-diff.in?cvsroot=trans-coord&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/doc/gnun.texi?cvsroot=trans-coord&r1=1.29&r2=1.30
Patches:
Index: AUTHORS
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/AUTHORS,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- AUTHORS 13 Nov 2011 11:19:02 -0000 1.6
+++ AUTHORS 25 Nov 2011 08:10:27 -0000 1.7
@@ -5,17 +5,18 @@
Pavel Kharitonov <address@hidden>
- Add diff-page-head.html, diff-page-tail.html,
+ Add add-fuzzy-diff.in, diff-page-head.html, diff-page-tail.html,
dtd/html5.dtd (based on W3C DTD), expand-m4-includes.in,
languages.txt (compiled from www.gnu.org pages),
- translinks-head.html, translinks-tail.html,
+ gnun-add-fuzzy-diff, translinks-head.html, translinks-tail.html,
update-localized-urls.in.
- Some changes in GNUmakefile, gnun-validate-html, Makefile.am,
- README, dtd/README, doc/gnun.texi, doc/web-trans.texi.
+ Some changes in configure.ac, GNUmakefile, gnun-validate-html,
+ Makefile.am, README, dtd/README, doc/gnun.texi,
+ doc/web-trans.texi.
- Tiny changes in config.mk.in, configure.ac,
- dtd/Makefile.am, validate-html-notify.in.
+ Tiny changes in config.mk.in, dtd/Makefile.am, gnun.mk,
+ validate-html-notify.in.
Brett Smith <address@hidden>
"Distribution Terms" section in doc/web-trans.texi
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -b -r1.214 -r1.215
--- ChangeLog 20 Nov 2011 11:41:13 -0000 1.214
+++ ChangeLog 25 Nov 2011 08:10:28 -0000 1.215
@@ -1,3 +1,18 @@
+2011-11-25 Pavel Kharitonov <address@hidden>
+
+ Add wdiffs to previous msgids.
+
+ * add-fuzzy-diff.in, gnun-add-fuzzy-diff.in: New files.
+ * configure.ac (HAVE_WDIFF): New conditional.
+ * GNUmakefile (ADD-FUZZY-DIFF): New variable.
+ (update-po): Add diffs when the language code is present
+ in FUZZY_DIFF_LINGUAS.
+ * Makefile.am: Add add-fuzzy-diff and gnun-fuzzy-diff
+ to scripts.
+ * gnun.mk (FUZZY_DIFF_LINGUAS): New variable.
+ * doc/gnun.texi (Webmasters Tips): Move the menu down.
+ * AUTHORS, NEWS, doc/gnun.texi: Update.
+
2011-11-20 Pavel Kharitonov <address@hidden>
Add a variable for extra templates to gnun.mk.
Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -b -r1.102 -r1.103
--- GNUmakefile 20 Nov 2011 11:41:13 -0000 1.102
+++ GNUmakefile 25 Nov 2011 08:10:28 -0000 1.103
@@ -30,6 +30,7 @@
MAILFAIL := $(pkglibexecdir)/mailfail
MAKE-PROTOTYPE := $(pkglibexecdir)/make-prototype
UPDATE-LOCALIZED-URLS := $(pkglibexecdir)/update-localized-urls
+ADD-FUZZY-DIFF := $(pkglibexecdir)/add-fuzzy-diff
PO4A-GETTEXTIZEFLAGS := -o porefs=none
PO4A-TRANSLATEFLAGS := --keep=0
@@ -410,7 +411,10 @@
# is nothing to merge.
define update-po
$(MSGMERGE) --update --previous $(1) $(2) && touch $(1) \
- && $(call update-po-status,$(1))
+ && ($(call update-po-status,$(1)) \
+ $(if $(and $(WDIFF), $(findstring $(subst .,,$(suffix $(basename $(1)))), \
+ $(FUZZY_DIFF_LINGUAS))), \
+ ; $(ADD-FUZZY-DIFF) --in-place $(1)))
endef
# The command to mail errors from make-prototype.
Index: Makefile.am
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/Makefile.am,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- Makefile.am 13 Nov 2011 11:19:02 -0000 1.23
+++ Makefile.am 25 Nov 2011 08:10:28 -0000 1.24
@@ -33,6 +33,11 @@
pkglibexec_SCRIPTS = expand-m4-includes update-localized-urls \
validate-html-notify
+if HAVE_WDIFF
+bin_SCRIPTS += gnun-add-fuzzy-diff
+pkglibexec_SCRIPTS += add-fuzzy-diff
+endif
+
if HAVE_GUILE
pkglibexec_SCRIPTS += make-prototype
endif
@@ -55,8 +60,8 @@
-e 's|@address@hidden|$(SED)|g' \
-e 's|@address@hidden|$(WDIFF)|g'
-expand-m4-includes gnun-validate-html update-localized-urls \
-validate-html-notify: Makefile
+add-fuzzy-diff expand-m4-includes gnun-add-fuzzy-diff gnun-validate-html \
+update-localized-urls validate-html-notify: Makefile
$(AM_V_at)rm -f $@ address@hidden
$(AM_V_GEN)$(edit) '$(srcdir)/address@hidden' >address@hidden
$(AM_V_at)chmod +x address@hidden
@@ -67,8 +72,10 @@
$(AM_V_at)mv $<.tmp $<
$(AM_V_at)touch $@
+add-fuzzy-diff: $(srcdir)/add-fuzzy-diff.in
expand-m4-includes: $(srcdir)/expand-m4-includes.in
gnun-validate-html: $(srcdir)/gnun-validate-html.in
+gnun-add-fuzzy-diff: $(srcdir)/gnun-add-fuzzy-diff.in
update-localized-urls: $(srcdir)/update-localized-urls.in
validate-html-notify: $(srcdir)/validate-html-notify.in
@@ -82,8 +89,10 @@
dist_sysconf_DATA = gnun.conf
dist_pkgdata_DATA = GNUmakefile
-EXTRA_DIST = expand-m4-includes.in gnun-validate-html.in \
- update-localized-urls.in validate-html-notify.in
-
-CLEANFILES = expand-m4-includes gnun-validate-html update-localized-urls \
- validate-html-notify stamp-config.mk
+EXTRA_DIST = add-fuzzy-diff.in expand-m4-includes.in gnun-add-fuzzy-diff.in \
+ gnun-validate-html.in update-localized-urls.in \
+ validate-html-notify.in
+
+CLEANFILES = add-fuzzy-diff expand-m4-includes gnun-add-fuzzy-diff \
+ gnun-validate-html update-localized-urls validate-html-notify \
+ stamp-config.mk
Index: NEWS
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/NEWS,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- NEWS 20 Nov 2011 11:41:13 -0000 1.38
+++ NEWS 25 Nov 2011 08:10:28 -0000 1.39
@@ -2,6 +2,10 @@
* Changes in GNUnited Nations 0.5 (201?-??-??)
+** New variable in gnun.mk: `FUZZY_DIFF_LINGUAS'. It defines
+ the languages whose PO files should be postprocessed to add
+ comments with wdiffs to previous msgids of fuzzy diffs.
+
** New variable in gnun.mk: `extra-templates'. It adds flexibility
to the set of templates.
Index: configure.ac
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/configure.ac,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- configure.ac 15 Nov 2011 16:28:49 -0000 1.27
+++ configure.ac 25 Nov 2011 08:10:28 -0000 1.28
@@ -120,6 +120,7 @@
AC_ARG_VAR([WDIFF], [the `wdiff' program])
AC_PATH_PROG([WDIFF], [wdiff])
+AM_CONDITIONAL([HAVE_WDIFF], [test -n "$WDIFF"])
# Po4a is useless for our purpose if Guile is missing.
if test "$have_guile" = yes; then
Index: gnun.mk
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/gnun.mk,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- gnun.mk 30 Sep 2011 11:27:56 -0000 1.35
+++ gnun.mk 25 Nov 2011 08:10:28 -0000 1.36
@@ -24,6 +24,11 @@
# language code.
HOME_LINGUAS := ar bg ca de el es fa fr id it ja nb nl pl pt-br ro ru sq \
sr tr uk zh-cn
+
+# TRANSLATORS: Add here your language code if you want PO files with wdiffs
+# to previous msgids.
+FUZZY_DIFF_LINGUAS :=
+
### The variables below are edited by GNUN maintainers. ###
# List of articles for which GRACE do not apply; i.e. they are
Index: doc/gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/gnun.texi,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- doc/gnun.texi 20 Nov 2011 11:41:14 -0000 1.29
+++ doc/gnun.texi 25 Nov 2011 08:10:28 -0000 1.30
@@ -337,13 +337,6 @@
@itemize
@item
-Often it is hard to figure out where precisely a change was made. A
-change in one single word in a long paragraph of the HTML article will
-lead to the whole of it being marked as ``fuzzy'' in the PO files. So
-don't unsubscribe from @email{www-commits@@gnu.org} yet, and be
-prepared to check the CVS history of the original article.
-
address@hidden
The official build is invoked thrice address@hidden ``no-grace''
items are rebuilt hourly.}, because doing it more often
will potentially generate more messages to the mailing list in the form
@@ -839,6 +832,12 @@
Additional templates are defined via the @var{extra-templates} variable
in @file{server/gnun/gnun.mk}.
address@hidden FUZZY_DIFF_LINGUAS
address@hidden previous, diff
address@hidden FUZZY_DIFF_LINGUAS
+Add your language code if you want GNUN to add differences to previous
+msgids in your PO files.
+
@cindex HOME_LINGUAS
@cindex homepage, defining
@cindex defining homepage
@@ -1735,13 +1734,6 @@
@section Tips and Hints for Webmasters
@cindex tips, webmasters
@cindex webmaster tips
address@hidden
-* Validation:: How to verify the documents.
-* Comments for Translators:: Passing commens to translators.
-* Modifying Boilerplates::
-* Localized URLs:: Specifying URLs of diagrams
- to be transated.
address@hidden menu
This section contains some tips and general recommendations for
webmasters in no particular order---it is not mandatory to follow them,
@@ -1758,6 +1750,14 @@
update it immediately won't be disappointed if it changes again in the
next run.
address@hidden
+* Validation:: How to verify the documents.
+* Comments for Translators:: Passing commens to translators.
+* Modifying Boilerplates::
+* Localized URLs:: Specifying URLs of diagrams
+ to be transated.
address@hidden menu
+
@node Validation
@subsection Validation
@@ -1868,6 +1868,7 @@
@menu
* make-prototype::
+* gnun-add-fuzzy-diff::
* gnun-validate-html::
* mailfail::
* validate-html-notify::
@@ -1935,6 +1936,32 @@
Print usage information on stdout.
@end table
address@hidden gnun-add-fuzzy-diff
address@hidden The @command{gnun-add-fuzzy-diff} Script
address@hidden previous, diff
+
+This script adds comments with differences of current msgids 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.
+
address@hidden
+gnun-add-fuzzy-diff [OPTION...] [FILE]
address@hidden example
+
address@hidden @option
address@hidden -i
address@hidden --in-place
+Edit the file in place.
+
address@hidden --version
+Display copyright and version information and exit.
+
address@hidden --help
+Display usage information and exit
address@hidden table
+
@node gnun-validate-html
@subsection The @command{gnun-validate-html} Script
@cindex validation, XHTML
Index: add-fuzzy-diff
===================================================================
RCS file: add-fuzzy-diff
diff -N add-fuzzy-diff
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ add-fuzzy-diff 25 Nov 2011 08:10:28 -0000 1.1
@@ -0,0 +1,103 @@
+#! /bin/sed -nf
+
+# Copyright (C) 2011 Free Software Foundation, Inc.
+
+# This file is part of GNUnited Nations.
+
+# GNUnited Nations is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+
+# GNUnited Nations is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNUnited Nations. If not, see <http://www.gnu.org/licenses/>.
+
+# Prepend fuzzy translations with wdiff from the previous msgid
+# to current msgid. The difference is put in comment lines beginning
+# with `# | '; if such comments are present in the PO file, they are
+# removed by the script.
+
+# Remove old difference.
+/^# |[| ]/d;
+# Add new difference.
+/^#, fuzzy\>/{
+# Read previous and current msgids.
+ N; /\n#| msgid "/! b obsolete;
+ :read-previous;
+ N; /\n#| [^\n]*$/ b read-previous;
+ /\nmsgid "[^\n]*$/! b obsolete;
+ :read-current;
+ N; /\nmsgstr "/ b create-file;
+ /\n"[^\n]*$/b read-current; b obsolete;
+# Create a temporary file. Its name shall be kept in the last line
+# of both pattern and hold space.
+ :create-file;
+# It seems to be considerably faster to create a new file than
+# to rewrite an existing one on fencepost (?)
+ x; s%.*%mktemp addiff.XXXXXXXXXXXXX%e;
+ H; g;
+# Cut out the lines with current msgid.
+ s/\nmsgid ".*\(\n[^\n]*\)$/\1/;
+# Extract previous msgid.
+ s/^#, fuzzy\>[^\n]*\n//; s/^#| msgid "\([^\n]*\)"[^\n]*\n/\1\n/;
+ s/\nmsgid [^\n]*\n/\n/;
+ s/\(" *\)\?\n#| "//g;
+ s/" *\n/\n/; s/^\n*//;
+# Escape single quotes to workaround command line.
+ s/'/'"'"'/g;
+# Escape `\n's to workaround wdiff.
+ s/\\n/\\\\n/g;
+# Output previous msgid to temporary file.
+ s%^\(.*\)\n%echo '\1' > %e;
+# Extract current msgid.
+ g; s/\nmsgstr ".*\n/\n/; s/^.*\nmsgid "\([^\n]*\)"/\1/;
+ s/\(" *\)\?\n"//g; s/" *\n/\n/; s/^\n*//; s/'/'"'"'/g; s/\\n/\\\\n/g;
+# Invoke diff program and remove the temporary file.
+ s%\(.*\)\n\([^\n]*\)$%echo '\1' | wdiff \2 -; rm \2%e;
+ s/\n//g; t rm-duplicates;
+# A little bit of postprocessing.
+ :rm-duplicates; s/\[-\(.*\)-\] *{+\1+}/\1/; t rm-duplicates;
+ :merge-tails;
+ s/\[-\(.\)\?\(.\+\)-\] *{+\(.\)\?\2+}/\[-\1-\]{+\3+}\2/;
+ t merge-tails;
+ :merge-heads;
+ s/\[-\(.\+\)\(.\)\?-\] *{+\1\(.\)\?+}/\1\[-\2-\]{+\3+}/;
+ t merge-heads;
+ :merge-wings;
+ s/\[-\(.\+\)\(.\)\?\(.\+\)-\] *{+\1\(.\)\?\3+}/\1\[-\2-\]{+\4+}\3/;
+ t merge-wings;
+ s/\[--\]//g; s/{++}//g;
+ /{+.*+}/ b format; /\[-.*-\]/ b format;
+ s/.*/# || No change detected. The change might only be in amounts of
spaces./
+ b output-diff;
+ :format;
+# fmt -w 75 the result.
+# Remove possible long word beginning the string
+ s/^\([^ ]\{75,\}\) \(.*\)$/\1\n\2/;
+ :fmt;
+# Long word; leave on the line.
+ s/\(\n[^\n ]\{75,\}\) \([^\n]*\)$/\1\n\2/; t fmt;
+# There is a space: split the line.
+ s/\([^\n]\{75\}\)\([^\n]\+\)$/\1\n\2/; t proceed;
+# No more characters.
+ b fmt-done;
+ :proceed;
+# Move the newline to the last space in the line.
+ s/ \([^\n ]*\)\n\([^\n]*\)$/\n\1\2/; b fmt;
+ :fmt-done;
+# Prepend every line with `# | '.
+ s/\(^\|\n\)/\1# | /g;
+ :output-diff; p;
+# Pass original content to output.
+ g; s/\n\([^\n]*\)$//
+ :obsolete
+# We've got something different, e.g. obsolete msg or no previous msgid;
+# just pass what we have.
+}
+# Otherwise, just print the input.
+p
Index: gnun-add-fuzzy-diff.in
===================================================================
RCS file: gnun-add-fuzzy-diff.in
diff -N gnun-add-fuzzy-diff.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnun-add-fuzzy-diff.in 25 Nov 2011 08:10:28 -0000 1.1
@@ -0,0 +1,84 @@
+#! /bin/bash
+
+# Copyright (C) 2011 Free Software Foundation, Inc.
+
+# This file is part of GNUnited Nations.
+
+# GNUnited Nations is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+
+# GNUnited Nations is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNUnited Nations. If not, see <http://www.gnu.org/licenses/>.
+
+# Wraps around add-fuzzy-diff to provide a command line interface compliant
+# with GNU Coding Standards
+
+function version () {
+cat <<EOF
+gnun-add-fuzzy-diff (@PACKAGE_NAME@) @PACKAGE_VERSION@
+Copyright (C) 2011 Free Software Foundation, Inc.
+You may redistribute copies of @PACKAGE_NAME@
+under the terms of the GNU General Public License.
+For more information about these matters, see the file named COPYING.
+EOF
+}
+
+function usage () {
+cat <<EOF
+Usage: gnun-add-fuzzy-diff [OPTION...] [FILE]
+Add comments with differences to previous msgids to fuzzy translations
+in a PO file.
+
+Options:
+ -i[SUFFIX], --in-place[=SUFFIX]
+ Edit files in place (makes backup if extension supplied)
+ --version Display version info and exit
+ --help Display this help and exit
+
+Report bugs to @PACKAGE_BUGREPORT@
address@hidden@ home page: <@PACKAGE_URL@>
+General help using GNU software: <http://www.gnu.org/gethelp/>
+EOF
+}
+
+params=$#
+in_place=
+
+while [ ${params} -gt 1 ]; do
+ case "$1" in
+ --help )
+ usage
+ exit 0
+ ;;
+ --version )
+ version
+ exit 0
+ ;;
+ -i* | --in-place=* | --in-place )
+ shift
+ params=$((${params}-1))
+ in_place="$1"
+ ;;
+ * )
+ break
+ ;;
+ esac
+ params=$((${params}-1))
+ shift
+done
+
+if [ ${params} -gt 1 ]; then
+ echo 1>&2 Error: Multiple FILE arguments are not allowed. See --help for
details.
+ exit 1
+fi
+
address@hidden@/add-fuzzy-diff ${in_place} $1
+
+exit $?