xml & localis/zation peishan t. bartley. xml and languages xml supports any defined character...

21
XML & Localis/zation Peishan T. Bartley

Upload: chrystal-holland

Post on 18-Dec-2015

244 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XML & Localis/zation

Peishan T. Bartley

Page 2: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XML and Languages

XML supports any defined character sets.

With Unicode-8, an XML file can be multi-lingual. Multi-lingual attributes. Multi-lingual tests.

What about the elements?

Page 3: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

Localization (or Localisation)

Internationalization: to develop software so it can run in different international environments without adapting or recompiling.

Localization: “to make local” – Merriam-Webster Abridged.

Page 4: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

Localization (or Localisation)

To localize = translation + reformatting + layout re-evaluation.

Page 5: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

Localization (or Localisation)

Examples: Format

Date MM/DD/YY vs. DD/MM/YY

Address 51 Wu-Chuan 6th St. Taichung, Taiwan 403 403 台灣省台中市五權六街 51號

Colors Don’t use red ink to write the name of a

Chinese.

Page 6: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XML and Localization

Localizable contents can be successfully handled by XSL or DTD. XSL: transform the document according

to location or language, example. DTD – the power of attributes:

<language> <span> - <span language=”en”

translate=”no”> …</span> <style> - <emphasis> <emphasize more>

Page 7: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

Challenges During the Localization Process

Software codes are placed in other people’s hands.

Software products may include multiple file formats.

Duplicate translation efforts means double costs.

Page 8: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

Challenges During the Localization Process

Alternative process:

Prepare the file by putting it in a container in which codes and translatable texts are separated.

Page 9: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XLIFF

XLIFF: Born in 2001, XLIFF is the XML Localisation Interchange File Format.

Page 10: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XML and Localization

Why XML-based? Easy to develop, and low on cost. Supports any defined character sets as

long as they are properly declared. Has features (attributes and such) that

can be used to facilitate localization. Can be output to target media, such as

HTML or PDF. Extensible.

Page 11: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

The Elements of XLIFF

Non-localization data – Skeleton file.

Localization data – Translation units.

Translation memory.

Page 12: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XLIFF - Translation Units <target> vs. <source> and <alt-trans>

<trans-unit id=’1’> <source xml:lang=’en’>It’s such a nice day

today!</source><target xml:lang=’zh-TW’> 今天天

氣實在 好 !</target><alt-trans>

<target xml:lang=’zh-CN’>今天天气 实在好 !</target>

</alt-trans></trans-unit>

Page 13: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XLIFF - Translation Units

What about the inline codes? Tag it:

<bpt id="1">&lt;a href="http://www.simmons.edu/gslis/"&gt;</bpt>Simmons GSLIS<ept id="1">&lt;/a&gt;</ept>

Page 14: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XLIFF - Translation Units

More elements: Internal-file External-file …

And powerful attributes: Phase Count

Page 15: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XLIFF - Translation Units Example:

<phase-group> <phase phase-name='trans' process-name='translation' tool=‘thisthing' contact-email=‘[email protected]' date='2002-10-01T23:32:23Z'/>

<phase phase-name='edit' process-name='edit' tool=‘thatthing' contact-email=‘[email protected]' date='2002-10-02T14:20:03Z'/>

</phase-group>

Page 16: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XLIFF - Translation Units Another example: use attributes to

record metadata.

<trans-unit xml:space=’preserve’ id=’1001’ maxwidth=’15’ minwidth=’8’ size-unit=’char’><source xml:lang=’en’> Title: </source><target xml:lang=’zh-tw’> 書名 : </source>

</trans-unit>

Page 17: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XLIFF

So how do you do it?

Code the files manually, write a program to do it, or use the tools available.

Page 18: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XLIFF Tools

ENLASO Corp. Rainbow 4. http://xliff-tools.freedesktop.org/wiki/Resources

Java.net Open Language Tools. https://open-language-tools.dev.java.net/

Heartsome Holdings Ltd. http://www.heartsome.net

XLIFF Tools. http://xliff-tools.freedesktop.org/

Page 19: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

Open Language Tools XLIFF Filter 1.2.4

Page 20: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XLIFF Editor

Page 21: XML & Localis/zation Peishan T. Bartley. XML and Languages  XML supports any defined character sets.  With Unicode-8, an XML file can be multi-lingual

XML & Localis/zation

Questions?

One non-XLIFF related thing. Characters & codes.