Presentation is loading. Please wait.

Presentation is loading. Please wait.

Characteristics, localization strategies

Similar presentations


Presentation on theme: "Characteristics, localization strategies"— Presentation transcript:

1 Characteristics, localization strategies
Localization Formats Characteristics, localization strategies Dipl.-Übersetzer Daniel Zielinski Dept Saarland University

2 Localization Formats: Overview
Software: RC files, Borland Delphi, Java, XML, .NET, Visual Basic, .po, XLIFF, ... Online help: chm, hlp, rtf Documentation: fm, indd, doc, rtf, … Web pages: xml, html, php, js, pl, … Graphic files: gif, jpg, tiff, psd, … Online Help: RTF (WinHelp Version 3 and 4), since Win98 increased HTML

3 Localization Formats: Software
Special software formats RC files HTML XML Meta localization formats XLIFF

4 Localization Formats:
Document formats in which localization relevant data can be stored Motivation and goal: separation of program code and localization data Programming languages offer different localization formats The differences depend on: Which data is considered relevant for localization How is data stored How placeables and escape sequences are used Data: Texts Properties used for representing interfaces in software

5 Localization Formats: Challenges
External structure Identification of localizable information Editing without destroying/corrupting the format Context, scope, programming concepts Missing context information Inheritance Incomplete information Rules for target files Internal structure Placeables Escape sequences Tags Binary files vs. source files text-based vs. XML-based

6 Standard Windows resource format Localizable information:
Windows RC Files Standard Windows resource format Localizable information: Dialogues Menus String tables Information: Whereas localizable information from dialogues and menus is stored automatically in the resource files by using software development tools, this is not the case when localizable information comes from error messages and text not contained in dialogues and menus. It is also possible that some error messages are not localized or cannot be localized.

7 Windows RC Files: Example
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Info über SimpleSample" FONT 8, "MS Sans Serif" BEGIN ICON IDR_MAINFRAME, IDC_STATIC, 11,17,20,20 LTEXT "SimpleSample Version 1.0", IDC_STATIC,40,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) 2005", IDC_STATIC, 40,25,119,8 DEFPUSHBUTTON "&OK",IDOK,178,7,50,14,WS_GROUP END Exercise: Identify the localizable information

8 Windows RC Files: Example
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Info über SimpleSample" FONT 8, "MS Sans Serif" BEGIN ICON IDR_MAINFRAME, IDC_STATIC, 11,17,20,20 LTEXT "SimpleSample Version 1.0", IDC_STATIC,40,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) 2005", IDC_STATIC, 40,25,119,8 DEFPUSHBUTTON "&OK",IDOK,178,7,50,14,WS_GROUP END Localizable elements: Text Push buttons

9 Windows RC Files: Example
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Info über SimpleSample" FONT 8, "MS Sans Serif" BEGIN ICON IDR_MAINFRAME, IDC_STATIC, 11,17,20,20 LTEXT "SimpleSample Version 1.0", IDC_STATIC,40,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) 2005", IDC_STATIC, 40,25,119,8 DEFPUSHBUTTON "&OK",IDOK,178,7,50,14,WS_GROUP END Localizable elements: Coordinates Size specifications Fonts Font size

10 Windows RC Files: Example
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Info über SimpleSample" FONT 8, "MS Sans Serif" BEGIN ICON IDR_MAINFRAME, IDC_STATIC, 11,17,20,20 LTEXT "SimpleSample Version 1.0", IDC_STATIC,40,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) 2005", IDC_STATIC, 40,25,119,8 DEFPUSHBUTTON "&OK",IDOK,178,7,50,14,WS_GROUP END IDs Not very intuitive to use Changes in the source format without having technical support can lead to errors

11 Windows RC Files: Tags, escape sequences
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Meyer && Söhne" FONT 8, "MS Sans Serif" BEGIN ICON IDR_MAINFRAME, IDC_STATIC, 11,17,20,20 LTEXT "SimpleSample Version 1.0", IDC_STATIC,40,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) 2005", IDC_STATIC, 40,25,119,8 DEFPUSHBUTTON "&OK",IDOK,178,7,50,14,WS_GROUP END STRING TABLE DISCARDABLE AFX_IDS_ERRMSG1 "Die Datei %s enthält %d Worte." AFX_IDS_ERRMSG2 "Die Datei %1 enthält %2 Worte." AFX_IDS_PREVIEW_CLOSE " Beendet die Seitenansicht.\nSeitenansicht beenden" '&' is a Tag and determines the access key '&' cannot be used for itself '&' => '&&' '&&' is the Escape sequence for '&‚ (but not always, e.g. string tables) Escape sequences for line breaks: '\n' and for '\' is '\\'

