Selecting Items to be Translated for a Particular Language

Hi there,
 
Someone stumbled across our ITS presentation from the OASIS Standards Day in
November 2006, and approached my by mail with an ITS related question. I
thought it might be a good idea to share the question, and my answer.
 
Cheers,
Christian
 
=== Question ===
 
Can we build conditional tagging using ITS to support situations where we
want to translate a segment to a particular language, or a set of languages.
For example, in the same XML there is some content we want to mark as
"translate to German=yes",  but in same XML maybe we want to restrict
translation to two other languages "translate to Swedish&Portuguese=no"  and
so on.  
 
Is there a standardized way to tag XML user documentation with conditional
tags that describes what segments should be translated to what languages.
This would be used to filter the XML and output a German version, a Swedish
version, a Portuguese version, and so on.
 
=== Answer ===
 
>From my understanding, the process you have to implement is a common one:
pass only certain items to translation for a particular target language. An
idea of how it can be realized with ITS is the following:
 
a. Work with the "Rules" element
b. Create "Rules" files which are specific to a specific target language
(ie. the language your need to go into), or combination of target languages
(cf.  <http://www.w3.org/TR/its/#link-external-rules>
http://www.w3.org/TR/its/#link-external-rules)
c. Put ITS information into the "Rules" files
 
Here's an example ...
 
If your original looks as follows (please note that documents like
<http://www.w3.org/TR/xml-i18n-bp/> http://www.w3.org/TR/xml-i18n-bp/ give
recommendations for world-ready XML):
 
<?xml version="1.0" encoding="UTF-8"?>
<stringSet xml:lang="en">
 <string id="1" locale-relevance="de, en">This needs to be available in
German and English</string>
 <string id="2" locale-relevance="pt">This needs to be available in
Portuguese</string>
 <string id="3" locale-relevance="de, fr">This needs to be available in
German and French</string>
 <string id="4" locale-relevance="de, en">This needs to be available in
German and English</string>
</stringSet>
 
Then you could have rules files like the following ...
 
In both scenarios/approaches, the important bit is to have a "hook" in the
original XML which allows you to easily specify ITS selections.
 
Scenario/Appraoch A: Selection is based on "id":
 
<myFormatInfo
  xmlns:its=" <http://www.w3.org/2005/11/its> http://www.w3.org/2005/11/its"
>
 <desc>ITS rules for host vocabulary MyFormat and target language
"German"</desc>
 <hostVoc>http://myComp.cc/ns/1.0</hostVoc>
 <rulesId>98ECED99DF63D511B1250008C784EFB1</rulesId>
 <rulesVersion>v 1.81 2006/03/28 07:43:21</rulesVersion> ...
 <its:rules
   its:version="1.0">
  <its:translateRule selector="/stringSet/string[@id='2']" translate="no"/>
 </its:rules>
</myFormatInfo>
 
<myFormatInfo
  xmlns:its=" <http://www.w3.org/2005/11/its> http://www.w3.org/2005/11/its"
>
 <desc>ITS rules for host vocabulary MyFormat and target language
"Portuguese"</desc>
 <hostVoc>http://myComp.cc/ns/1.0</hostVoc>
 <rulesId>98ECED99DF63D511B1250008C784EFB2</rulesId>
 <rulesVersion>v 1.81 2006/03/31 08:43:21</rulesVersion> ...
 <its:rules
   its:version="1.0">
  <its:translateRule selector="/stringSet/string[@id='1' or @id='3' or
@id='4']" translate="no"/>
 </its:rules>
</myFormatInfo>
 
Scenario/Appraoch B: Selection based on value of "locale-relevance":
 
<myFormatInfo
  xmlns:its=" <http://www.w3.org/2005/11/its> http://www.w3.org/2005/11/its"
>
 <desc>ITS rules for host vocabulary MyFormat and target language
"German"</desc>
 <hostVoc>http://myComp.cc/ns/1.0</hostVoc>
 <rulesId>98ECED99DF63D511B1250008C784EFB1</rulesId>
 <rulesVersion>v 1.81 2006/03/28 07:43:21</rulesVersion> ...
 <its:rules
   its:version="1.0">
  <its:translateRule
selector="/stringSet/string[not(contains(@locale-relevance, 'de'))]"
translate="no"/>
 </its:rules>
</myFormatInfo>
 
<myFormatInfo
  xmlns:its=" <http://www.w3.org/2005/11/its> http://www.w3.org/2005/11/its"
>
 <desc>ITS rules for host vocabulary MyFormat and target language
"Portuguese"</desc>
 <hostVoc>http://myComp.cc/ns/1.0</hostVoc>
 <rulesId>98ECED99DF63D511B1250008C784EFB2</rulesId>
 <rulesVersion>v 1.81 2006/03/31 08:43:21</rulesVersion> ...
 <its:rules
   its:version="1.0">
  <its:translateRule
selector="/stringSet/string[not(contains(@locale-relevance, 'pt'))]"
translate="no"/>
 </its:rules>
</myFormatInfo>
 
 
 
 
 
 
 
 

Received on Wednesday, 31 January 2007 09:46:08 UTC