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

 


Help: OASIS Mailing Lists Help | MarkMail Help

xliff-comment message

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


Subject: RE: [xliff-comment] XLIFF: Context for translators WAS: using xliff to translate


Hi everyone,

I've posted this additional examples on Friday, but for some reasons it
bounced back, so here is it again:

The attached file has two examples of extracted HTML, with the original code
for context. The idea is to show how we could include the whole original
data inside the XLIFF body. There are two approaches I can think of:


=== 1) Using <context-group> and <context>

Snippet from Example_ContextElem.xlf:
------------------------------
...
  <trans-unit id='1' restype='caption'>
   <source xml:lang='en'>Title of the test page</source>
   <context-group name='ctx'>
    <context context-type='x-raw'><![CDATA[<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>]]></context>
   </context-group>
  </trans-unit>

  <trans-unit id='2' restype='heading'>
   <source xml:lang='en'><bpt id='1'>&lt;a name="topoffile"></bpt><ept
id='1'>&lt;/a></ept>Test Page</source>
   <context-group name='ctx'>
    <context context-type='x-raw'><![CDATA[</title>
</head>

<body>

<h1>]]></context>
   </context-group>
  </trans-unit>
...
------------------------------
There are a few drawbacks here:
a) Currently <context> doesn't have xml:space attribute, so we can't use it
to indicate the white spaces in content of <context> should be preserved.
b) The current order in <trans-unit> has <source> before <context-group> so
we end up with the context showing after the extracted text, not a big deal
since both elements are siblings.
c) The context-type attribute has no pre-defined value to indicate such
content in <context>.
d) The name attribute in <context-group> has no real in this case use but is
required.
The advantage is that we don't use a user-defined namespace.


=== 2) Using a user-defined namespace

Snippet from Example_UserExtension.xlf:
------------------------------
...
  <group>
   <ext:code xml:space='preserve'><![CDATA[<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>]]></ext:code>
   <trans-unit id='1' restype='caption'>
    <source xml:lang='en'>Title of the test page</source>
   </trans-unit>
  </group>

  <group>
   <ext:code xml:space='preserve'><![CDATA[</title>
</head>

<body>

<h1>]]></ext:code>
   <trans-unit id='2' restype='heading'>
    <source xml:lang='en'><bpt id='1'>&lt;a name="topoffile"></bpt><ept
id='1'>&lt;/a></ept>Test Page</source>
   </trans-unit>
  </group>
...
------------------------------
This approach is more efficient since you can have whatever you need in the
new namespace (i.e. xml:space). It also allows to have a single context for
multiple <trans-unit> (useful when there are sub-flows like in <trans-unit>
#18 and #19).
The drawback is that it's user-defined.


I can see some scenarios where having such information within the XLIFF body
could be useful. This is very similar to the structure of a Trados TTX file,
except you get all the additional features a <trans-unit> can have
(<alt-trans>, etc.).

Cheers,
-yves

Example.zip



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