XliffTranslation
loreline.translation.XliffTranslation (Class)
Converts XLIFF (1.2 or 2.x) file content into a Loreline translation file body.
XLIFF 1.2 layout:
<xliff version="1.2">
<file source-language="en" target-language="fr">
<body>
<trans-unit id="intro">
<source>Welcome to the cafe.</source>
<target>Bienvenue dans le café.</target>
</trans-unit>
</body>
</file>
</xliff>
XLIFF 2.x layout:
<xliff version="2.0" srcLang="en" trgLang="fr">
<file id="...">
<unit id="intro">
<segment>
<source>Welcome to the cafe.</source>
<target>Bienvenue dans le café.</target>
</segment>
</unit>
</file>
</xliff>
Locale filter:
- 1.2: only
<file target-language="<locale>"> is converted
- 2.x: the root
<xliff trgLang="<locale>"> must match
- If no target-language attribute is present anywhere, we take everything
(the file is assumed to be in the requested locale).
Empty/missing <target> -> entry skipped.
<target> must be valid Loreline body content. Its text is written
verbatim into the synthesised .lor and re-parsed by Loreline. See the
full rules in loreline.translation.TranslationFormats.
Static Members
Generates an XLIFF 1.2 file body for the given source script and
locale. If existing is provided, entries already present there are
preserved as the <target> value; otherwise the <target> defaults to
the source text (placeholder).
Private Members
Matches the file's target-language against the requested locale.
Accepts an exact match OR a primary-language match
(e.g. file "fr-FR" matches request "fr", and vice versa).
innerText(node: Xml): String
escapeForXmlText(s: String): String
writeEntry(buf: loreline.Utf8Buf, id: String, src: String, tgt: String): Void