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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trans-coord/gnun/server/gnun ChangeLog Makefile...


From: Pavel Kharitonov
Subject: trans-coord/gnun/server/gnun ChangeLog Makefile...
Date: Fri, 01 Jun 2012 09:44:27 +0000

CVSROOT:        /sources/trans-coord
Module name:    trans-coord
Changes by:     Pavel Kharitonov <ineiev>       12/06/01 09:44:27

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

Log message:
        Add scripts for semi-automatic migration.
        Minor update of `Notes Slot' documentation.
        
        * gnun-merge-preconverted.in:
        * gnun-preconvert.in: New files.
        * configure.ac: Instantiate gnun-preconvert.
        (HAVE_PO4A): New conditional.
        * Makefile.am (bin_SCRIPTS, CLEAN_FILES):
        Add `gnun-merge-preconverted' and `gnun-preconvert'.
        (CLEAN_FILES): Add `gnun-merge-preconverted'.
        (EXTRA_DIST): Add `gnun-merge-preconverted.in'.
        * doc/gnun.texi (gnun-merge-preconverted, gnun-preconvert):
        New nodes.
        (Migrating): Explain semi-automatic way of migration.
        (Notes Slot): Update (pages with an empty `msgstr' won't be
        posted in the first place).
        * NEWS: Update.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.271&r2=1.272
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/Makefile.am?cvsroot=trans-coord&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/NEWS?cvsroot=trans-coord&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/configure.ac?cvsroot=trans-coord&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun-merge-preconverted.in?cvsroot=trans-coord&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun-preconvert.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.52&r2=1.53

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -b -r1.271 -r1.272
--- ChangeLog   1 Jun 2012 04:21:48 -0000       1.271
+++ ChangeLog   1 Jun 2012 09:44:26 -0000       1.272
@@ -1,5 +1,25 @@
 2012-06-01  Pavel Kharitonov  <address@hidden>
 
+       Add scripts for semi-automatic migration.
+       Minor update of `Notes Slot' documentation.
+
+       * gnun-merge-preconverted.in:
+       * gnun-preconvert.in: New files.
+       * configure.ac: Instantiate gnun-preconvert.
+       (HAVE_PO4A): New conditional.
+       * Makefile.am (bin_SCRIPTS, CLEAN_FILES):
+       Add `gnun-merge-preconverted' and `gnun-preconvert'.
+       (CLEAN_FILES): Add `gnun-merge-preconverted'.
+       (EXTRA_DIST): Add `gnun-merge-preconverted.in'.
+       * doc/gnun.texi (gnun-merge-preconverted, gnun-preconvert):
+       New nodes.
+       (Migrating): Explain semi-automatic way of migration.
+       (Notes Slot): Update (pages with an empty `msgstr' won't be
+       posted in the first place).
+       * NEWS: Update.
+
+2012-06-01  Pavel Kharitonov  <address@hidden>
+
        * doc/web-trans.texi (Distribution Terms): Use Dutch translation
        instead of German one (it uses a word to avoid); mention that
        when CC's translation is not acceptable the translators should

Index: Makefile.am
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/Makefile.am,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- Makefile.am 31 May 2012 04:44:42 -0000      1.29
+++ Makefile.am 1 Jun 2012 09:44:26 -0000       1.30
@@ -27,6 +27,9 @@
 
 if NEW_MSGATTRIB
 bin_SCRIPTS += gnun-clear-previous
+if HAVE_PO4A
+bin_SCRIPTS += gnun-preconvert gnun-merge-preconverted
+endif
 endif
 
 noinst_SCRIPTS = stamp-config.mk
@@ -61,6 +64,7 @@
        -e 's|@address@hidden|$(WDIFF)|g'
 
 add-fuzzy-diff copy-msgid expand-m4-includes gnun-add-fuzzy-diff \
+gnun-merge-preconverted \
 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
@@ -77,6 +81,7 @@
 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
+gnun-merge-preconverted: $(srcdir)/gnun-merge-preconverted.in
 update-localized-urls: $(srcdir)/update-localized-urls.in
 validate-html-notify: $(srcdir)/validate-html-notify.in
 
@@ -91,10 +96,12 @@
 dist_sysconf_DATA = gnun.conf
 dist_pkgdata_DATA = GNUmakefile
 
-EXTRA_DIST = add-fuzzy-diff.in copy-msgid.in expand-m4-includes.in 
gnun-add-fuzzy-diff.in \
+EXTRA_DIST = add-fuzzy-diff.in copy-msgid.in expand-m4-includes.in \
+            gnun-add-fuzzy-diff.in gnun-merge-preconverted.in \
             gnun-validate-html.in update-localized-urls.in \
             validate-html-notify.in
 
 CLEANFILES = add-fuzzy-diff copy-msgid expand-m4-includes gnun-add-fuzzy-diff \
+            gnun-merge-preconverted \
             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.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- NEWS        31 May 2012 04:44:42 -0000      1.54
+++ NEWS        1 Jun 2012 09:44:27 -0000       1.55
@@ -2,6 +2,9 @@
 
 * Changes in GNUnited Nations 0.6 (????-??-??)
 
+** New scripts to facilitate migration to PO format: `gnun-preconvert' and
+   `gnun-merge-preconverted'.
+
 ** SSI directives are interpreted more realistically when validating pages.
 
 ** Variables defined in `priorities.mk' are used to sort the reported

Index: configure.ac
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/configure.ac,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- configure.ac        22 Mar 2012 07:50:06 -0000      1.35
+++ configure.ac        1 Jun 2012 09:44:27 -0000       1.36
@@ -216,12 +216,16 @@
 
 AM_CONDITIONAL([HAVE_VALIDATION], [test "$have_validation" = yes])
 AM_CONDITIONAL([NO_DTD], [test "$have_dtds" = no])
+AM_CONDITIONAL([HAVE_PO4A], [test "$gnun_cv_recent_po4a" = yes])
 
 AC_CONFIG_FILES([Makefile doc/Makefile dtd/Makefile config.mk])
 AS_IF([test -n "$GUILE"],
       [AC_CONFIG_FILES([make-prototype], [chmod +x make-prototype])])
 AS_IF([test "$decent_msgattrib" = yes],
-      [AC_CONFIG_FILES([gnun-clear-previous], [chmod +x gnun-clear-previous])])
+      [AC_CONFIG_FILES([gnun-clear-previous], [chmod +x gnun-clear-previous])
+       AS_CASE(["$gnun_cv_recent_po4a"], [yes],
+              [AC_CONFIG_FILES([gnun-preconvert])])
+      ])
 AC_OUTPUT
 
 cat <<EOF

Index: doc/gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/gnun.texi,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- doc/gnun.texi       24 Apr 2012 06:01:46 -0000      1.52
+++ doc/gnun.texi       1 Jun 2012 09:44:27 -0000       1.53
@@ -1192,10 +1192,9 @@
 with translator's notes.  The special message @code{*GNUN-SLOT:
 TRANSLATOR'S NOTES*} is designed to serve this purpose.  If your
 translation doesn't have notes, you should ``translate'' the
address@hidden as a space (@key{SPC})---otherwise the text of the
address@hidden will appear in the HTML translation, which is not what
-you want.  Here is an example how to use translators' notes in a PO
-file:
address@hidden as a space (@key{SPC})---otherwise the PO file will be
+considered incomplete, which is not what you want.  Here is an example
+how to use translators' notes in a PO file:
 
 @example
 @group
@@ -1213,7 +1212,7 @@
 #. TRANSLATORS: Use space (SPC) as msgstr if you don't have notes.
 msgid "*GNUN-SLOT: TRANSLATOR'S NOTES*"
 msgstr ""
-"<b>Translator's notes</b>:\n"
+"<h3>Translator's notes</h3>\n"
 "<ol>\n"
 "<li id=\"TransNote1\">Note clarifying the text.</li>\n"
 "</ol>\n"
@@ -1290,6 +1289,34 @@
 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} (See @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 (See @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 ``-C 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 msgids 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.
@@ -1951,6 +1978,8 @@
 @menu
 * make-prototype::
 * gnun-add-fuzzy-diff::
+* gnun-preconvert::
+* gnun-merge-preconverted::
 * gnun-validate-html::
 * mailfail::
 * validate-html-notify::
@@ -2041,6 +2070,60 @@
 Display usage information and exit
 @end table
 
address@hidden gnun-preconvert
address@hidden The @command{gnun-preconvert} Script
address@hidden migration, translations
address@hidden conversion of existing translations
+
+This script uses @command{po4a-gettextize} to convert a translation
+from HTML to PO format
+(see @uref{http://po4a.alioth.debian.org/man/man7/po4a.7.php#lbAO}).
+If the conversion is successful, you can merge the result with new POT
+using @command{gnun-merge-preconverted}.
+
address@hidden
+gnun-preconvert [OPTION...] TRANSLATION MASTER
address@hidden example
+
address@hidden @option
address@hidden -e
address@hidden --encoding
+Specify the encoding of TRANSLATION (if other than UTF-8).
+
address@hidden --version
+Display copyright and version information and exit.
+
address@hidden --help
+Display usage information and exit
address@hidden table
+
address@hidden gnun-merge-preconverted
address@hidden The @command{gnun-merge-preconverted} Script
address@hidden migration, translations
address@hidden conversion of existing translations
+
+This script takes @command{po4a-gettextize} output, adds current msgids
+as ``previous'' values, merges the file with new POT, and adds
+differences against previous values like @command{gnun-add-fuzzy-diff}
+does.
+
address@hidden
+gnun-merge-preconverted [OPTION...] PO POT
address@hidden example
+
address@hidden @option
address@hidden -C
address@hidden --compendium
+Specify the compendium (if any).  This option can be used
+more than once to specify multiple compendia.
+
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, HTML, XHTML

Index: gnun-merge-preconverted.in
===================================================================
RCS file: gnun-merge-preconverted.in
diff -N gnun-merge-preconverted.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gnun-merge-preconverted.in  1 Jun 2012 09:44:27 -0000       1.1
@@ -0,0 +1,84 @@
+#! /bin/bash
+# Merge preconverted files.
+
+# 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-merge-preconverted (@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-merge-preconverted OPTION... PO POT
+
+Merge gnun-preconverted translation with its new POT.
+
+Options:
+  -C, --compendium=COMP      Use compendium
+      --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
+}
+
+compendia=
+
+params=$#
+while [ ${params} -ge 1 ]; do
+  case "$1" in
+      --help )
+         usage
+         exit 0
+         ;;
+      --version )
+         version
+         exit 0
+         ;;
+      -C | --compendium )
+         shift
+         params=$((${params}-1))
+         compendia="${compendia} -C $1"
+         ;;
+      --compendium=* )
+         compendia="${compendia} -C ${1#--compendium}"
+         ;;
+      * )
+          break
+         ;;
+  esac
+  params=$((${params}-1))
+  shift
+done
+
+if [ ${params} -ne 2 ]; then
+    echo 1>&2 Error: Two FILE arguments are required.  See --help for details.
+    exit 1
+fi
+
address@hidden@/copy-msgid -i ${1}
+msgmerge --previous -C ${1} ${compendia} -o ${1} /dev/null ${2}
address@hidden@/add-fuzzy-diff -i ${1}

