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: Ineiev
Subject: trans-coord/gnun/server/gnun ChangeLog Makefile...
Date: Sat, 2 Mar 2024 08:57:15 -0500 (EST)

CVSROOT:        /sources/trans-coord
Module name:    trans-coord
Changes by:     Ineiev <ineiev> 24/03/02 08:57:15

Modified files:
        gnun/server/gnun: ChangeLog Makefile.am NEWS config.mk.in 
                          configure.ac 
        gnun/server/gnun/doc: gnun.texi 
        gnun/server/gnun/m4: ax_po4a.m4 
Added files:
        gnun/server/gnun: gnun-po4a-translate.in 

Log message:
        Add an option to use po4a instead of the deprecated po4a-translate.
        
        * gnun-po4a-translate.in: New file.
        * Makefile.am: Update rules for the new script. 
        * doc/gnun.texi (gnun-preconvert): New node.
        * config.mk.in: Reorder lines, assign exec_prefix.
        * configure.ac: Show $enable_po4a_translate in summary.
        * m4/ax_po4a.m4 (AX_PO4A): Detect PO4A, add
        the --enable-gnun-po4a-translate option.
        (AX_PO4A_NOTICE): Use $PO4A_UPDATEPO rather than $PO4A_TRANSLATE
        to detect po4a version because the latter may refer
        to gnun-po4a-translate.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.520&r2=1.521
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/Makefile.am?cvsroot=trans-coord&r1=1.58&r2=1.59
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/NEWS?cvsroot=trans-coord&r1=1.167&r2=1.168
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/config.mk.in?cvsroot=trans-coord&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/configure.ac?cvsroot=trans-coord&r1=1.69&r2=1.70
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun-po4a-translate.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.120&r2=1.121
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/m4/ax_po4a.m4?cvsroot=trans-coord&r1=1.1&r2=1.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.520
retrieving revision 1.521
diff -u -b -r1.520 -r1.521
--- ChangeLog   14 Feb 2024 01:26:31 -0000      1.520
+++ ChangeLog   2 Mar 2024 13:57:13 -0000       1.521
@@ -1,13 +1,28 @@
+2024-03-02  Pavel Kharitonov  <ineiev@gnu.org>
+
+       Add an option to use po4a instead of the deprecated po4a-translate.
+
+       * gnun-po4a-translate.in: New file.
+       * Makefile.am: Update rules for the new script. 
+       * doc/gnun.texi (gnun-preconvert): New node.
+       * config.mk.in: Reorder lines, assign exec_prefix.
+       * configure.ac: Show $enable_po4a_translate in summary.
+       * m4/ax_po4a.m4 (AX_PO4A): Detect PO4A, add
+       the --enable-gnun-po4a-translate option.
+       (AX_PO4A_NOTICE): Use $PO4A_UPDATEPO rather than $PO4A_TRANSLATE
+       to detect po4a version because the latter may refer
+       to gnun-po4a-translate.
+
 2024-02-14  Pavel Kharitonov  <ineiev@gnu.org>
 
-       doc/web-trans.texi (Distribution Terms): CC don't provide a reasonable
+       * doc/web-trans.texi (Distribution Terms): CC don't provide a reasonable
        way to see instructions on how to use their particular license; instead,
         they direct to their license chooser that doesn't work without 
JavaScript,
        and it looks like CC isn't willing to support older versions like 3.0.
        Suggest that the teams make their own translations, without looking
        at what CC doesn't provide.
-       AUTHORS:
-       THANKS: Update.
+       * AUTHORS:
+       * THANKS: Update.
 
 2024-01-31  Pavel Kharitonov  <ineiev@gnu.org>
 

Index: Makefile.am
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/Makefile.am,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- Makefile.am 31 Jan 2024 16:34:50 -0000      1.58
+++ Makefile.am 2 Mar 2024 13:57:13 -0000       1.59
@@ -42,7 +42,7 @@
 bin_SCRIPTS += gnun-report gnun-init-po
 tests_enabled += init-po
 if HAVE_PO4A
-bin_SCRIPTS += gnun-preconvert gnun-merge-preconverted
+bin_SCRIPTS += gnun-po4a-translate gnun-preconvert gnun-merge-preconverted
 tests_enabled += convert
 endif
 endif
@@ -115,7 +115,7 @@
          esac; \
          echo $$res; \
        done; \
-       echo $$pass tests passed, $$failed tests failed, $$skip tests skipped; \
+       echo $$pass passed, $$failed failed, $$skip skipped; \
        test $$failed = 0
 
 # Note that BASE64_ENCODE may contain `|' and `\'', so we substitute it
