public class TextUnitMerger extends Object implements ITextUnitMerger
| Constructor and Description |
|---|
TextUnitMerger() |
| Modifier and Type | Method and Description |
|---|---|
void |
copyCodeMeta(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 |
copyTextPartMeta(List<TextPart> from,
List<TextPart> to,
String id)
|
Parameters |
getParameters() |
LocaleId |
getTargetLocale() |
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 copyTextPartMeta(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
copyTextPartMeta 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 void copyCodeMeta(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 TextFragment.TagType are the same.copyCodeMeta in interface ITextUnitMergerpublic 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 © 2021. All rights reserved.