Internationalization and Localization Markup
Overview
- Background
- Users and Usages of ITS
- Basic Concepts of ITS
- Overview of ITS "Data Categories"
Overview
- Background
- Users and Usages of ITS
- Basic Concepts of ITS
- Overview of ITS "Data Categories"
Targets of ITS
- example target: schema (XML DTD, XML Schema, RELAX NG) with
@translate
attribute
<!ELEMENT p ...>
<!ATTLIST p its:translate (yes|no) #IMPLIED>
Targets of ITS
- example problem: which
<string>
elements need translation?
<resources>
<section id="Homepage">
[...]
<keyvalue_pairs>
<string>Page</string>
<string>ABC Corporation - Policy Repository</string>
<string>Footer_Last</string>
<string>Pages</string>
<string>bgColor</string>
<string>NavajoWhite</string>
<string>title</string>
<string>List of Available Policies</string>
</keyvalue_pairs>
</section>
</resources>
Overview
- Background
- Users and Usages of ITS
- Basic Concepts of ITS
- Overview of ITS "Data Categories"
User: Schema Developers
- Schema developers using "translatability" data category: Add
@its:translate
attribute to your schema
- or: ...
User: Schema Developers
- ... specify separate rules for translatability
(no change of schema or document necessary):
<its:rules its:version="1.0" ...>
<its:ns prefix="myns" uri="http://www.example.com/myschema"/>
<its:translateRule translate="yes" selector="//myns:p"/>
<!-- All p elements should be translated -->
</its:rules>
User: Content Producers
- Use the
@its:translate
attribute in your document
- or: ...
Users: Content Producers
- ... specify ITS rules separately
<its:rules xmlns:its="http://www.w3.org/2005/11/its" its:version="1.0">
<its:translateRule translate="no" selector="//dt"/>
<its:rules>
<text> ...
<body> ...
<p> ... <dl><dt>...</dt><dd>...</dd></dl></p>
</body>
</text>
Target: What kind of XML?
- Documents with textual content (e.g. XHTML)
- XML used for software development
- Combination of these
- ... e.g.: offical documents, to be translated in various languages
Overview
- Background
- Users and Usages of ITS
- Basic Concepts of ITS
- Overview of ITS "Data Categories"
Basic Concepts of ITS: Summary
- ITS "data categories"
- Selection of nodes locally (example:
@its:translate
attribute)
- Selection of nodes globally (example:
<its:translateRule>
element)
- Adding information to selected nodes / pointing to existing information
Notion of "Data Categories"
- "Data categories" defined conceptually in prose:
The data category translatability expresses information about
whether the content of an element or attribute should be
translated or not. The values of this data category are "yes" (translatable)
or "no" (not translatable).
- ... implemented in various schema languages
- ... implemented globally (e.g.
<its:translateRule>
element) or
- ... implementet locally (e.g.
@its:translate
attribute)
Selection of Nodes
- Selection local: mainly via attributes
- Uses data category specific defaults / inheritance behavoir
- Example default: "Translatability information pertains to
element content, not attribute
content."
Selection of Nodes
<article xmlns="http://docbook.org/ns/docbook"
... its:version="1.0">
<info id="a001">
<title>An example article</title>
<author>
<personname>
<firstname>John</firstname>
<surname>Doe</surname>
</personname>
<address>...</address>
</author>
</info>
</article>
Selection of Nodes
<article xmlns="http://docbook.org/ns/docbook"
... its:version="1.0">
<info id="a001">
<title>An example article</title>
<author its:translate="no">
<personname>
<firstname>John</firstname>
<surname>Doe</surname>
</personname>
<address>...</address>
</author>
</info>
</article>
Selection of Nodes
- Selection global, using XPath
- Global rules are in a separate or the same document
<its:rules ... its:version="1.0">
<its:ns prefix="my" uri="myvocabulary.com"/>
<its:translateRule selector="//my:term" translate="no"/>
<its:translateRule selector="//my:term/@desc" translate="yes"/>
</its:rules>
<topic id="myTopic" xmlns="myvocabulary.com">
<title>Using ITS</title>
<prolog>...</prolog>
<body>
<p>An
<term id="t001" desc="Some translatable text">ITS
<termRef loc="t002">namespace</termRef></term>
definition exists ...</p>
</body>
</topic>
Selection of Nodes
- No (or minimal) impact on documents / schemas
- Data categories can pertain to more than one node (e.g. all
<term>
elements)
- ... and to attributes as well (e.g. the
@desc
attribute)
- Inheritance behavoir / defaults are identical to local usage of ITS
Adding ITS information vs. Pointing
- Translatability: adding information ("translate yes" or "translate no") to nodes in documents
- Other data categories: adding and / or pointing to existing information
- Example: adding localization information via the
<locInfoRule>
element with <locNote>
child:
<its:rules its:version="1.0">
<its:locInfoRule locInfoType="alert" selector="//body/p[1]">
<its:locNote>This p element has to be handled carefully"</its:locNote>
</its:locInfoRule>
</its:rules>
Adding ITS information vs. Pointing
- ... pointing to existing localization information via the
<locInfoRule>
element with @locNotePointer
attribute:
<its:rules its:version="1.0" ...>
<its:locInfoRule locInfoType="alert"
locNotePointer="@locn-alert" selector="//*"/>
<its:locInfoRule locInfoType="description"
locNotePointer="//@locn-note" selector="//*"/>
</its:rules>
- Pointing to existing information = saying "this value is a value of an ITS data category"
- Useful for specifying ITS "semantics" of values, e.g. for authoring tools ("highlight all ITS localization information")
Overview
- Background
- Users and Usages of ITS
- Basic Concepts of ITS
- Overview of ITS "Data Categories"
Overview of ITS Data Categories
- Translatability (previous slides)
- Localization Information (previous slides)
- Terminology
- Directionality
- Ruby
- Language Information
- Elements within text
Terminology
- Used to identify terms, to increase terminological consistency
- Reference to further information about the term:
@termInfoRef
attribute
<its:rules its:version="1.0">
<its:termRule selector="//body/p[1]/span"
termInfoRef="http://example.com/termdatabase/#x142539"/>
</its:rules>
Terminology
- Available global (with pointing / adding)
<its:rules its:version="1.0">
<its:termRule selector="//body/p[1]/span"
termInfoRefPointer="@myTermRef"/>
</its:rules>
<myDoc ...>
<p>The definition of <def its:term="yes"
its:termInfoRef="http://example.com/termdatabase/#x142539">X</def>...</p>
</myDoc>
Directionality
- Expresses the directionality of a piece of text
- Available global (only with adding)
<its:rules its:version="1.0">
<its:dirRule dir="rtl" selector="/body/p[1]/quote[myns:dir='rtl']"/>
</its:rules>
<myDoc ...>
<p>... <quote its:dir="rtl"> ...
<!-- Some Hebrew quotation -->
</quote>...</p>
</myDoc>
Ruby
- Provides a short annotation of the associated base text e.g. for pronunciation
- Available local
<text its:version="1.0">
<head> ... </head>
<body>
<p>This is about the
<its:ruby>
<its:rb>W3C</its:rb>
<its:rt>World Wide Web Consortium</its:rt>
</its:ruby>
</p>
</body>
</text>
Ruby
- ... or global (with adding / pointing)
<its:rules its:version="1.0">
<its:rubyRule rubyText="World Wide Web Consortium"
selector="//p[1]/span[@class='ruby']"/>
</its:rules>
Language Information
- Expresses that a given piece of content (selected by the attribute langPointer) is used to express language information in compliance
with
xml:lang
- Values of
xml:lang
: listen to talk tomorrow
- Available only global, only with pointing. Local: you should use xml:lang directly
<its:rules its:version="1.0">
<its:langRule selector="//p" langPointer="@mylangattribute"/>
</its:rules>
Elements Within Text
- Adds information globally (for segmentation purposes) about the position of selected elements
<its:rules its:version="1.0">
<its:withinTextRule withinText="yes" selector="//b | //em | //i"/>
<its:withinTextRule withinText="no" selector="//p"/>
<its:withinTextRule withinText="nested" selector="//p/footnote/p"/>
</its:rules>
@withinText="yes"
: element is in text flow of a different element
@withinText="no"
: element constitutes an independent text flow
@withinText="nested"
: element is nested in a text flow, but constitutes an independent text flow
Overview
- Background
- Users and Usages of ITS
- Basic Concepts of ITS
- Overview of ITS "Data Categories"
Future of this work
- Presented framework of ITS is stable, but not finalized
- We are also looking into requirements for further developments
- Your input is highly appreciated!