@@ -141,6 +141,7 @@
        -e 's|@MSGEXEC[@]|$(MSGEXEC)|g' \
        -e 's|@MSGFMT[@]|$(MSGFMT)|g' \
        -e 's|@MSGMERGE[@]|$(MSGMERGE)|g' \
+       -e 's|@PO4A[@]|$(PO4A)|g' \
        -e 's|@SED[@]|$(SED)|g' \
        -e 's|@SED_BINARY[@]|$(SED_BINARY)|g' \
        -e 's|@SORT[@]|$(SORT)|g' \
@@ -148,8 +149,9 @@
        -e 's|@WDIFF[@]|$(WDIFF)|g'
 
 add-fuzzy-diff copy-msgid diff-po.awk gnun-add-fuzzy-diff \
-gnun-diff-po gnun-init-po gnun-link-diff gnun-merge-preconverted gnun-report \
-gnun-validate-html mailfail make-prototype.awk sort.awk update-localized-urls \
+gnun-diff-po gnun-init-po gnun-link-diff gnun-merge-preconverted \
+gnun-po4a-translate gnun-report gnun-validate-html mailfail \
+make-prototype.awk sort.awk update-localized-urls \
 validate-html-notify: Makefile
        $(AM_V_at)rm -f $@ $@.tmp
        $(AM_V_GEN)$(edit) '$(srcdir)/$@.in' >$@.tmp
@@ -190,6 +192,7 @@
 gnun-init-po: $(srcdir)/gnun-init-po.in
 gnun-link-diff: $(srcdir)/gnun-link-diff.in
 gnun-merge-preconverted: $(srcdir)/gnun-merge-preconverted.in
+gnun-po4a-translate: $(srcdir)/gnun-po4a-translate.in
 gnun-report: $(srcdir)/gnun-report.in
 gnun-validate-html: $(srcdir)/gnun-validate-html.in
 diff-po.awk: $(srcdir)/diff-po.awk.in
@@ -217,8 +220,8 @@
             add-fuzzy-diff.in copy-msgid.in diff-po.awk.in \
             expand-ssi.awk.in gnun-add-fuzzy-diff.in gnun-diff-po.in \
             gnun-init-po.in gnun-link-diff.in gnun-merge-preconverted.in \
-            gnun-report.in gnun-validate-html.in link-diff.awk \
-            make-prototype.awk.in \
+            gnun-po4a-translate.in gnun-report.in gnun-validate-html.in \
+            link-diff.awk make-prototype.awk.in \
             mailfail.in sort.awk.in sort-linguas update-localized-urls.in \
             validate-html-notify.in \
             tests/add-fuzzy-diff tests/fuzzy-diff-0.po tests/fuzzy-diff-1.po \
@@ -247,7 +250,8 @@
             tests/validate/match3.1.html
 
 CLEANFILES = add-fuzzy-diff copy-msgid diff-po.awk gnun-add-fuzzy-diff \
-            gnun-diff-po gnun-init-po gnun-link-diff gnun-merge-preconverted 
gnun-report \
+            gnun-diff-po gnun-init-po gnun-link-diff gnun-merge-preconverted \
+             gnun-po4a-translate gnun-report \
             gnun-validate-html mailfail make-prototype.awk sort.awk \
             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.167
retrieving revision 1.168
diff -u -b -r1.167 -r1.168
--- NEWS        31 Jan 2024 16:34:51 -0000      1.167
+++ NEWS        2 Mar 2024 13:57:14 -0000       1.168
@@ -2,6 +2,11 @@
 
 * Changes in GNUnited Nations 1.5 (????-??-??)
 
+** New script, gnun-po4a-translate, with configure option
+   --enable-gnun-po4a-translate to use it instead of po4a-translate.
+   The script simulate po4a-translate invoking po4a.  Newer versions
+   of po4a-translate emit a deprecation warning.
+
 ** In newer PO4A releases, po4a-update must be used to generate POT files;
    vice versa, in older PO4A versions, po4a-update isn't usable for that,
    and po4a-gettextize should be used.  The configure script runs checks

Index: config.mk.in
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/config.mk.in,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- config.mk.in        31 Jan 2024 16:34:53 -0000      1.20
+++ config.mk.in        2 Mar 2024 13:57:15 -0000       1.21
@@ -21,8 +21,11 @@
 # @configure_input@
 
 # This variable is substituted via a Makefile rule.
-pkglibexecdir  := @pkglibexecdir@
+prefix         := @prefix@
+exec_prefix    := @exec_prefix@
+datarootdir    := @datarootdir@
 pkgdatadir     := @datadir@