Index: gnun-preconvert.in
===================================================================
RCS file: gnun-preconvert.in
diff -N gnun-preconvert.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gnun-preconvert.in  1 Jun 2012 09:44:27 -0000       1.1
@@ -0,0 +1,86 @@
+#! /bin/bash
+# Invoke po4a-gettextize to convert an existing translation from
+# HTML to PO.
+
+# 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-preconvert (@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-preconvert OPTION... TRANSLATION MASTER
+
+Invoke po4a-gettextize to convert a TRANSLATION of
+MASTER from HTML to PO format.
+
+Options:
+  -e, --encoding=ENC         Specify encoding for TRANSLATION (if not UTF-8)
+      --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
+}
+
+encoding=utf-8
+
+params=$#
+while [ ${params} -ge 1 ]; do
+  case "$1" in
+      --help )
+         usage
+         exit 0
+         ;;
+      --version )
+         version
+         exit 0
+         ;;
+      -e | --encoding )
+         shift
+         params=$((${params}-1))
+         encoding="$1"
+         ;;
+      --encoding=* )
+         encoding="${1#--encoding=}"
+         ;;
+      * )
+          break
+         ;;
+  esac
+  params=$((${params}-1))
+  shift
+done
+
+if [ ${params} -ne 2 ]; then
+    echo 1>&2 Error: Two FILE arguments are required.  See --help for details.
+    exit 1
+fi
+
+po=${1%.html}.po
+
address@hidden@ -f xhtml -M utf-8 -L ${encoding} -l $1 -m $2 -p ${po}



reply via email to

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