Language Codes (was Re: [xliff-tools] PO Representation Guide:
The PO Header)
Asgeir Frimannsson
asgeirf at redhat.com
Mon Feb 21 17:13:15 PST 2005
On Mon, 21 Feb 2005 11:25, Rodolfo M. Raya wrote:
> On Mon, 2005-02-21 at 09:47 +1000, Asgeir Frimannsson wrote:
> > How do we deal with language-codes in the filters? When converting a
> > translated PO file to XLIFF, there is no way of knowing which
> > target-language is used in the PO file. The XLIFF spec doesn't explicitly
> > state that a target-language must be present when <target> elements
> > exists, but it would make sense to always have this attribute when there
> > exists <target> elements.
> >
> > I would suggest adding to the guide a section describing different
> > options for specifying target-language (e.g. by adding a 'target-lang'
> > attribute to the filter)
>
> The filter that converts PO to XLIFF does not know what the target
> language can be. And it doesn't really matter very much.
>
> The filter that converts XLIFF to PO needs to know the name of the
> output file, not the target language, and that name should be passed as
> parameter to the filter.
Yep, but this would be totally implementation specific.
> Target language name is important only when the content of the XLIFF
> file is exported to a TM database. In that case, the translation tool
> exporting data may/should store the language name in the "target-lang"
> attribute of the <file> element and in the xml:lang attribute of each
> <target> element.
I would say it is important at any stage in the translation process [in the
case where you convert partially translated PO files]. E.g. for
pre-translation, and for automatically detecting target-language of a XLIFF
file in an editor. Not having xml:lang or target-language in a translated
XLIFF file would mean that [in automatic processes] the language would have
to be manually specified at each stage of the process.
But I agree that this should not be enforced in the Guide. E.g. for your
editor, you can open a file after conversion, and then select
target-language, and that is perfectly valid.
In regards to using the xml:lang attribute in <target>, this is mainly for TUs
within <alt-trans> elements. From section 2 in the XLIFF Spec: "..each
<source> and <target> element that is a child of <trans-unit> is of the same
language as the source-language and target-language attributes of the <file>
element, respectively. The xml:lang attribute should not be used in those
elements." But here again the specification could be clearer, for in the
description of target-language: "..The target language can be also specified
by xml:lang in each <target> element. The values of target-language and
xml:lang in <target> can be different only when in an <alt-trans>
element.".
cheers,
asgeir
More information about the xliff-tools
mailing list