-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
duplicated examples, fixed xlink namespace
- Loading branch information
dF
authored and
dF
committed
Jan 24, 2018
1 parent
9a01f2f
commit 0abc8e6
Showing
129 changed files
with
2,434 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Extraction (and merging) best practices | ||
=== | ||
|
||
Repository of different approaches for extracting localizable content into XLIFF2. | ||
|
||
New samples and feedback on existing ones via [pull request](https://help.github.com/articles/about-pull-requests/) or via [commit comments](https://github.com/blog/42-commit-comments) is welcomed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<xliff version='2.0' xmlns='urn:oasis:names:tc:xliff:document:2.0' srcLang="en-US" trgLang="sk-SK"> | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<segment> | ||
<source><![CDATA[<b>bold</b> text]]></source> | ||
<target><![CDATA[text <b>tučným</b>]]></target> | ||
<!-- inline content does not enjoy benefits of proper extraction, | ||
such as correct representation in CAT tool and protection during | ||
the round-trip. It's not possible to use native XLIFF validation | ||
artifacts--> | ||
<!-- It's legal for Modifier to change CDATA into normal escaped content. | ||
Merger has to be able to accept such change | ||
--> | ||
<!-- http://docs.oasis-open.org/xliff/xliff-core/v2.1/xliff-core-v2.1.html#d0e8112 (4.4 CDATA sections)--> | ||
<!-- https://www.w3.org/TR/xml-i18n-bp/#AuthCDATA --> | ||
</segment> | ||
</unit> | ||
</file> | ||
</xliff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<xliff version='2.0' xmlns='urn:oasis:names:tc:xliff:document:2.0' srcLang="en-US" trgLang="sk-SK"> | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<segment> | ||
<source><pc id="1">bold</pc> text</source> | ||
<target>text <pc id="1">tučným</pc></target> | ||
</segment> | ||
</unit> | ||
</file> | ||
</xliff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head></head> | ||
<body>bold <b>text</b></body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en-US"> | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<segment> | ||
<source>a link</source> | ||
</segment> | ||
</unit> | ||
<unit id="u2"> | ||
<segment> | ||
<source>A text with <pc id="1">hyperlink</pc>, <pc id="2">italics</pc> and some | ||
<ph id="3"/></source> | ||
<!-- No additional context is provided to translator, which could impact the | ||
quality of translation. Role of the inline tags is unknown.--> | ||
</segment> | ||
</unit> | ||
</file> | ||
</xliff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en-US"> | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<segment> | ||
<source>a link</source> | ||
</segment> | ||
</unit> | ||
<unit id="u2"> | ||
<segment> | ||
<!-- newlines added for readability --> | ||
<source>A text with | ||
<sc id="1" | ||
disp="<a>" | ||
equiv="[www.example.com]" | ||
type="link" subFlows="u1" /> | ||
hyperlink | ||
<ec disp="</a>" startRef="1"/>, | ||
<sc id="2" | ||
disp="<i>" | ||
type="fmt" subType="xlf:i" /> | ||
italics | ||
<ec disp="</i>" startRef="2"/> | ||
and some | ||
<ph id="3" disp="{placeholder}" equiv="[user name]" type="ui" subType="xlf:var"/></source> | ||
<!-- plethora of context hints helps translator to make accurate judgement --> | ||
</segment> | ||
</unit> | ||
</file> | ||
</xliff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title></title> | ||
</head> | ||
<body>A text with <a href="www.example.com" title="a link">hyperlink</a>, <i>italics</i> and some {placeholder}</body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
docs/T1/WG3/extraction_examples/editing_hints_canDelete/bad.xlf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<xliff version='2.0' xmlns='urn:oasis:names:tc:xliff:document:2.0' srcLang="en-US" trgLang="sk-SK"> | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<segment> | ||
<source>irrelevant <pc id="1">bold</pc> text and important <pc id="2">hyperlink</pc>, also a critical <ph id="3"/></source> | ||
<target>nepodstatný <pc id="1">tučný</pc>text a dôležity hyperlink, tiež </target> | ||
<!-- missing editing hints do not allow to distinguish between important and irrelevant inline codes, preventing native validation --> | ||
</segment> | ||
</unit> | ||
</file> | ||
</xliff> |
14 changes: 14 additions & 0 deletions
14
docs/T1/WG3/extraction_examples/editing_hints_canDelete/good.xlf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en-US" trgLang="sk-SK"> | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<segment> | ||
<source>irrelevant <pc canCopy="no" canDelete="yes" id="1">bold</pc> text and | ||
important <pc canCopy="no" canDelete="no" id="2">hyperlink</pc>, also a critical | ||
<ph canCopy="no" canDelete="no" id="3"/></source> | ||
<target>nepodstatný tučný text a dôležity <pc canCopy="no" canDelete="no" id="2" | ||
>hyperlink</pc>, tiež <ph canCopy="no" canDelete="no" id="3"/></target> | ||
<!-- canDelete is "yes" by default, thus can be committed. for pc id=1 included for clarity --> | ||
</segment> | ||
</unit> | ||
</file> | ||
</xliff> |
8 changes: 8 additions & 0 deletions
8
docs/T1/WG3/extraction_examples/editing_hints_canDelete/source.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title></title> | ||
</head> | ||
<body>irrelevant <b>bold</b> and important <a>hyperlink text</a>, also a critical {placeholder}</body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
docs/T1/WG3/extraction_examples/editing_hints_canOverlap/Invalid_bad.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title></title> | ||
</head> | ||
<body> | ||
<b>tučné<i></b> a kurzíva</i> | ||
<!-- malformed inline formatting tags --> | ||
</body> | ||
</html> |
21 changes: 21 additions & 0 deletions
21
docs/T1/WG3/extraction_examples/editing_hints_canOverlap/bad.xlf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<xliff version='2.0' xmlns='urn:oasis:names:tc:xliff:document:2.0' srcLang="en-US" trgLang="sk-SK"> | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<!-- whitespace added for readability --> | ||
<segment> | ||
<source><sc id="1" equiv="b"/> | ||
bold | ||
<ec startRef="1" equiv="/b"/> | ||
and | ||
<sc id="2" equiv="i"/> | ||
italic | ||
<ec startRef="2" equiv="/i"/></source> | ||
<target><sc id="1" equiv="b"/> <!-- opening bold --> | ||
tučné<sc id="2" equiv="i"/> <!-- opening italic --> | ||
<ec startRef="1" equiv="/b"/> <!-- closing bold --> | ||
a kurzíva | ||
<ec startRef="2" equiv="/i"/></target> <!-- closing italic --> | ||
</segment> | ||
</unit> | ||
</file> | ||
</xliff> |
26 changes: 26 additions & 0 deletions
26
docs/T1/WG3/extraction_examples/editing_hints_canOverlap/good.xlf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<xliff version='2.0' xmlns='urn:oasis:names:tc:xliff:document:2.0' srcLang="en-US" trgLang="sk-SK"> | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<!-- whitespace added for readability --> | ||
<segment> | ||
<source xml:space="preserve"><sc id="1" equiv="b" canOverlap="no"/> | ||
bold | ||
<ec startRef="1" equiv="/b" canOverlap="no"/> | ||
and | ||
<sc id="2" equiv="i" canOverlap="no" /> | ||
italic | ||
<ec startRef="2" equiv="/i" canOverlap="no" /></source> | ||
<target><sc id="1" equiv="b"/> | ||
tučné | ||
<ec startRef="1" equiv="/b" /> | ||
a | ||
<sc id="2" equiv="i" /> | ||
kurzíva | ||
<ec startRef="2" equiv="/i" /></target> | ||
<!-- native XLIFF validation can detect overlapping | ||
with canOverlap="yes" | ||
--> | ||
</segment> | ||
</unit> | ||
</file> | ||
</xliff> |
11 changes: 11 additions & 0 deletions
11
docs/T1/WG3/extraction_examples/editing_hints_canOverlap/source.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title></title> | ||
</head> | ||
<body> | ||
<b>bold</b> and <i>italic</i> | ||
<!-- well-formed inline formatting tags --> | ||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
docs/T1/WG3/extraction_examples/editing_hints_canReorder/bad.xlf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en-US" trgLang="sk-SK"> | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<segment> | ||
<!-- newlines added for readability --> | ||
<source><pc id="1"> <!-- link --> | ||
<pc id="2">this is linktext</pc> <!-- title --> | ||
<ph id="3"/> <!-- URI --> | ||
</pc></source> | ||
|
||
<target><pc id="1"></pc> <!-- link is empty --> | ||
<pc id="2">toto je linktext | ||
<ph id="3"/> <!-- URI is child of title --> | ||
</pc></target> | ||
<!-- missing canReorder prevents target validation --> | ||
</segment> | ||
</unit> | ||
</file> | ||
</xliff> |
8 changes: 8 additions & 0 deletions
8
docs/T1/WG3/extraction_examples/editing_hints_canReorder/bad_target.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<root> | ||
<link /> | ||
<!-- empty link --> | ||
<title>this is linktext <uri>http://example.com</uri> | ||
<!-- URI as a child of title --> | ||
</title> | ||
</root> |
17 changes: 17 additions & 0 deletions
17
docs/T1/WG3/extraction_examples/editing_hints_canReorder/good.xlf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<xliff version='2.0' xmlns='urn:oasis:names:tc:xliff:document:2.0' srcLang="en-US" trgLang="sk-SK"> | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<segment> | ||
<!-- newlines added for readability --> | ||
<source><pc id="1" canCopy="no" canDelete="no" canReorder="firstNo"> | ||
<pc id="2" canCopy="no" canDelete="no" canReorder="no">this is linktext</pc> | ||
<ph id="3" canCopy="no" canDelete="no" canReorder="no"/> | ||
</pc></source> | ||
<target><pc id="1" canCopy="no" canDelete="no" canReorder="firstNo"> | ||
<pc id="2" canCopy="no" canDelete="no" canReorder="no">toto je linktext</pc> | ||
<ph id="3" canCopy="no" canDelete="no" canReorder="no"/> | ||
</pc></target> | ||
</segment> | ||
</unit> | ||
</file> | ||
</xliff> |
8 changes: 8 additions & 0 deletions
8
docs/T1/WG3/extraction_examples/editing_hints_canReorder/source.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<root> | ||
<link> | ||
<title>this is linktext</title> | ||
<uri>http://example.com</uri> | ||
</link> | ||
<!-- <title> and <uri> are children of <link> with specified order --> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en-US" > | ||
<file id="f1"> | ||
<unit id="u1"> | ||
<segment> | ||
<source>First paragraph</source> | ||
</segment> | ||
</unit> | ||
<unit id="u2"> | ||
<segment> | ||
<source>Second paragraph</source> | ||
</segment> | ||
</unit> | ||
<unit id="u4"> | ||
<segment> | ||
<source>Firstname</source> | ||
</segment> | ||
</unit> | ||
<unit id="u5"> | ||
<segment> | ||
<source>Lastname</source> | ||
</segment> | ||
</unit> | ||
<unit id="u6"> | ||
<segment> | ||
<source>Age</source> | ||
</segment> | ||
</unit> | ||
<!-- Flat XLIFF structure does not provide additional context information | ||
possibly impairing the quality of the translation. Group can contain <notes> | ||
and has an extension point for elements from MDA, SLR, VAL and ITS modules | ||
and FS module attributes, thus narrowing the scope of the information | ||
contained in them. | ||
--> | ||
</file> | ||
</xliff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<xliff srcLang="en-US" version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0"> | ||
<file id="f1"> | ||
<group id="g1" name="main"> | ||
<!-- This group corresponds to div in the source doc. | ||
Units map to paragraphs. --> | ||
<unit id="u1"> | ||
<segment> | ||
<source>First paragraph</source> | ||
</segment> | ||
</unit> | ||
<unit id="u2"> | ||
<segment> | ||
<source>Second paragraph</source> | ||
</segment> | ||
</unit> | ||
</group> | ||
<group id="g2" name="table1"> | ||
<!-- Group corresponds to whole table --> | ||
<group id="g2_1"> | ||
<!-- Nested group corresponds to table header. | ||
Value of @id is arbitrary NMTOKEN and depends on Extractor. | ||
Units are table cells. Suitable approach if cells need additional | ||
segmentation | ||
--> | ||
<unit id="u4"> | ||
<segment> | ||
<source>Firstname</source> | ||
</segment> | ||
</unit> | ||
<unit id="u5"> | ||
<segment> | ||
<source>Lastname</source> | ||
</segment> | ||
</unit> | ||
<unit id="u6"> | ||
<segment> | ||
<source>Age</source> | ||
</segment> | ||
</unit> | ||
</group> | ||
<!-- Each additional table row would create new group --> | ||
<!-- Comparable approach would be to use <unit> for table row | ||
with canResegment="no", where each segment would represent | ||
a cell. This approach is suitable for short cell text. | ||
--> | ||
</group> | ||
<!-- Focus is on XLIFF core features. In this case it would be particularly suitable to use | ||
Format Style Module for additional context and to help render the preview. | ||
http://docs.oasis-open.org/xliff/xliff-core/v2.1/xliff-core-v2.1.html#fs-mod --> | ||
</file> | ||
</xliff> |
Oops, something went wrong.