OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xliff message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: FW: Reminder needed: Semantics on Attributes on Structural Elements


(posting this in order to discuss Semantics on Attributes on Structural Elements at the next TC meeting)

Christian asked:

Given the following example:

<group id="D05CE5F5F9D04DDEB41246301C40BEF2" translate="no">
        <trans-unit size-unit="char" maxwidth="255" resname="headline" id="5656565" datatype="x-y">
                <source>So om du var här</source>
                <target>Als ob du hier wärest</target>
        </trans-unit>
</group>

Would "source" be translated? I guess not. However, if I understood correctly, the spec. does not talk about
attribute value inheritance.

. . . And here's the thread that followed

-----Original Message-----
From: Doug Domeny [mailto:ddomeny@ektron.com]
Sent: Thursday, August 14, 2008 11:55 AM
To: Asgeir Frimannsson; Lieske, Christian
Cc: Schnabel, Bryan S; Tony Jewtushenko; Rodolfo M. Raya; Yves Savourel
Subject: RE: Reminder needed: Semantics on Attributes on Structural Elements


All,

We should discuss this at the next XLIFF TC call. I believe the specification means that trans-unit elements without a translate attribute inherit the value of the translate attribute in the innermost group element that has a translate attribute. As Asgeir mentioned, this is a problem with the default value in the schema. It would also be difficult to process with an XSLT.

The simplest meaning to me would be that translate="no" means don't translate anything within this group. It's inheritance where the outermost group takes precedence to prevent translation. This still isn't easy in schema, but may be easy in XSLT depending on how the XML is processed.

<group id="G1" translate="yes">
  <group id="G2" translate="no">
    <trans-unit id="A" translate="yes"/>
    <trans-unit id="B" translate="no"/>
    <trans-unit id="C" />
  </group>
</group>

Possible interpretations:

(1) A translated because it has its own translate="yes" when the inherited default is "no"
(2) none translated because G2 blocks translation of all inner elements
(3) A and C are translated. C is because the schema defaults translate="yes"

B is never translated because it has its own translate="no".

The real question is when element C is processed, how is the value of 'translate' determined?

(1) Look at innermost parent group element with 'translate' attribute and use its value.
(2) Element C is not processed because processing is stopped by G2. This assumes recursive-decent processing. This allows an entire group to be blocked from translation without having to change 'translate' attributes within its children.
(3) Read the attribute and use the schema's default is not specified. This relegates the group's translate attribute almost meaningless. It would only be used when adding new trans-unit elements within the group.

I believe the intent of the spec is (1). However, (2) seems intuitive and powerful. Option (3) seems wrong, but it is what we have right now. The problem is that the spec states the default is 'yes', but I don't know how to implement (1) in schema and the spec states that the default is 'yes' and therefore needs to be expressed in the schema.

Inheritance is convenient for human authoring, but is difficult for some forms of machine processing. It requires 'state', which means you can't just go in and pull out a trans-unit. You have to examine its context.

Regards,
Doug

-----Original Message-----
From: Asgeir Frimannsson [mailto:asgeirf@redhat.com]
Sent: Thursday, August 14, 2008 12:02 AM
To: Lieske, Christian
Cc: bryan.s.schnabel@tektronix.com; Tony Jewtushenko; Rodolfo M. Raya; Doug Domeny; Yves Savourel
Subject: Re: Reminder needed: Semantics on Attributes on Structural Elements

Hi Christian,

On Wednesday 13 August 2008 22:24:58 Lieske, Christian wrote:
> Hi there,
>
> Given the following example:
>
> <group id="D05CE5F5F9D04DDEB41246301C40BEF2" translate="no">
>       <trans-unit size-unit="char" maxwidth="255" resname="headline"
> id="5656565" datatype="x-y"> <source>So om du var här</source>
>               <target>Als ob du hier wärest</target>
>       </trans-unit>
> </group>
>
> Would "source" be translated? I guess not. However, if I understood
> correctly, the spec. does not talk about attribute value inheritance.

From the description for <group> in the spec:
The optional translate attribute provides a default value for all <trans-unit>
elements contained within the <group>.

It is unclear to me if this implies an 'inheritance' relationship, or if the
attribute simply provides a default value for tools to use when adding e.g.
<trans-unit> children to the given group.

I would say it is not an inheritance relationship, and that the <trans-unit>
in your example is indeed translatable. Even if there is no translate
attribute on the unit, its default value is nevertheless 'yes' in the schema
and spec.

It is interesting to note that if the file is schema-validated when parsing, it
would most probably (depending on which validator is used) have a
translate='yes' attribute on the <trans-unit> element, even though it is not
present in the original file. This is because the schema is defined with a
default value 'yes' for the translate attribute, and the validator would
insert this if it is not present. This pattern breaks any attempts of
'inheritance' on these attributes (if it was intended), and there is a similar
conceptual problem with e.g. the xml:space attribute (which do indeed have a
inheritance relationship).

cheers,
asgeir



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]