[Python-Dev] Re: gettext in the standard library (original) (raw)

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

memory exhausted Virtueller Speicher ersch=F6pft.

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