[Python-Dev] Re: gettext in the standard library
Martin von Loewis
loewis@informatik.hu-berlin.de
Sun, 20 Aug 2000 12:59:28 +0200 (MET DST)
> Martin mentioned the possibility of using UTF-8 for the
> catalogs and then decoding them into Unicode. That should be
> a reasonable way of getting .gettext() to talk Unicode :-)
You misunderstood. Using UTF-8 in the catalogs is independent from
using Unicode. You can have the catalogs in UTF-8, and still access
the catalog as byte strings, and you can have the catalog in Latin-1,
and convert that to unicode strings upon retrieval.
> Just dreaming a little here: I would prefer that we use some
> form of XML to write the catalogs.=20
Well, I hope that won't happen. We have excellent tools dealing with
the catalogs, and I see no value in replacing
#: src/grep.c:183 src/grep.c:200 src/grep.c:300 src/grep.c:408 src/kwset.c:=
184
#: src/kwset.c:190
msgid "memory exhausted"
msgstr "Virtueller Speicher ersch=F6pft."
with
<entry>
<sourcelist>
<source file=3D"src/grep.c" line=3D"183"/>
<source file=3D"src/grep.c" line=3D"200"/>
<source file=3D"src/grep.c" line=3D"300"/>
<source file=3D"src/grep.c" line=3D"408"/>
<source file=3D"src/kwset.c" line=3D"184"/>
<source file=3D"src/kwset.c" line=3D"190"/>
</sourcelist>
<msgid>memory exhausted</msgid>
<msgstr>Virtueller Speicher ersch=F6pft.</msgstr>
</entry>
> XML comes with Unicode support and tools for writing XML are
> available too.
Well, the catalog files also "come with unicode support", meaning that
you can write them in UTF-8 if you want; and tools could be easily
extended to process UCS-2 input if anybody desires.
OTOH, the tools for writing po files are much more advanced than any
XML editor I know.
> We'd only need a way to transform XML into catalog files of some
> Python specific platform independent format (should be possible to
> create .mo files from XML too).
Or we could convert the XML catalogs in Uniforum-style catalogs, and
then use the existing tools.
Regards,
Martin