public class TextUnitMerger extends Object implements ITextUnitMerger
| Constructor and Description |
|---|
TextUnitMerger() |
| Modifier and Type | Method and Description |
|---|---|
void |
copyCodeMetadata(TextFragment from,
TextFragment to)
Update the meta fields in
Code's "to" that match those of
"from" But only if the "to" code has empty data. |
void |
copyTextPartMetadata(List<TextPart> from,
List<TextPart> to,
String id)
|
Parameters |
getParameters() |
LocaleId |
getTargetLocale() |
<T extends TextPart> |
hasMeta(T p) |
ITextUnit |
mergeTargets(ITextUnit tuFromSkel,
ITextUnit tuFromTran)
Merges the translated text unit to the one from the skeleton.
|
void |
setParameters(Parameters params) |
void |
setTargetLocale(LocaleId trgLoc) |
public ITextUnit mergeTargets(ITextUnit tuFromSkel, ITextUnit tuFromTran)
ITextUnitMergermergeTargets in interface ITextUnitMergertuFromSkel - text unit from the skeleton (normally the original
file)tuFromTran - text unit from the translation (default merger uses
xliff 1.2)public void copyTextPartMetadata(List<TextPart> from, List<TextPart> to, String id)
ITextUnitMergerTextPart's in "to" that match
those of "from"
WARNING: Not all TextParts have id's to match on. Fallback is to match on data, but this can be ambiguous in rare cases
copyTextPartMetadata in interface ITextUnitMergerfrom - list of TextPart codes are used to match codes in "to"to - list of TextPart that has its code id's updated to match
"from"id - parent TextUnit idpublic <T extends TextPart> boolean hasMeta(T p)
public void copyCodeMetadata(TextFragment from, TextFragment to)
ITextUnitMergerCode's "to" that match those of
"from" But only if the "to" code has empty data. Otherwise keep the
to code data as-is. Codes match if both data and TagType are the
same.copyCodeMetadata in interface ITextUnitMergerfrom - TextFragment codes are used to match codes in "to"to - TextFragment that has its code id's updated to match
"from"public void setTargetLocale(LocaleId trgLoc)
setTargetLocale in interface ITextUnitMergerpublic LocaleId getTargetLocale()
public Parameters getParameters()
getParameters in interface ITextUnitMergerpublic void setParameters(Parameters params)
setParameters in interface ITextUnitMergerCopyright © 2022. All rights reserved.