[Top][All Lists]

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

Re: [bug-gettext] Header syntax

From: Bruno Haible
Subject: Re: [bug-gettext] Header syntax
Date: Fri, 07 Dec 2012 02:34:56 +0100
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

Hello Jakub,

> Are header field names supposed to be case-insensitive, like RFC-822 
> ones?

They are case-sensitive. See for example the source code in
  gettext/gettext-tools/src/msginit.c function get_field().

> Python interface to GNU message catalogs[0] treat them case-insensitively.
> Which implementation is correct?

We have no intention to introduce field names that only differ in case,
such as "Language" and "LANGUAGE". Therefore the Python gettext.py
behaviour is not outright wrong, it is just needlessly loose (and
possibly wrong if you are running in a Turkish locale and the conversion
is not careful about the case conversion of 'i' and 'I').

> Is RFC-882-style folding of long fields allowed?

No. There is no need to wrap the lines of the header in the MO file,
since esthetics don't matter for a binary file, and the PO files already
have a mechanism for line wrapping (namely, whitespace outside of the
double-quotes), like this:

msgid ""
msgstr ""
"Project-Id-Version: GNU gettext-tools 0.18\n"
"Report-Msgid-Bugs-To: address@hidden"
"POT-Creation-Date: 2012-02-18 12:36+0100\n"
"PO-Revision-Date: 2010-05-10 13:30+0200\n"
"Last-Translator: RafaƂ Maszkowski <address@hidden>\n"
"Language-Team: Polish <address@hidden>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"

> I will likely have more questions reading the header syntax, as I'm 
> writing a checker tool for PO/MO files[2].

You're welcome. You are also welcome to mention which kinds of checks
you are implementing; some of them may be suitable for 'msgfmt -c'.


reply via email to

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