+pkglibexecdir  := @pkglibexecdir@
 
 AWK            := @AWK@
 BASE64_ENCODE  := @BASE64_ENCODE@
@@ -44,6 +47,4 @@
 # Force BASH as the shell.
 export SHELL   := @BASH@
 
-prefix         := @prefix@
-datarootdir    := @datarootdir@
 -include @sysconfdir@/gnun.conf

Index: configure.ac
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/configure.ac,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- configure.ac        31 Jan 2024 16:34:53 -0000      1.69
+++ configure.ac        2 Mar 2024 13:57:15 -0000       1.70
@@ -388,6 +388,7 @@
 NOTIFY/ANNOUNCE support...              $have_mail
 VCS support...                          $have_vcs $cvs $svn $bzr
 Use Multiviews naming conventions...    $enable_multiviews
+Use gnun-po4a-translate...              $enable_gnun_po4a_translate
 EOF
 echo -n "Sorting support...                      $have_sorted_lists"
 AS_CASE([$have_sorted_lists], [yes], [AS_ECHO([" ($with_linguas)"])])

Index: doc/gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/gnun.texi,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -b -r1.120 -r1.121
--- doc/gnun.texi       31 Jan 2024 16:35:03 -0000      1.120
+++ doc/gnun.texi       2 Mar 2024 13:57:15 -0000       1.121
@@ -2354,6 +2354,7 @@
 * gnun-diff-po::             Compare two revisions of a PO file.
 * gnun-init-po::             Initialize a new translation.
 * gnun-link-diff::           Figure out mismatched links.
+* gnun-po4a-translate::      Simulate po4a-translate with po4a.
 * gnun-preconvert::          Invoke the first step in converting
                                HTML translation to PO format.
 * gnun-merge-preconverted::  Run the second step of the conversion.
@@ -2536,6 +2537,17 @@
 Display usage information and exit.
 @end table
 
+@node gnun-po4a-translate
+@subsection The @command{gnun-po4a-translate} Script
+@cindex PO4A compatibility
+
+In newer PO4A releases, @command{po4a-translate} emits a deprecation warning.
+The @command{gnun-po4a-translate} script makes a drop-in replacement for
+the deprecated script using @command{po4a}, as the warning recommends.  When
+the @command{configure} script is invoked with the
+@option{--enable-gnun-po4a-translate} option, GNUN is configured to use
+the replacement instead of @command{po4a-translate}.
+
 @node gnun-preconvert
 @subsection The @command{gnun-preconvert} Script
 @cindex migration, translations

Index: m4/ax_po4a.m4
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/m4/ax_po4a.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- m4/ax_po4a.m4       31 Jan 2024 15:38:21 -0000      1.1
+++ m4/ax_po4a.m4       2 Mar 2024 13:57:15 -0000       1.2
@@ -25,16 +25,27 @@
 #
 # Configure PO4A executables to use.
 # In particular, test if po4a-updatepo is usable for making POT files.
