Skip to content

Commit

Permalink
duplicated examples, fixed xlink namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dF authored and dF committed Jan 24, 2018
1 parent 9a01f2f commit 0abc8e6
Show file tree
Hide file tree
Showing 129 changed files with 2,434 additions and 70 deletions.
12 changes: 6 additions & 6 deletions docbook/T1/WG3/XLIFF-EM-BP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@
code. In HTML that can be <code>&lt;bold>text&lt;/bold></code>, in RTF <code>\b text
\b0</code>.</para>
<para>In XLIFF2 such code can be represented using <code><link
xlink:href="http://docs.oasis-open.org/xliff/xliff-core/v2.1/xliff-core-v2.1.html#sc"
xmlns:xlink="http://www.w3.org/1999/xlink">&lt;sc /></link></code>/<code><link
xlink:href="http://docs.oasis-open.org/xliff/xliff-core/v2.1/xliff-core-v2.1.html#ec"
xmlns:xlink="http://www.w3.org/1999/xlink">&lt;ec /></link></code> pair universally,
xl:href="http://docs.oasis-open.org/xliff/xliff-core/v2.1/xliff-core-v2.1.html#sc"
>&lt;sc /></link></code>/<code><link
xl:href="http://docs.oasis-open.org/xliff/xliff-core/v2.1/xliff-core-v2.1.html#ec"
>&lt;ec /></link></code> pair universally,
or by <code><link
xlink:href="http://docs.oasis-open.org/xliff/xliff-core/v2.1/xliff-core-v2.1.html#pc"
xmlns:xlink="http://www.w3.org/1999/xlink">&lt;pc>&lt;/pc></link></code> in case of
xl:href="http://docs.oasis-open.org/xliff/xliff-core/v2.1/xliff-core-v2.1.html#pc"
>&lt;pc>&lt;/pc></link></code> in case of
well formed spanning code.</para>
<para>Ideally the original format is documented enough to instruct Extractor about role of
each inline code. For example XML schema allows to declare elements using keyword EMPTY.
Expand Down
83 changes: 51 additions & 32 deletions docs/T1/WG3/XLIFF-EM-BP-ED.html

Large diffs are not rendered by default.

Binary file modified docs/T1/WG3/XLIFF-EM-BP-ED.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions docs/T1/WG3/extraction_examples/README.md
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.
19 changes: 19 additions & 0 deletions docs/T1/WG3/extraction_examples/cdata/bad.xlf
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>
10 changes: 10 additions & 0 deletions docs/T1/WG3/extraction_examples/cdata/good.xlf
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>
6 changes: 6 additions & 0 deletions docs/T1/WG3/extraction_examples/cdata/source.html
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>
17 changes: 17 additions & 0 deletions docs/T1/WG3/extraction_examples/context_hints/bad.xlf
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>
29 changes: 29 additions & 0 deletions docs/T1/WG3/extraction_examples/context_hints/good.xlf
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="&lt;a>"
equiv="[www.example.com]"
type="link" subFlows="u1" />
hyperlink
<ec disp="&lt;/a>" startRef="1"/>,
<sc id="2"
disp="&lt;i>"
type="fmt" subType="xlf:i" />
italics
<ec disp="&lt;/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>
8 changes: 8 additions & 0 deletions docs/T1/WG3/extraction_examples/context_hints/source.html
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 docs/T1/WG3/extraction_examples/editing_hints_canDelete/bad.xlf
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 docs/T1/WG3/extraction_examples/editing_hints_canDelete/good.xlf
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>
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>
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 docs/T1/WG3/extraction_examples/editing_hints_canOverlap/bad.xlf
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 docs/T1/WG3/extraction_examples/editing_hints_canOverlap/good.xlf
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>
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 docs/T1/WG3/extraction_examples/editing_hints_canReorder/bad.xlf
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>
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 docs/T1/WG3/extraction_examples/editing_hints_canReorder/good.xlf
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>
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>
35 changes: 35 additions & 0 deletions docs/T1/WG3/extraction_examples/group/bad.xlf
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>
51 changes: 51 additions & 0 deletions docs/T1/WG3/extraction_examples/group/good.xlf
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>
Loading

0 comments on commit 0abc8e6

Please sign in to comment.