trans-coord-devel
[Top][All Lists]
Advanced

[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: Mon, 19 Nov 2012 15:14:29 +0000

CVSROOT:        /sources/trans-coord
Module name:    trans-coord
Changes by:     Pavel Kharitonov <ineiev>       12/11/19 15:14:29

Modified files:
        gnun/server/gnun: AUTHORS ChangeLog Makefile.am NEWS 
                          configure.ac gnun-merge-preconverted.in 
        gnun/server/gnun/doc: gnun.texi 
Added files:
        gnun/server/gnun: gnun-diff-po.in po-msg-diff.in 

Log message:
        Add `gnun-diff-po'.  Minor gettext-related cleanup
        of configuration procedures.
        
        * doc/gnun.texi (gnun-diff-po): New node.
        * gnun-diff-po.in: New file.
        * configure.ac: Add checks for msgexec.  Fix logic
        for `gnun-preconvert'.
        (decent_gettext): Make the variable depend on MSGCAT, MSGEXEC,
        MSGFMT and MSGMERGE.
        (HAVE_GETTEXT): New conditional.
        * Makefile.am (gnun-diff-po, po-msg-diff): New targets.
        (bin_SCRIPTS): Cleanup installation logic.  Add gnun-diff-po.
        (pkglibexec_SCRIPTS): Add `po-msg-diff'.
        (edit): Add substitutions for MSGATTRIB, MSGCAT, MSGEXEC.
        (EXTRA_DIST): Add `gnun-diff-po.in', `po-msg-diff.in'.
        (CLEANFILES): Add `gnun-diff-po', `po-msg-diff'.
        * gnun-merge-preconverted.in: Use MSGMERGE variable.
        * AUTHORS:
        * NEWS: Update.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/AUTHORS?cvsroot=trans-coord&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.302&r2=1.303
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/Makefile.am?cvsroot=trans-coord&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/NEWS?cvsroot=trans-coord&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/configure.ac?cvsroot=trans-coord&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun-merge-preconverted.in?cvsroot=trans-coord&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun-diff-po.in?cvsroot=trans-coord&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/po-msg-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.64&r2=1.65

Patches:
Index: AUTHORS
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/AUTHORS,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- AUTHORS     19 Nov 2012 04:44:17 -0000      1.13
+++ AUTHORS     19 Nov 2012 15:14:10 -0000      1.14
@@ -9,13 +9,14 @@
         diff-page-tail.html, dtd/html5.dtd (based on W3C DTD),
         expand-m4-includes.in, expand-ssi.awk,
         languages.txt (compiled from www.gnu.org pages),
-        gnun-add-fuzzy-diff, gnun-report.in, make-prototype.awk,
-        priorities.mk,
+        gnun-add-fuzzy-diff, gnun-diff-po.in,
+        gnun-init-po.in, gnun-report.in, make-prototype.awk,
+        po-msg-diff.in, priorities.mk,
         translinks-head.html, translinks-tail.html,
         update-localized-urls.in.
 
     Some changes in configure.ac, GNUmakefile, GNUmakefile.team,
-        gnun-validate-html, validate-html-notify.in,
+        gnun-validate-html.in, validate-html-notify.in,
         Makefile.am, README, dtd/README, doc/gnun.texi,
         doc/web-trans.texi.
 

Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.302
retrieving revision 1.303
diff -u -b -r1.302 -r1.303
--- ChangeLog   19 Nov 2012 04:44:17 -0000      1.302
+++ ChangeLog   19 Nov 2012 15:14:25 -0000      1.303
@@ -1,5 +1,27 @@
 2012-11-19  Pavel Kharitonov  <address@hidden>
 
+       Add `gnun-diff-po'.  Minor gettext-related cleanup
+       of configuration procedures.
+
+       * doc/gnun.texi (gnun-diff-po): New node.
+       * gnun-diff-po.in: New file.
+       * configure.ac: Add checks for msgexec.  Fix logic
+       for `gnun-preconvert'.
+       (decent_gettext): Make the variable depend on MSGCAT, MSGEXEC,
+       MSGFMT and MSGMERGE.
+       (HAVE_GETTEXT): New conditional.
+       * Makefile.am (gnun-diff-po, po-msg-diff): New targets.
+       (bin_SCRIPTS): Cleanup installation logic.  Add gnun-diff-po.
+       (pkglibexec_SCRIPTS): Add `po-msg-diff'.
+       (edit): Add substitutions for MSGATTRIB, MSGCAT, MSGEXEC.
+       (EXTRA_DIST): Add `gnun-diff-po.in', `po-msg-diff.in'.
+       (CLEANFILES): Add `gnun-diff-po', `po-msg-diff'.
+       * gnun-merge-preconverted.in: Use MSGMERGE variable.
+       * AUTHORS:
+       * NEWS: Update.
+
+2012-11-19  Pavel Kharitonov  <address@hidden>
+
        * validate-html-notify.in: Don't use --verbose mode of
        `gnun-validate-html' when invoked with --dry-run.
        * THANKS: Add Tiberiu C. Turbureanu.

Index: Makefile.am
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/Makefile.am,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- Makefile.am 15 Nov 2012 06:28:44 -0000      1.33
+++ Makefile.am 19 Nov 2012 15:14:25 -0000      1.34
@@ -19,7 +19,14 @@
 
 SUBDIRS = doc dtd
 
-bin_SCRIPTS = gnun-report
+bin_SCRIPTS =
+
+if HAVE_GETTEXT
+bin_SCRIPTS += gnun-report gnun-init-po
+if HAVE_PO4A
+bin_SCRIPTS += gnun-preconvert gnun-merge-preconverted
+endif
+endif
 
 if HAVE_VALIDATION
 bin_SCRIPTS += gnun-validate-html
@@ -27,9 +34,6 @@
 
 if NEW_MSGATTRIB
 bin_SCRIPTS += gnun-clear-previous
-if HAVE_PO4A
-bin_SCRIPTS += gnun-init-po gnun-preconvert gnun-merge-preconverted
-endif
 endif
 
 noinst_SCRIPTS = stamp-config.mk
@@ -39,6 +43,10 @@
 if HAVE_WDIFF
 bin_SCRIPTS += gnun-add-fuzzy-diff
 pkglibexec_SCRIPTS += add-fuzzy-diff
+if HAVE_GETTEXT
+bin_SCRIPTS += gnun-diff-po
+pkglibexec_SCRIPTS += po-msg-diff
+endif
 endif
 
 dist_pkglibexec_SCRIPTS = expand-ssi.awk mailfail make-prototype.awk
@@ -56,14 +64,18 @@
        -e 's|@address@hidden|$(AWK)|g' \
        -e 's|@address@hidden|$(GREP)|g' \
        -e 's|@address@hidden|$(pkglibexecdir)/expand-m4-includes|g' \
+       -e 's|@address@hidden|$(MSGATTRIB)|g' \
+       -e 's|@address@hidden|$(MSGCAT)|g' \
+       -e 's|@address@hidden|$(MSGEXEC)|g' \
        -e 's|@address@hidden|$(MSGFMT)|g' \
        -e 's|@address@hidden|$(MSGMERGE)|g' \
        -e 's|@address@hidden|$(SED)|g' \
        -e 's|@address@hidden|$(WDIFF)|g'
 
 add-fuzzy-diff copy-msgid expand-m4-includes gnun-add-fuzzy-diff \
-gnun-init-po gnun-merge-preconverted gnun-report \
-gnun-validate-html update-localized-urls validate-html-notify: Makefile
+gnun-diff-po gnun-init-po gnun-merge-preconverted gnun-report \
+gnun-validate-html po-msg-diff 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
@@ -78,10 +90,12 @@
 copy-msgid: $(srcdir)/copy-msgid.in
 expand-m4-includes: $(srcdir)/expand-m4-includes.in
 gnun-add-fuzzy-diff: $(srcdir)/gnun-add-fuzzy-diff.in
+gnun-diff-po: $(srcdir)/gnun-diff-po.in
 gnun-init-po: $(srcdir)/gnun-init-po.in
 gnun-merge-preconverted: $(srcdir)/gnun-merge-preconverted.in
 gnun-report: $(srcdir)/gnun-report.in
 gnun-validate-html: $(srcdir)/gnun-validate-html.in
+po-msg-diff: $(srcdir)/po-msg-diff.in
 update-localized-urls: $(srcdir)/update-localized-urls.in
 validate-html-notify: $(srcdir)/validate-html-notify.in
 
@@ -97,11 +111,14 @@
 dist_pkgdata_DATA = GNUmakefile
 
 EXTRA_DIST = add-fuzzy-diff.in copy-msgid.in expand-m4-includes.in \
-            gnun-add-fuzzy-diff.in gnun-init-po.in gnun-merge-preconverted.in \
-            gnun-report.in gnun-validate-html.in update-localized-urls.in \
+            gnun-add-fuzzy-diff.in gnun-diff-po.in \
+            gnun-init-po.in gnun-merge-preconverted.in \
+            gnun-report.in gnun-validate-html.in \
+            po-msg-diff.in update-localized-urls.in \
             validate-html-notify.in
 
 CLEANFILES = add-fuzzy-diff copy-msgid expand-m4-includes gnun-add-fuzzy-diff \
-            gnun-init-po gnun-merge-preconverted gnun-report \
-            gnun-validate-html update-localized-urls validate-html-notify \
+            gnun-diff-po gnun-init-po gnun-merge-preconverted gnun-report \
+            gnun-validate-html po-msg-diff \
+            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.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- NEWS        15 Nov 2012 06:28:44 -0000      1.68
+++ NEWS        19 Nov 2012 15:14:26 -0000      1.69
@@ -2,8 +2,17 @@
 
 * Changes in GNUnited Nations 0.7 (????-??-??)
 
-** New script, `gnun-report', to generate reports in HTML format.
-   For more details, see the manual ('(gnun)gnun-report)').
+** New scripts:
+
+*** `gnun-diff-po'
+    Generates differences between revisions of a PO file
+    in HTML format.  For more details, see the manual
+    ('(gnun)gnun-diff-po)').
+
+*** `gnun-report'
+    Generates per-team reports about status of translations
+    in HTML format.  For more details, see the manual
+    ('(gnun)gnun-report)').
 
 ** GNUN doesn't depend on Guile any more.
 
@@ -31,7 +40,7 @@
 ***  The `report' target didn't take into account the subdirectories of
      `important' directories.
 
-***  The `validate-all' targed didn't validate the home pages.
+***  The `validate-all' target didn't validate the home pages.
 
 ***  When deciding whether the translation is up-to-date, it was not
      taken into account that the name of the article may include

Index: configure.ac
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/configure.ac,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- configure.ac        4 Oct 2012 14:43:17 -0000       1.38
+++ configure.ac        19 Nov 2012 15:14:26 -0000      1.39
@@ -100,10 +100,12 @@
 AC_ARG_VAR([EGREP], [the `egrep' program])
 AC_PROG_EGREP
 
-AC_ARG_VAR([MSGFMT], [the `msgfmt' program])
-AC_CHECK_PROGS([MSGFMT], [msgfmt gmsgfmt])
 AC_ARG_VAR([MSGCAT], [the `msgcat' program])
 AC_CHECK_PROGS([MSGCAT], [msgcat gmsgcat])
+AC_ARG_VAR([MSGFMT], [the `msgfmt' program])
+AC_CHECK_PROGS([MSGFMT], [msgfmt gmsgfmt])
+AC_ARG_VAR([MSGEXEC], [the `msgexec' program])
+AC_CHECK_PROGS([MSGEXEC], [msgexec gmsgexec])
 AC_ARG_VAR([MSGMERGE], [the `msgmerge' program])
 AC_CACHE_CHECK([for msgmerge that supports --previous],
                [ac_cv_path_MSGMERGE],
@@ -112,7 +114,10 @@
       && ac_cv_path_MSGMERGE=$ac_path_MSGMERGE]],
       [AC_MSG_WARN([none found -- consider updating gettext])])])
 AC_SUBST([MSGMERGE], [$ac_cv_path_MSGMERGE])
-AS_IF([test -n "$MSGMERGE"], [decent_gettext=yes], [decent_gettext=no])
+AS_IF([test -n "$MSGCAT" && test -n "$MSGEXEC" \
+       && test -n "$MSGFMT" && test -n  "$MSGMERGE"],
+      [decent_gettext=yes], [decent_gettext=no])
+AM_CONDITIONAL([HAVE_GETTEXT], [test "$decent_gettext" = yes])
 
 # Presumably if msgmerge supports --previous, msgattrib supports
 # --clear-previous as well, but it's safer to check anyway.
@@ -217,9 +222,10 @@
 AC_CONFIG_FILES([Makefile doc/Makefile dtd/Makefile config.mk])
 AS_IF([test "$decent_msgattrib" = yes],
       [AC_CONFIG_FILES([gnun-clear-previous], [chmod +x gnun-clear-previous])
-       AS_CASE(["$gnun_cv_recent_po4a"], [yes],
-              [AC_CONFIG_FILES([gnun-preconvert])])
       ])
+AS_CASE(["$decent_gettext-$gnun_cv_recent_po4a"], [yes-yes],
+        [AC_CONFIG_FILES([gnun-preconvert])])
+
 AC_OUTPUT
 
 cat <<EOF

Index: gnun-merge-preconverted.in
===================================================================
RCS file: 
/sources/trans-coord/trans-coord/gnun/server/gnun/gnun-merge-preconverted.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gnun-merge-preconverted.in  4 Jun 2012 14:16:10 -0000       1.2
+++ gnun-merge-preconverted.in  19 Nov 2012 15:14:26 -0000      1.3
@@ -80,5 +80,5 @@
 fi
 
 @pkglibexecdir@/copy-msgid -i ${1}
-msgmerge --previous -C ${1} ${compendia} -o ${1} /dev/null ${2}
address@hidden@ --previous -C ${1} ${compendia} -o ${1} /dev/null ${2}
 @pkglibexecdir@/add-fuzzy-diff -i ${1}

Index: doc/gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/gnun.texi,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- doc/gnun.texi       19 Nov 2012 04:44:17 -0000      1.64
+++ doc/gnun.texi       19 Nov 2012 15:14:28 -0000      1.65
@@ -2060,6 +2060,7 @@
 @menu
 * 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.
 * gnun-preconvert::          Invoke the first step in converting
                                HTML translation to PO format.
@@ -2097,6 +2098,46 @@
 Display usage information and exit.
 @end table
 
address@hidden gnun-diff-po
address@hidden The @command{gnun-diff-po} Script
address@hidden comparing, translations
+
+This script compares two versions of a PO file.  It produces a HTML page
+with a table that contains original strings with highlighted differences
+of their translations.
+
+If the sets of original strings in the input PO files differ, one of
+them will be merged with the other in order to eliminate the differences
+in the original strings.
+
+The results are written to standard output.  Example:
+
address@hidden
+gnun-diff-po [OPTION...] PO_FILE1 PO_FILE2 > diff.html
address@hidden example
+
address@hidden @option
address@hidden -1
address@hidden --merge-against-first
+Adjust the original strings of PO_FILE2 against PO_FILE1 when their
+sets differ.  This is the default.
+
address@hidden -2
address@hidden --merge-against-second
+Adjust the original strings of PO_FILE1 against PO_FILE2 when their
+sets differ.
+
address@hidden -t
address@hidden address@hidden
+Specify the title of the output HTML page.
+
address@hidden --version
+Display copyright and version information and exit.
+
address@hidden --help
+Display usage information and exit.
address@hidden table
+
 @node gnun-init-po
 @subsection The @command{gnun-init-po} Script
 @cindex initializing, translations

Index: gnun-diff-po.in
===================================================================
RCS file: gnun-diff-po.in
diff -N gnun-diff-po.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gnun-diff-po.in     19 Nov 2012 15:14:26 -0000      1.1
@@ -0,0 +1,177 @@
+#! /bin/bash
+
+# Copyright (C) 2012 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/>.
+
+function version () {
+cat <<EOF
+gnun-diff-po (@PACKAGE_NAME@) @PACKAGE_VERSION@
+Copyright (C) 2012 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-diff-po OPTION... PO_FILE1 PO_FILE2
+Generate HTML page with highlighted differences in translations
+from PO_FILE2 against translations from PO_FILE1.
+
+Options:
+  -1, --merge-against-first  Adjust the original strings of PO_FILE2
+                               against PO_FILE1 when their sets differ
+  -2, --merge-against-second Adjust the original strings of PO_FILE1
+                               against PO_FILE2 when their sets differ
+      --title=TITLE          Specify the title for the HTML page
+      --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
+}
+
+function check-po-file () {
+  if ! @MSGFMT@ -o /dev/null -c $1; then
+    echo 1>&2 "Error: File \`$1' contains errors."
+    exit 1
+  fi
+}
+
+title=""
+merge_against_second=""
+
+while [ $# -ge 1 ]; do
+  case "$1" in
+      --help )
+         usage
+         exit 0
+         ;;
+      --version )
+         version
+         exit 0
+         ;;
+      -1 | --merge-against-first )
+         merge_against_second=""
+         ;;
+      -2 | --merge-against-second )
+         merge_against_second=yes
+         ;;
+      -t | --title )
+         shift
+         title="$1"
+         ;;
+      --title=* )
+         title="${1#--title=}"
+         ;;
+      * )
+         break
+         ;;
+  esac
+  shift
+done
+
+case $# in
+  2 ) ;;
+  * )
+    echo 1>&2 \
+      "Error: Exactly two FILE arguments are required.  See --help for 
details."
+    exit 1
+    ;;
+esac
+
+check-po-file $1
+check-po-file $2
+
+title=${title:-$1 vs. $2}
+from_file="$1"
+to_file="$2"
+
+# File to count msgid number, since msgexec doesn't provide
+# a variable for it, and for POT when merging is needed.
+temp=`mktemp gnun-diff-po.XXXXXXXXXX`
+# We could create these files in po-msg-diff, but 
+# then mktemp and rm would run for every compared msgstr pair.
+temp1=`mktemp gnun-diff-po1.XXXXXXXXXX`
+temp2=`mktemp gnun-diff-po2.XXXXXXXXXX`
+# File for the merged PO (when needed).
+temp3=`mktemp gnun-diff-po3.XXXXXXXXXX`
+trap 'rm -f "$temp" "$temp1" "$temp2" "$temp3"' EXIT
+
+cat <<EOF
+<html> <!-- Generated by $0. -->
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>$title (`date`)</title>
+<style>
+  span.removed { background-color: #faa; color: #000 }
+  span.inserted { background-color: #afa; color: #000 }
+  td.modified { background-color: #aff; color: #000 }
+  td.msgid { background-color: #ddd; color: #000 }
+</style>
+</head>
+<body>
+<h2>$title</h2>
+EOF
+
+if @MSGCAT@ --less-than=2 "$1" "$2" | @GREP@ -q .; then
+  case "x$merge_against_second" in
+    x ) merge_from="$2"; merge_to="$1"; to_file="$temp3" ;;
+    * ) merge_from="$1"; merge_to="$2"; from_file="$temp3" ;;
+  esac
+  # Strip translations from merge_from because we don't want to use
+  # the translations from merge_to; in other words, regenerate POT.
+  @SED@ \
+'# Pass the header (msgid="") untouched.
+/^msgid ""[[:space:]]*$/{
+  N; /msgid ""[[:space:]]*\nmsgstr /{:pass; N; /\n$/!b pass; p; d; }
+}
+# Replace all other translations with empty strings.
+/^msgstr /{ s/.*/msgstr ""/; p; :egin; s/.*//; N; /^\n$/!begin; s/.// }' \
+     "$merge_to" > $temp
+  if @MSGMERGE@ -q "$merge_from" "$temp" \
+      | @MSGATTRIB@ --clear-fuzzy > "$temp3" ; then
+    cat <<EOF
+<p><em>Note:</em> the files have been merged in order to compare them (their
+set of original strings didn't coincide).</p>
+EOF
+  else
+    cat <<EOF
+<p><strong>ERROR:</strong> couldn't merge PO files.</p>
+</body>
+</html>
+EOF
+    # We managed to generate a hopefully valid HTML, so exit successfully.
+    exit 0
+  fi
+fi
+
+echo 0 > "$temp"
+
+echo "<table border=\"1\">"
+
address@hidden@ "$from_file" "$to_file" \
+  | @MSGEXEC@ @pkglibexecdir@/po-msg-diff "$temp" "$temp1" "$temp2"
+
+cat <<EOF
+</table>
+</body>
+</html>
+EOF

Index: po-msg-diff.in
===================================================================
RCS file: po-msg-diff.in
diff -N po-msg-diff.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ po-msg-diff.in      19 Nov 2012 15:14:27 -0000      1.1
@@ -0,0 +1,77 @@
+#! /bin/bash
+
+# Copyright (C) 2012 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/>.
+
+# Output a part of a HTML table with highlighted difference
+# of translations of a single message based on msgcat `merging'
+# feature.  To be invoked from a separate script (gnun-diff-po) via msgexec.
+
+# $1 is the filename where incremented index of messages is kept.
+# $2 and $3 are names for temporary files.
+
+function escape-chars () {
+  @SED@ 's/&/\&amp;/g; s/>/\&gt;/g; s/</\&lt;/g'
+}
+
+i=`cat $1`
+
address@hidden@ \
+'1{/^#-#-#-#-# .* #-#-#-#-#$/d; :egin; n; begin; }
+2,/^#-#-#-#-# .* #-#-#-#-#$/{ H; d; }
+x; s/^\n//;  s/\n[^\n]*$//;w '$2'
+x;
+:read-second; n; b read-second;
+' | escape-chars > $3
+
+if test -s $2; then
+  begin="<td rowspan=\"2\" class=\"modified\"><strong>"
+  end="</strong></td>"
+  modified=yes
+else
+  begin="<td rowspan=\"2\">"
+  end="</td>"
+  modified=no
+fi
+
+case "x$MSGEXEC_MSGID" in
+  x ) msgid='&nbsp;' ;;
+  * ) msgid=`echo $MSGEXEC_MSGID | escape-chars` ;;
+esac
+
+cat <<EOF
+<tr>$begin $i $end
+<td class="msgid"><code>
+$msgid
+</code></td></tr>
+<tr><td>
+EOF
+
+case $modified in
+  no ) cat $3 ;;
+  * )
+    cat $2 | escape-chars | @WDIFF@ \
+      --start-delete "<span class=\"removed\"><del><strong>" \
+      --end-delete "</strong></del></span>" \
+      --start-insert "<span class=\"inserted\"><ins><em>" \
+      --end-insert "</em></ins></span>" - $3 
+    ;;
+esac | @SED@ '$! s,.*,&<br />,'
+
+echo "</td></tr>"
+
+echo $(($i + 1)) > $1



reply via email to

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