-# Set PO4A_GETTEXTIZE, PO4A_TRANSLATE PO4A_UPDATE, have_po4a,
-# have_po4a_tepo, have_po4a_ize variables.
+# Set PO4A, PO4A_GETTEXTIZE, PO4A_TRANSLATE PO4A_UPDATE, have_po4a,
+# have_po4a_tepo, have_po4a_ize, enable_gnun_po4a_translate variables.
 # Define HAVE_PO4A conditional.
 
 AC_DEFUN([AX_PO4A], [
+  AX_ARG_PROG([PO4A], [the 'po4a' program], [po4a])
   AX_ARG_PROG([PO4A_GETTEXTIZE], [the 'po4a-gettextize' program],
     [po4a-gettextize])
   AX_ARG_PROG([PO4A_UPDATEPO], [the 'po4a-updatepo' program], [po4a-updatepo])
   AX_ARG_PROG([PO4A_TRANSLATE], [the 'po4a-translate' program],
     [po4a-translate])
+  AC_MSG_CHECKING([whether to use gnun-po4a-translate])
+  AC_ARG_ENABLE([gnun-po4a-translate],
+    [AS_HELP_STRING([--enable-gnun-po4a-translate],
+    [Use GNUN wrapper against po4a instead of po4a-translate.])]
+  )
+  AS_CASE(["x$enable_gnun_po4a_translate"],[xyes],,
+    [enable_gnun_po4a_translate=no])
+  AC_MSG_RESULT([$enable_gnun_po4a_translate])
+  AS_CASE(["x$enable_gnun_po4a_translate"],[xyes],
+    [PO4A_TRANSLATE="$bindir/gnun-po4a-translate"])
   AC_MSG_CHECKING([whether $PO4A_UPDATEPO can create POT files])
   AS_ECHO(['<p>test</p>']) > ./conftest.html
   po4a_args="-o porefs=none --format=xhtml --master-charset=utf-8"
@@ -57,7 +68,7 @@
   AS_CASE(["x$PO4A_UPDATEPO"], [x], [], [
     AC_CACHE_CHECK([if po4a version is at least 0.37], [gnun_cv_recent_po4a],
                    [gnun_cv_recent_po4a=no
-                   po4a_version=`$PO4A_TRANSLATE --version 2> /dev/null \
+                   po4a_version=`$PO4A_UPDATEPO --version 2> /dev/null \
                      | $GREP po4a | $AWK '{print $3}' | $SED 's/.$//'`
                    AX_COMPARE_VERSION([$po4a_version], [ge], [0.37],
                    [gnun_cv_recent_po4a=yes])])

Index: gnun-po4a-translate.in
===================================================================
RCS file: gnun-po4a-translate.in
diff -N gnun-po4a-translate.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gnun-po4a-translate.in      2 Mar 2024 13:57:15 -0000       1.1
@@ -0,0 +1,153 @@
+#! @BASH@
+
+# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
+#   2017, 2018, 2019, 2020,
+#   2021, 2022, 2023, 2024 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/>.
+
+PO4A_BIN="@PO4A@"
+function version () {
+cat <<EOF
+gnun-report (@PACKAGE_NAME@) @PACKAGE_VERSION@
+Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
+  2017, 2018, 2019, 2020,
+  2021, 2022, 2023, 2024 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.
+
+Configured PO4A executable: '$PO4A_BIN'
+
+EOF
+"$PO4A_BIN" --version | "@SED@" /version/q
+}
+
+function usage () {
+cat <<EOF
+Usage: gnun-po4a-translate OPTION...
+Wrapper around po4a to simulate po4a-translate
+
+The --localized, --master and --po options are mandatory
+unless invoked with --version or --help, other options are passed to po4a.
+
+Options:
+  --localized FILE  Specify the output file
+  --master FILE     Specify the English file
+  --po FILE         Specify the PO file
+  -v, --version     Display version info and exit
+  -h, --help        Display this help and exit
+
+Report bugs to @PACKAGE_BUGREPORT@
+@PACKAGE_NAME@ home page: <@PACKAGE_URL@>
+General help using GNU software: <http://www.gnu.org/gethelp/>
+EOF
+}
+
+# Parse the command line.
+PO=
+master=
+flags=
+output=
+
+function parse_option () {
+  skip_option=
+  case "$1" in
+      -h* | --help )
+         usage
+         exit 0
+         ;;
+      -v* | --version )
+         version
+         exit 0
+         ;;
+      --localized )
+         skip_option=yes
+         output="$2"
+         ;;
+      --localized=* )
+         output="${1#--localized=}"
+          return 0
+         ;;
+      --master )
+         skip_option=yes
+         master="$2"
+         ;;
+      --master=* )
+         master="${1#--master=}"
+          return 0
+         ;;
+      --po )
+         skip_option=yes
+         PO="$2"
+         ;;
+      --po=* )
+         PO="${1#--po=}"
+          return 0
+         ;;
+      --format ) # Hardcoded in the generated po4a config.
+         skip_option=yes
+         ;;
+      --format=* )
+          return 0
+         ;;
+  esac
+  return 1
+}
+
+declare -a flags
+i=0
+
+while test $# -ge 1; do
+  current_option="$1"
+  shift
+  if test -n "$current_option"; then
+    if parse_option "$current_option" "$1"; then
+      continue
+    fi
+    if test -n "$skip_option"; then
+      shift
+    else
+      flags[$i]="$current_option"
+      i=$(($i + 1))
+    fi
+  fi
+done
+
+if test -z "$PO"; then
+  echo "$0: no PO file is specified" >&2
+  exit 1
+fi
+
+if test -z "$master"; then
+  echo "$0: no English file is specified" >&2
+  exit 1
+fi
+
+if test -z "$output"; then
+  echo "$0: no output file is specified" >&2
+  exit 1
+fi
+
+lang=${PO%.po}
+lang=${lang##*.}
+POT=${PO%po}pot
+
+"$PO4A_BIN" --no-update "${flags[@]}" /dev/stdin <<-EOF
+       [po4a_langs] $lang
+       [po4a_paths] $POT $lang:$PO 
+       [type: xhtml] $master $lang:$output
+EOF



reply via email to

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