[zanata-devel] Gettext header fields

James Ni jni at redhat.com
Fri Apr 8 06:59:41 UTC 2011



----- Original Message -----
> 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.)

Actually, I think we also store this three entries for PO. look at http://code.google.com/p/flies/wiki/RestExtensions#For_TranslationsResource
In "entries" of "extension", we store this three entries using {"key":"","value":""}

> 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.

This also make me confuse, since we could also read "Project-Id-Version" and "POT-Creation-Date" from "entries" of "extensions" of TranslationsResource, without the template. Normally, the po files also have these entries, when importing po, the server also preserve these entries using "entries" of "extension". 

> 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
> 
> 
> _______________________________________________
> zanata-devel mailing list
> zanata-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/zanata-devel




More information about the zanata-devel mailing list