[zanata-devel] Gettext header fields
Sean Flanigan
sflaniga at redhat.com
Fri Apr 8 06:11:58 UTC 2011
Dean, James,
See especially #5 below!
The GNU gettext manual has a few things to say about the key-value
fields in the header.
http://www.gnu.org/s/hello/manual/gettext/Header-Entry.html
In particular, these fields should come from xgettext (or more
generally, the source document, ie POT):
Project-Id-Version
Report-Msgid-Bugs-To
POT-Creation-Date
and these fields are mentioned as specific to the PO file:
PO-Revision-Date
Last-Translator
Language-Team
Language
Content-Type
Content-Transfer-Encoding
Plural-Forms
In the Java PO client, the POT fields mentioned above are imported into
Resource/HDocument, (along with
MIME-Version
Content-Type
Content-Transfer-Encoding),
and written out as-is when generating a POT file.
When importing a PO file, we preserve
PO-Revision-Date
Last-Translator
Language-Team
Language
Plural-Forms
X-Generator
<any other fields>
but not the POT fields
Project-Id-Version
Report-Msgid-Bugs-To
POT-Creation-Date
MIME-Version
Content-Type
Content-Transfer-Encoding
I think this importing is mostly correct, but:
1. Ideally, we should use each file's (POT or PO) declared
MIME-Version
Content-Type
Content-Transfer-Encoding
when reading, to ensure we use the correct character encoding.
2. Once we've read the file, it's probably not necessary to store which
MIME-Version/Content-Type/Content-Transfer-Encoding was used.
(We currently do store it, but only for POT.)
3. We should generate reasonable values for
MIME-Version/Content-Type/Content-Transfer-Encoding when exporting PO or
POT files.
4. Important: we should *copy*
Project-Id-Version
Report-Msgid-Bugs-To
POT-Creation-Date
from the template (Resource/HDocument) when generating PO files.
5. Most important: we need to test that the PO fields
PO-Revision-Date
Last-Translator
Language-Team
Language
Plural-Forms
X-Generator
<minus the POT fields>
<plus any other fields>
are preserved during a PO file's round trip through Zanata.
#1, #2 and #3 are client-side issues, but probably not high priority
since everything is probably UTF-8. #4 is something we should handle on
the server in ResourceUtils.transferToTranslationsResourceExtensions()
if only to avoid implementing it once per client.
#5 is basically what we need to do with PO metadata right now, in sprint
22.
--
Sean Flanigan
Senior Software Engineer
Engineering - Internationalisation
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 553 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/zanata-devel/attachments/20110408/624d687c/attachment.sig>
More information about the zanata-devel
mailing list