12 Windows RC Files: Placeables
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Meyer && Söhne" FONT 8, "MS Sans Serif" BEGIN ICON IDR_MAINFRAME, IDC_STATIC, 11,17,20,20 LTEXT "SimpleSample Version 1.0", IDC_STATIC,40,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) 2005", IDC_STATIC, 40,25,119,8 DEFPUSHBUTTON "&OK",IDOK,178,7,50,14,WS_GROUP END STRINGTABLE DISCARDABLE AFX_IDS_ERRMSG1 "Die Datei %s enthält %d Worte." AFX_IDS_PREVIEW_CLOSE "Beendet die Seitenansicht.\nSeitenansicht beenden" AFX_IDS_PREVIEW_SIZE "Zoom: %d %%" Problems: Changing the sentence order in the translation can lead to changes in the order of placeables, which can cause program errors Information: In other development environments position-independent placeables are used (%1, %2) Placeables are substituted with current values during runtime %s and %d are position-sensitive placeables that are used in C and C++ Also '%' needs escape sequence '%%'

13 Windows RC Files: String tables
Contain symbolic names of program elements (IDs) and their external identifiers IDs: Connect program code and resources STRINGTABLE DISCARDABLE BEGIN AFX_IDS_SCRESTORE "Stellt das Fenster in seiner normalen Größe wieder her." AFX_IDS_SCTASKLIST "Aktiviert die ""Task-Liste""." AFX_IDS_ERROR "Quelldatei enthält %d Fehler." END AFX_IDS_PREVIEW_CLOSE "Beendet die Seitenansicht.\nSeitenansicht beenden" AFX_IDS_COMPANY_NAME "Meyer && Eriksson" Double quotes (") are escaped with ("") Line breaks and tabulators are escaped with \n and \t Back slashes are escaped with \\ %d, %s, %1, … are used as placeables % is escaped with %%

14 Windows RC Files: String tables: Localization
Localization without context information Only indication: IDs (additional information in program code) IDs should not be modified Possible insertion of comments in string tables

15 Windows RC Files: Localization
Flat structure Superposition of controls (tab controls)  time-consuming localization

16 Windows RC Files: Localization
Problems with character sets & fonts Binary resources saved always as Unicode Programs can be Unicode- and codepage-based Representation problems in operating systems that are not Unicode-based (MS Win 9x/ME) Not always localization errors Use of generic fonts Always test in localized target system

17 Windows RC Files: Localization

18 EXERCISE I

19 HyperText Markup Language
HTML HyperText Markup Language

20

21

22

23 HTML: Example <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " <html> <head> <title>HTML localization example file</title> <meta http-equiv="content-type" content="text/html; charset=ISO "> <meta name="author" content="Daniel Zielinski"> <meta name="keywords" content="HTML Software localization Website"> <meta name="description" lang="en" content="This file should give you an example of how complex web page localization can be."> <link rel="stylesheet" type="text/css" href="./ecolotrain.css"> </head> <body> <a name="top" /> <div> <h1>HTML localization Example</h1> <p> Some text to be localized in the first paragraph. For more information please visit the <a href=" title="Click here to get an overview about important issues in localization">eCoLoTrain website</a>. </p> </div> <img src="./user.gif" alt="User icon" title="User icon for demonstration" longDesc="This icon shows you how a user in Asia looks like" /><br/><br/> <b>A form:</b><br/><br/> <form action="./result.html" method="get" accept-charset="ISO "> Title: <select name="field0" size="1"> <option value="male">Mr.</option> <option value="female">Mrs.</option> </select> <br/> Name: <input name="field1" type="text" size="30" maxlength="30" /><br/> Address: <textarea>Type your address here...</textarea><br/> <input name="field1" type="text" size="30" maxlength="30" /><br/><br/> <input type="button" value="Submit" /> </form> <div class="bottom"> <a href="#top" title="Top of page">Top</a> </body> </html>

24 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
HTML: Example: DTD <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " <html> <head> <title>HTML localization example file</title> <meta http-equiv="content-type" content="text/html; charset=ISO "> <meta name="author" content="Daniel Zielinski"> <meta name="keywords" content="HTML Software localization Website"> <meta name="description" lang="en" content="This file should give you an example of how complex web page localization can be."> <link rel="stylesheet" type="text/css" href="./ecolotrain.css"> </head> <body> <a name="top" /> <div> <h1>HTML localization Example</h1> <p> Some text to be localized in the first paragraph. For more information please visit the <a href=" title="Click here to get an overview about important issues in localization">eCoLoTrain website</a>. </p> </div> <img src="./user.gif" alt="User icon" title="User icon for demonstration" longDesc="This icon shows you how a user in Asia looks like" /><br/><br/> <b>A form:</b><br/><br/> <form action="./result.html" method="get" accept-charset="ISO "> Title: <select name="field0" size="1"> <option value="male">Mr.</option> <option value="female">Mrs.</option> </select> <br/> Name: <input name="field1" type="text" size="30" maxlength="30" /><br/> Address: <textarea>Type your address here...</textarea><br/> <input name="field1" type="text" size="30" maxlength="30" /><br/><br/> <input type="button" value="Submit" /> </form> <div class="bottom"> <a href="#top" title="Top of page">Top</a> </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "

25 HTML: Example: Header: TITLE, META, LINK
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " <html> <head> <title>HTML localization example file</title> <meta http-equiv="content-type" content="text/html; charset=ISO "> <meta name="author" content="Daniel Zielinski"> <meta name="keywords" content="HTML Software localization Website"> <meta name="description" lang="en" content="This file should give you an example of how complex web page localization can be."> <link rel="stylesheet" type="text/css" href="./ecolotrain.css"> </head> <body> <a name="top" /> <div> <h1>HTML localization Example</h1> <p> Some text to be localized in the first paragraph. For more information please visit the <a href=" title="Click here to get an overview about important issues in localization">eCoLoTrain website</a>. </p> </div> <img src="./user.gif" alt="User icon" title="User icon for demonstration" longDesc="This icon shows you how a user in Asia looks like" /><br/><br/> <b>A form:</b><br/><br/> <form action="./result.html" method="get" accept-charset="ISO "> Title: <select name="field0" size="1"> <option value="male">Mr.</option> <option value="female">Mrs.</option> </select> <br/> Name: <input name="field1" type="text" size="30" maxlength="30" /><br/> Address: <textarea>Type your address here...</textarea><br/> <input name="field1" type="text" size="30" maxlength="30" /><br/><br/> <input type="button" value="Submit" /> </form> <div class="bottom"> <a href="#top" title="Top of page">Top</a> </body> </html> Header <title>HTML localization example file</title> <meta http-equiv="content-type" content="text/html; charset=ISO "> <meta name="author" content="Daniel Zielinski"> <meta name="keywords" content="HTML Software localization Website"> <meta name="description" lang="en" content="This file should give you an example of how complex web page localization can be."> <link rel="stylesheet" type="text/css" href="./ecolotrain.css"> Character set Keywords Description Style sheets

26 HTML: Example: Body: H1-6, DIV, P
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " <html> <head> <title>HTML localization example file</title> <meta http-equiv="content-type" content="text/html; charset=ISO "> <meta name="author" content="Daniel Zielinski"> <meta name="keywords" content="HTML Software localization Website"> <meta name="description" lang="en" content="This file should give you an example of how complex web page localization can be."> <link rel="stylesheet" type="text/css" href="./ecolotrain.css"> </head> <body> <a name="top" /> <div> <h1>HTML localization Example</h1> <p> Some text to be localized in the first paragraph. For more information please visit the <a href=" title="Click here to get an overview about important issues in localization">eCoLoTrain website</a>. </p> </div> <img src="./user.gif" alt="User icon" title="User icon for demonstration" longDesc="This icon shows you how a user in Asia looks like" /><br/><br/> <b>A form:</b><br/><br/> <form action="./result.html" method="get" accept-charset="ISO "> Title: <select name="field0" size="1"> <option value="male">Mr.</option> <option value="female">Mrs.</option> </select> <br/> Name: <input name="field1" type="text" size="30" maxlength="30" /><br/> Address: <textarea>Type your address here...</textarea><br/> <input name="field1" type="text" size="30" maxlength="30" /><br/><br/> <input type="button" value="Submit" /> </form> <div class="bottom"> <a href="#top" title="Top of page">Top</a> </body> </html> Body <div> <h1>HTML localization Example</h1> <p> Some text to be localized in the first paragraph. For more information please visit the <a href=" title="Click here to get an overview about important issues in localization">eCoLoTrain website</a>. </p> </div> Structure tags

27 HTML: Example: A HREF Hyperlinks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " <html> <head> <title>HTML localization example file</title> <meta http-equiv="content-type" content="text/html; charset=ISO "> <meta name="author" content="Daniel Zielinski"> <meta name="keywords" content="HTML Software localization Website"> <meta name="description" lang="en" content="This file should give you an example of how complex web page localization can be."> <link rel="stylesheet" type="text/css" href="./ecolotrain.css"> </head> <body> <a name="top" /> <div> <h1>HTML localization Example</h1> <p> Some text to be localized in the first paragraph. For more information please visit the <a href=" title="Click here to get an overview about important issues in localization">eCoLoTrain website</a>. </p> </div> <img src="./user.gif" alt="User icon" title="User icon for demonstration" longDesc="This icon shows you how a user in Asia looks like" /><br/><br/> <b>A form:</b><br/><br/> <form action="./result.html" method="get" accept-charset="ISO "> Title: <select name="field0" size="1"> <option value="male">Mr.</option> <option value="female">Mrs.</option> </select> <br/> Name: <input name="field1" type="text" size="30" maxlength="30" /><br/> Address: <textarea>Type your address here...</textarea><br/> <input name="field1" type="text" size="30" maxlength="30" /><br/><br/> <input type="button" value="Submit" /> </form> <div class="bottom"> <a href="#top" title="Top of page">Top</a> </body> </html> Hyperlinks <a href=" title="Click here to get an overview about important issues in localization">eCoLoTrain website</a> Link target Link title Link text

28 HTML: Example: IMG Graphics
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " <html> <head> <title>HTML localization example file</title> <meta http-equiv="content-type" content="text/html; charset=ISO "> <meta name="author" content="Daniel Zielinski"> <meta name="keywords" content="HTML Software localization Website"> <meta name="description" lang="en" content="This file should give you an example of how complex web page localization can be."> <link rel="stylesheet" type="text/css" href="./ecolotrain.css"> </head> <body> <a name="top" /> <div> <h1>HTML localization Example</h1> <p> Some text to be localized in the first paragraph. For more information please visit the <a href=" title="Click here to get an overview about important issues in localization">eCoLoTrain website</a>. </p> </div> <img src="./user.gif" alt="User icon" title="User icon for demonstration" longDesc="This icon shows you how a user in Asia looks like" /><br/><br/> <b>A form:</b><br/><br/> <form action="./result.html" method="get" accept-charset="ISO "> Title: <select name="field0" size="1"> <option value="male">Mr.</option> <option value="female">Mrs.</option> </select> <br/> Name: <input name="field1" type="text" size="30" maxlength="30" /><br/> Address: <textarea>Type your address here...</textarea><br/> <input name="field1" type="text" size="30" maxlength="30" /><br/><br/> <input type="button" value="Submit" /> </form> <div class="bottom"> <a href="#top" title="Top of page">Top</a> </body> </html> Graphics <img src="./user.gif" alt="User icon" title="User icon for demonstration" longDesc="This icon shows you how a user in Asia looks like" /> Path Alt text Title Description

29 HTML: Example: FORM, INPUT, TEXTAREA, SELECT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " <html> <head> <title>HTML localization example file</title> <meta http-equiv="content-type" content="text/html; charset=ISO "> <meta name="author" content="Daniel Zielinski"> <meta name="keywords" content="HTML Software localization Website"> <meta name="description" lang="en" content="This file should give you an example of how complex web page localization can be."> <link rel="stylesheet" type="text/css" href="./ecolotrain.css"> </head> <body> <a name="top" /> <div> <h1>HTML localization Example</h1> <p> Some text to be localized in the first paragraph. For more information please visit the <a href=" title="Click here to get an overview about important issues in localization">eCoLoTrain website</a>. </p> </div> <img src="./user.gif" alt="User icon" title="User icon for demonstration" longDesc="This icon shows you how a user in Asia looks like" /><br/><br/> <b>A form:</b><br/><br/> <form action="./result.html" method="get" accept-charset="ISO "> Title: <select name="field0" size="1"> <option value="male">Mr.</option> <option value="female">Mrs.</option> </select> <br/> Name: <input name="field1" type="text" size="30" maxlength="30" /><br/> Address: <textarea>Type your address here...</textarea><br/> <input name="field1" type="text" size="30" maxlength="30" /><br/><br/> <input type="button" value="Submit" /> </form> <div class="bottom"> <a href="#top" title="Top of page">Top</a> </body> </html> Forms <b>A form:</b><br/><br/> <form action="./result.html" method="get" accept-charset="ISO "> Title: <select name="field0" size="1"> <option value="male">Mr.</option> <option value="female">Mrs.</option> </select> <br/> Name: <input name="field1" type="text" size="30" maxlength="30" /><br/> Address: <textarea>Type your address here...</textarea><br/> <input name="field1" type="text" size="30" maxlength="30" /><br/><br/> <input type="button" value="Submit" /> </form> Caption Input fields Selection fields Check boxes Text fields Buttons

30 HTML: Example: Entities
Specific characters in HTML have special functions, e.g. brackets indicate tags The following characters have to be escaped in HTML & with the character string & ("Ampersand") < with the character string < ("lower than") > with the character string > ("greater than") Character strings are referred to as HTML entities Entities can be also used to escape special characters: ä (“umlaut“) for ä szlig; for ß ç for ç

31 HTML: Example: CSS Formatting body { background-color:#efefef; } div {
font-family: arial; font-size: 11px; font-color:#000000; div.bottom { margin-top:800px; form { background-color:#ffffff; border-style:solid; border-color:#d7d7d7; border-width:1px; padding:5px; width: 290px; img { background-color:#d7d7d7; list-style-type: decimal lower-roman upper-roman lower-alpha oder lower-latin upper-alpha oder upper-latin disc circle square Font size Font family Font colour Size specification List formatting

32 HTML: Example: JavaScript
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " <html> <head> <title>HTML localization example file</title> <meta http-equiv="content-type" content="text/html; charset=ISO "> <meta name="author" content="Daniel Zielinski"> <meta name="keywords" content="HTML Software localization Website"> <meta name="description" lang="en" content="This file should give you an example of how complex web page localization can be."> <link rel="stylesheet" type="text/css" href="./ecolotrain.css"> <script type="text/javascript"> function chkFormular () { if (document.Hallo.Name.value == "") { alert("Please tell me your name!"); document.Formular.User.focus(); return false; } </script> </head> <body> <div> <h1>HTML localization Example</h1> </div> <img src="./user.gif" alt="User icon" title="User icon for demonstration" longDesc="This icon shows you how a user in Asia looks like" /><br/><br/> <b>A form:</b><br/><br/> <form name="Hallo" action="" method="GET" accept-charset="ISO " onsubmit="return chkFormular()" > Title: <select name="field0" size="1"> <option value="male">Mr.</option> <option value="female">Mrs.</option> </select> <br/> Name: <input name="Name" type="text" size="30" maxlength="30" ><br/> Address: <textarea rows="3" cols="20">Type your address here...</textarea><br/> <input name="field1" type="text" size="30" maxlength="30" ><br/><br/> <input type="submit" value="Submit" > </form> </body> </html> Embedded scripts <script type="text/javascript"> function chkFormular () { if (document.Hallo.Name.value == "") { alert("Please tell me your name!"); document.Formular.User.focus(); return false; } </script> <form name="Hallo" action="" method="GET" accept-charset="ISO " onsubmit="return chkFormular()" >

33 HTML: Localization: Challenges
Localization of web pages time-consuming Hypertext documents Text, graphics, sound and video files Style sheets Scripts Adaptation of forms Adaptation of design Update Knowledge in different areas needed

34 Separation of content and form Structure: <tags> + text
XML Open standard for structured representation of contents and its relations Separation of content and form Structure: <tags> + text Free definition of tag names DTDs and schemas for definition of elements, attributes and attribute values Specific characters have to be escaped: <  < and > > Free structure

35 XML: Structure XML Declaration <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE buch SYSTEM "buch.dtd"> <dokument> <kapitel> <ueberschrift>Überschrift</ueberschrift> <absatz id=“1“> Erster Satz. Zweiter Satz. </absatz> <absatz id=“2“> Ein satz im <fett>zweiten Absatz.</fett> <!-- Kommentar-Text --> </kapitel> </dokument> DTD/Schema Description of structure Determination of allowed elements and attributes Elements Opening tags + closing tags Attributes - Attribute names - Attribute values Comments Well-formed XML document: no overlapping tags, all tags closed Valid XML document: Structure corresponds to DTD/ schema

36 first sentence.. second sentence.
XML: Document view Heading First sentence. Second sentence. A sentence in the second paragraph. <document> <chapter> <heading>Heading</heading> <paragraph> First sentence. Second sentence. </paragraph> A sentence in the <bold>second paragraph.</bold> </chapter> </document> document chapter heading paragraph paragraph heading first sentence.. second sentence. a sentence bold . second paragraph

37 XML: Data view <resources>
<string id="Dialog.Caption">Info about JavaSample</string> <string id="Dialog.Label1">JavaSample 1.0</string> <string id="Dialog.Label2">Copyright (C) 2005</string> <string id="Dialog.OKButton">OK</string> </resources> XML as resource format resources string id=Dialog.Caption string id=Dialog.Label1 string id=Dialog.Label2 string id=Dialog.OKButton Info about JavaSample JavaSample 1.0 Copyright (C) 2005 OK

38 XML: Representations XML as resource format
<resources> <string id="Dialog.Caption">Info about JavaSample</string> <string id="Dialog.Label1">JavaSample 1.0</string> <string id="Dialog.Label2">Copyright (C) 2005</string> <string id="Dialog.OKButton">OK</string> </resources> XML as resource format Several possibilities for structuring XML <resources> <string><id>Dialog.Caption</id><data>Info about JavaSample</data></string> <string <id>Dialog.Label1</id><data>JavaSample 1.0</data></string> <string <id>Dialog.Label2</id><data>Copyright (C) 2005</data></string> <string <id>Dialog.OKButton</id><data>OK</data></string> </resources> Same information, different structure <resources> <string id="Dialog.Caption" data="Info about JavaSample"</string> <string id="Dialog.Label1" data="JavaSample 1.0"</string> <string id="Dialog.Label2" data="Copyright (C) 2005"</string> <string id="Dialog.OKButton" data="OK"</string> </resources> Texts in attribute fields, empty elements <resources> <Dialog.Caption>Info about JavaSample</Dialog.Caption> <Dialog.Label1>JavaSample 1.0</Dialog.Label1> <Dialog.Label2>Copyright (C) 2005</Dialog.Label2> <Dialog.OKButton>OK</Dialog.OKButton> </resources> XML?

39 XML: Complex files XML as resource format
<?xml version="1.0" encoding="UTF-8"?> <stringlist> <region xml:lang="en"> <group type="error"> <string id="2000"> <text>Cannot open file!</text> </string> <string id="2001"> <text>Not enough memory to perform operation. Close one or more applications.</text> </group> <group type="message"> <string id="3000"> <text>Do you want to close the application?</text> <alt-trans> <trans>Wollen Sie die Anwendung schliessen?</trans> <trans>Soll die Anwendung beendet werden?</trans> </alt-trans> <string id="3002"> <text>%1 files have been deleted.</text> <group type="debug"> <string id="4000"> <text>%1: Flags %2, Ref %3</text> <string id="4001"> <text>DBG: filehandle %1, openflags %2</text> </region> <region xml:lang="de"> <text>Datei kann nicht geöffnet werden!</text> <text>Nicht genügend Speicher, um Aktion durchzuführen. Schließen Sie eine oder mehrere Anwendungen.</text> </stringlist> XML as resource format

40 XML: Complex Files: Localizable elements
<?xml version="1.0" encoding="UTF-8"?> <stringlist> <region xml:lang="en"> <group type="error"> <string id="2000"> <text>Cannot open file!</text> </string> <string id="2001"> <text>Not enough memory to perform operation. Close one or more applications.</text> </group> <group type="message"> <string id="3000"> <text>Do you want to close the application?</text> <alt-trans> <trans>Wollen Sie die Anwendung schliessen?</trans> <trans>Soll die Anwendung beendet werden?</trans> </alt-trans> <string id="3002"> <text>%1 files have been deleted.</text> <group type="debug"> <string id="4000"> <text>%1: Flags %2, Ref %3</text> <string id="4001"> <text>DBG: filehandle %1, openflags %2</text> </region> <region xml:lang="de"> <text>Datei kann nicht geöffnet werden!</text> <text>Nicht genügend Speicher, um Aktion durchzuführen. Schließen Sie eine oder mehrere Anwendungen.</text> </stringlist> XML as resource format

41 XML: Complex Files: IDs
<?xml version="1.0" encoding="UTF-8"?> <stringlist> <region xml:lang="en"> <group type="error"> <string id="2000"> <text>Cannot open file!</text> </string> <string id="2001"> <text>Not enough memory to perform operation. Close one or more applications.</text> </group> <group type="message"> <string id="3000"> <text>Do you want to close the application?</text> <alt-trans> <trans>Wollen Sie die Anwendung schliessen?</trans> <trans>Soll die Anwendung beendet werden?</trans> </alt-trans> <string id="3002"> <text>%1 files have been deleted.</text> <group type="debug"> <string id="4000"> <text>%1: Flags %2, Ref %3</text> <string id="4001"> <text>DBG: filehandle %1, openflags %2</text> </region> <region xml:lang="de"> <text>Datei kann nicht geöffnet werden!</text> <text>Nicht genügend Speicher, um Aktion durchzuführen. Schließen Sie eine oder mehrere Anwendungen.</text> </stringlist> XML as resource format Update Alignment

42 XML: Complex Files: Bilingual contents
<?xml version="1.0" encoding="UTF-8"?> <stringlist> <region xml:lang="en"> <group type="error"> <string id="2000"> <text>Cannot open file!</text> </string> <string id="2001"> <text>Not enough memory to perform operation. Close one or more applications.</text> </group> <group type="message"> <string id="3000"> <text>Do you want to close the application?</text> <alt-trans> <trans>Wollen Sie die Anwendung schliessen?</trans> <trans>Soll die Anwendung beendet werden?</trans> </alt-trans> <string id="3002"> <text>%1 files have been deleted.</text> <group type="debug"> <string id="4000"> <text>%1: Flags %2, Ref %3</text> <string id="4001"> <text>DBG: filehandle %1, openflags %2</text> </region> <region xml:lang="de"> <text>Datei kann nicht geöffnet werden!</text> <text>Nicht genügend Speicher, um Aktion durchzuführen. Schließen Sie eine oder mehrere Anwendungen.</text> </stringlist> XML as resource format

43 XML: Complex Files: Resource grouping
<?xml version="1.0" encoding="UTF-8"?> <stringlist> <region xml:lang="en"> <group type="error"> <string id="2000"> <text>Cannot open file!</text> </string> <string id="2001"> <text>Not enough memory to perform operation. Close one or more applications.</text> </group> <group type="message"> <string id="3000"> <text>Do you want to close the application?</text> <alt-trans> <trans>Wollen Sie die Anwendung schliessen?</trans> <trans>Soll die Anwendung beendet werden?</trans> </alt-trans> <string id="3002"> <text>%1 files have been deleted.</text> <group type="debug"> <string id="4000"> <text>%1: Flags %2, Ref %3</text> <string id="4001"> <text>DBG: filehandle %1, openflags %2</text> </region> <region xml:lang="de"> <text>Datei kann nicht geöffnet werden!</text> <text>Nicht genügend Speicher, um Aktion durchzuführen. Schließen Sie eine oder mehrere Anwendungen.</text> </stringlist> XML as resource format

44 XML: Complex Files: Meta information
<?xml version="1.0" encoding="UTF-8"?> <stringlist> <region xml:lang="en"> <group type="error"> <string id="2000"> <text>Cannot open file!</text> </string> <string id="2001"> <text>Not enough memory to perform operation. Close one or more applications.</text> </group> <group type="message"> <string id="3000"> <text>Do you want to close the application?</text> <alt-trans> <trans>Wollen Sie die Anwendung schliessen?</trans> <trans>Soll die Anwendung beendet werden?</trans> </alt-trans> <string id="3002"> <text>%1 files have been deleted.</text> <group type="debug"> <string id="4000"> <text>%1: Flags %2, Ref %3</text> <string id="4001"> <text>DBG: filehandle %1, openflags %2</text> </region> <region xml:lang="de"> <text>Datei kann nicht geöffnet werden!</text> <text>Nicht genügend Speicher, um Aktion durchzuführen. Schließen Sie eine oder mehrere Anwendungen.</text> </stringlist> XML as resource format

45 Localization with TMs or software localization tools
XML: Localization Localization with TMs or software localization tools XML+DTD needed for translation Often complicated localization because of changing structures  Difficult to define localizable elements

46 Meta localization formats
Resource formats which can contain information on different resource formats and additional information Reasons for mixing resource formats: Parallel use of different development environments => resources in different resource formats (.po) Minimization of the number of different localization formats in workflow => use of meta formats (XLIFF)

47 Differences between localization formats:
XLIFF: Context Differences between localization formats: Structure Use of character sets Placeables Escape sequences Formatting Relief of localizers Idea of a consistent localization format independent of specific localization tools

48 XML localization Interchange File Format Open standard XML format
XLIFF XML localization Interchange File Format Open standard XML format Description in form of a Schema Bilingual approach Most important element <trans-unit> contains in <source> the information to be localized and in <target> the translation Possible inclusion of additional information Use as native localization format (e.g. in Macromedia Flash)

49 XLIFF 01 <?xml version="1.0"?> 02 <xliff version='1.1'> 03 <file datatype='winres' source-language='en' target-language='de'> 04 <body> <group id = '1' restype = 'menu' resname = '1'> <trans-unit id = '1' restype = 'menupopup' style = '0x10' ts = '0'> <source>&File</source> <target>&Datei</target> </trans-unit> <group restype = 'popup'> <trans-unit id = '2' resname = '9' restype = 'menuentry' ts = '1'> <source>&New</source> </trans-unit> <trans-unit id = '3' resname = '10' restype = 'menuentry' ts = '1'> <source>&Open...</source> </trans-unit> </group> <trans-unit id = '11' restype = 'menupopup' style = '0x10' ts = '0'> <source>&Edit</source> </trans-unit> <group restype = 'popup'> <trans-unit id = '12' resname = '25' restype = 'menuentry' ts = '1'> <source>&Undo Ctrl+Z</source> </trans-unit> </group> </group> </group> <group id = '2' restype = 'dialog' coord = '#;#;90;64' font='MS Sans Serif;8;0'> <trans-unit id = '30' restype = 'caption'> <source>Notepad</source> </trans-unit> <trans-unit id = '31' resname = '2' restype = 'button' coord = '29;44;32;14'> <source>Cancel</source> </trans-unit> <trans-unit id = '32' resname = '65535' restype = 'static' coord = '0;8;90;8'> <source>Now Printing</source> </trans-unit> <trans-unit id = '33' resname = '20' restype = 'static' coord = '0;18;90;8'> <source></source> </trans-unit> </group> 42 </body> 43 </file> 44 </xliff> <trans-unit id = '1' restype = 'menupopup' style = '0x10' ts = '0'> <source>&File</source> <target>&Datei</target> </trans-unit>

50 XLIFF: <group>-Element
01 <?xml version="1.0"?> 02 <xliff version='1.1'> 03 <file datatype='winres' source-language='en' target-language='de'> 04 <body> <group id = '1' restype = 'menu' resname = '1'> <trans-unit id = '1' restype = 'menupopup' style = '0x10' ts = '0'> <source>&File</source> <target>&Datei</target> </trans-unit> <group restype = 'popup'> <trans-unit id = '2' resname = '9' restype = 'menuentry' ts = '1'> <source>&New</source> </trans-unit> <trans-unit id = '3' resname = '10' restype = 'menuentry' ts = '1'> <source>&Open...</source> </trans-unit> </group> <trans-unit id = '11' restype = 'menupopup' style = '0x10' ts = '0'> <source>&Edit</source> </trans-unit> <group restype = 'popup'> <trans-unit id = '12' resname = '25' restype = 'menuentry' ts = '1'> <source>&Undo Ctrl+Z</source> </trans-unit> </group> </group> </group> <group id = '2' restype = 'dialog' coord = '#;#;90;64' font='MS Sans Serif;8;0'> <trans-unit id = '30' restype = 'caption'> <source>Notepad</source> </trans-unit> <trans-unit id = '31' resname = '2' restype = 'button' coord = '29;44;32;14'> <source>Cancel</source> </trans-unit> <trans-unit id = '32' resname = '65535' restype = 'static' coord = '0;8;90;8'> <source>Now Printing</source> </trans-unit> <trans-unit id = '33' resname = '20' restype = 'static' coord = '0;18;90;8'> <source></source> </trans-unit> </group> 42 </body> 43 </file> 44 </xliff> <group id = '1' restype = 'menu' resname = '1'> <trans-unit id = '1' restype = 'menupopup' style = '0x10' ts = '0'> <source>&File</source> <target>&Datei</target> </trans-unit> <group restype = 'popup'> <trans-unit id = '2' resname = '9' restype = 'menuentry' ts = '1'> <source>&New</source> </trans-unit> <trans-unit id = '3' resname = '10' restype = 'menuentry' ts = '1'> <source>&Open...</source> </trans-unit> </group> <trans-unit id = '11' restype = 'menupopup' style = '0x10' ts = '0'> <source>&Edit</source> </trans-unit> <group restype = 'popup'> <trans-unit id = '12' resname = '25' restype = 'menuentry' ts = '1'> <source>&Undo Ctrl+Z</source> </trans-unit> </group> </group> Hierarchical structuring defined by <group>-Elements

51 XLIFF: Supporting information
01 <?xml version="1.0"?> 02 <xliff version='1.1'> 03 <file datatype='winres' source-language='en' target-language='de'> 04 <body> <group id = '1' restype = 'menu' resname = '1'> <trans-unit id = '1' restype = 'menupopup' style = '0x10' ts = '0'> <source>&File</source> <target>&Datei</target> </trans-unit> <group restype = 'popup'> <trans-unit id = '2' resname = '9' restype = 'menuentry' ts = '1'> <source>&New</source> </trans-unit> <trans-unit id = '3' resname = '10' restype = 'menuentry' ts = '1'> <source>&Open...</source> </trans-unit> </group> <trans-unit id = '11' restype = 'menupopup' style = '0x10' ts = '0'> <source>&Edit</source> </trans-unit> <group restype = 'popup'> <trans-unit id = '12' resname = '25' restype = 'menuentry' ts = '1'> <source>&Undo Ctrl+Z</source> </trans-unit> </group> </group> </group> <group id = '2' restype = 'dialog' coord = '#;#;90;64' font='MS Sans Serif;8;0'> <trans-unit id = '30' restype = 'caption'> <source>Notepad</source> </trans-unit> <trans-unit id = '31' resname = '2' restype = 'button' coord = '29;44;32;14'> <source>Cancel</source> </trans-unit> <trans-unit id = '32' resname = '65535' restype = 'static' coord = '0;8;90;8'> <source>Now Printing</source> </trans-unit> <trans-unit id = '33' resname = '20' restype = 'static' coord = '0;18;90;8'> <source></source> </trans-unit> </group> 42 </body> 43 </file> 44 </xliff> <group id = '2' restype = 'dialog' coord = '#;#;90;64' font='MS Sans Serif;8;0'> <trans-unit id = '30' restype = 'caption'> <source>Notepad</source> </trans-unit> <trans-unit id = '31' resname = '2' restype = 'button' coord = '29;44;32;14'> <source>Cancel</source> </trans-unit> <trans-unit id = '32' resname = '65535' restype = 'static' coord = '0;8;90;8'> <source>Now Printing</source> </trans-unit> <trans-unit id = '33' resname = '20' restype = 'static' coord = '0;18;90;8'> <source></source> </trans-unit> </group>

52 XLIFF: Alternative translations
01 <?xml version="1.0"?> 02 <xliff version='1.1'> 03 <file datatype='winres' source-language='en' target-language='de'> 04 <body> <trans-unit id = '1'> <source>&Options</source> <alt-trans> <target>&Extras</target> <target>&Optionen</target> </alt-trans> </trans-unit> <trans-unit id = '2', translate = 'no'> <source>Copyright XYZ (C) 2004</source> </trans-unit> <trans-unit id = '3'> <source>Find</source> <note>Do not translate as Suchen</note> </trans-unit> 20 </body> 21 </file> 22 </xliff>

53 XLIFF: Labels 01 <?xml version="1.0"?>
02 <xliff version='1.1'> 03 <file datatype='winres' source-language='en' target-language='de'> 04 <body> <trans-unit id = '1'> <source>&Options</source> <alt-trans> <target>&Extras</target> <target>&Optionen</target> </alt-trans> </trans-unit> <trans-unit id = '2', translate = 'no'> <source>Copyright XYZ (C) 2004</source> </trans-unit> <trans-unit id = '3'> <source>Find</source> <note>Do not translate as Suchen</note> </trans-unit> 20 </body> 21 </file> 22 </xliff>

54 XLIFF: Comments 01 <?xml version="1.0"?>
02 <xliff version='1.1'> 03 <file datatype='winres' source-language='en' target-language='de'> 04 <body> <trans-unit id = '1'> <source>&Options</source> <alt-trans> <target>&Extras</target> <target>&Optionen</target> </alt-trans> </trans-unit> <trans-unit id = '2', translate = 'no'> <source>Copyright XYZ (C) 2004</source> </trans-unit> <trans-unit id = '3'> <source>Find</source> <note>Do not translate as Suchen</note> </trans-unit> 20 </body> 21 </file> 22 </xliff>

55 Typical localization workflow without XLIFF
XLIFF: Workflows Typical localization workflow without XLIFF Source:

56 Localization workflow with XLIFF
XLIFF: Workflows Localization workflow with XLIFF Source:

57 Automated localization workflow with XLIFF and CAT tools
XLIFF: Workflows Automated localization workflow with XLIFF and CAT tools Source:

58 // Goodbye. php if ($you == “tired“) {. $action = “patience“; } else {
// Goodbye.php if ($you == “tired“) { $action = “patience“; } else { $action = “attention“; } print “Thank you for your $action“; exit;


Download ppt "Characteristics, localization strategies"

Similar presentations


Ads by Google