+commit 63e2b5739977a99a70898e6c78798b7eaa66293e
+Author: Shaun McCance <shaunm@gnome.org>
+Date: Wed Apr 4 12:39:06 2012 -0400
+
+ Don't error out when invalid msgstr is non-ascii
+
+ itstool.in | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+commit 367d347cfc0d7bfcc25ab5b83c59e8824af4ae27
+Author: Shaun McCance <shaunm@gnome.org>
+Date: Mon Apr 2 10:16:29 2012 -0400
+
+ Proper error message when source XML file can't be read
+
+ itstool.in | 6 +++++-
+ 1 files changed, 5 insertions(+), 1 deletions(-)
+
+commit 3ff47350b0386c971e4fb1955f87fefc2c5aafd1
+Author: Shaun McCance <shaunm@gnome.org>
+Date: Mon Apr 2 09:51:30 2012 -0400
+
+ Handle UTF-8 in attribute values
+
+ itstool.in | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+commit 1e0fa47194bbfcbd30e402a4897a0856a6045b73
+Author: Shaun McCance <shaunm@gnome.org>
+Date: Fri Mar 23 10:09:55 2012 -0400
+
+ Don't output external ref messages under its:translate="no"
+
+ itstool.in | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+commit 80b34e2870abd08cb96f2929d8ee32acab3d89e9
+Author: Shaun McCance <shaunm@gnome.org>
+Date: Sun Feb 5 11:53:41 2012 -0500
+
+ Version 1.1.2
+
+ NEWS | 4 ++++
+ configure.ac | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletions(-)
+
commit ed24c8ab3b22a085daea614638cbc15796011f15
Author: Shaun McCance <shaunm@gnome.org>
Date: Tue Sep 27 10:16:55 2011 -0400
+1.1.3
+=====
+* Handle UTF-8 in attribute values
+* Don't output non-translatable external ref messages
+* Better error handling
+
1.1.2
=====
* Better handling of XML errors in PO files
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.66 for itstool 1.1.2.
+# Generated by GNU Autoconf 2.66 for itstool 1.1.3.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# Identity of this package.
PACKAGE_NAME='itstool'
PACKAGE_TARNAME='itstool'
-PACKAGE_VERSION='1.1.2'
-PACKAGE_STRING='itstool 1.1.2'
+PACKAGE_VERSION='1.1.3'
+PACKAGE_STRING='itstool 1.1.3'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures itstool 1.1.2 to adapt to many kinds of systems.
+\`configure' configures itstool 1.1.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of itstool 1.1.2:";;
+ short | recursive ) echo "Configuration of itstool 1.1.3:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-itstool configure 1.1.2
+itstool configure 1.1.3
generated by GNU Autoconf 2.66
Copyright (C) 2010 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by itstool $as_me 1.1.2, which was
+It was created by itstool $as_me 1.1.3, which was
generated by GNU Autoconf 2.66. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='itstool'
- VERSION='1.1.2'
+ VERSION='1.1.3'
cat >>confdefs.h <<_ACEOF
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by itstool $as_me 1.1.2, which was
+This file was extended by itstool $as_me 1.1.3, which was
generated by GNU Autoconf 2.66. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-itstool config.status 1.1.2
+itstool config.status 1.1.3
configured by $0, generated by GNU Autoconf 2.66,
with options \\"\$ac_cs_config\\"
-AC_INIT([itstool], [1.1.2], [])
+AC_INIT([itstool], [1.1.3], [])
AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2])
DATADIR=`(
# Place, Suite 330, Boston, MA 0211-1307 USA.
#
-VERSION="1.1.2"
+VERSION="1.1.3"
DATADIR="/usr/local/share"
import gettext
if prop.ns() is not None:
name = prop.ns().name + ':' + name
atval = prop.content
+ if not isinstance(atval, unicode):
+ atval = unicode(atval, 'utf-8')
atval = atval.replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"')
self._message += " %s=\"%s\"" % (name, atval)
if node.children is not None:
def __init__ (self, filename, messages):
self._xml_err = ''
libxml2.registerErrorHandler(xml_error_catcher, self)
- ctxt = libxml2.createFileParserCtxt(filename)
+ try:
+ ctxt = libxml2.createFileParserCtxt(filename)
+ except:
+ sys.stderr.write('Error: cannot open XML file %s\n' % filename)
+ sys.exit(1)
ctxt.lineNumbers(1)
ctxt.replaceEntities(1)
ctxt.parseDocument()
if strict:
raise
else:
- sys.stderr.write('Warning: Could not merge translation for msgid:\n%s\n' % msgstr)
+ sys.stderr.write('Warning: Could not merge translation for msgid:\n%s\n' %
+ msgstr.encode('utf-8'))
self._xml_err = ''
return node
def scan_node(node):
if self._itst_credits is not None:
self._msgs.add_credits()
for ext in self._itst_externals:
+ translate = None
+ node = ext[0]
+ while node != None:
+ translate = self.get_its_translate(node)
+ if translate is not None:
+ break
+ node = node.parent
+ if translate == 'no':
+ continue
msg = Message()
try:
fullfile = os.path.join(os.path.dirname(self._filename), ext[1])
-.TH ITSTOOL "1" "May 2011" "itstool 1.1.2"
+.TH ITSTOOL "1" "May 2011" "itstool 1.1.3"
.SH NAME
itstool \- convert between XML and PO using ITS
if prop.ns() is not None:
name = prop.ns().name + ':' + name
atval = prop.content
+ if not isinstance(atval, unicode):
+ atval = unicode(atval, 'utf-8')
atval = atval.replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"')
self._message += " %s=\"%s\"" % (name, atval)
if node.children is not None:
def __init__ (self, filename, messages):
self._xml_err = ''
libxml2.registerErrorHandler(xml_error_catcher, self)
- ctxt = libxml2.createFileParserCtxt(filename)
+ try:
+ ctxt = libxml2.createFileParserCtxt(filename)
+ except:
+ sys.stderr.write('Error: cannot open XML file %s\n' % filename)
+ sys.exit(1)
ctxt.lineNumbers(1)
ctxt.replaceEntities(1)
ctxt.parseDocument()
if strict:
raise
else:
- sys.stderr.write('Warning: Could not merge translation for msgid:\n%s\n' % msgstr)
+ sys.stderr.write('Warning: Could not merge translation for msgid:\n%s\n' %
+ msgstr.encode('utf-8'))
self._xml_err = ''
return node
def scan_node(node):
if self._itst_credits is not None:
self._msgs.add_credits()
for ext in self._itst_externals:
+ translate = None
+ node = ext[0]
+ while node != None:
+ translate = self.get_its_translate(node)
+ if translate is not None:
+ break
+ node = node.parent
+ if translate == 'no':
+ continue
msg = Message()
try:
fullfile = os.path.join(os.path.dirname(self._filename), ext[1])