Class TextUnitMerger

    • Constructor Detail

      • TextUnitMerger

        public TextUnitMerger()
    • Method Detail

      • mergeTargets

        public ITextUnit mergeTargets​(ITextUnit tuFromSkel,
                                      ITextUnit tuFromTran)
        Description copied from interface: ITextUnitMerger
        Merges the translated text unit to the one from the skeleton. Merges the text unit's target (under certain conditions).
        Specified by:
        mergeTargets in interface ITextUnitMerger
        Parameters:
        tuFromSkel - text unit from the skeleton (normally the original file)
        tuFromTran - text unit from the translation (default merger uses xliff 1.2)
        Returns:
        the merged text unit
      • copyTextPartMetadata

        public void copyTextPartMetadata​(List<TextPart> from,
                                         List<TextPart> to,
                                         String id)
        Description copied from interface: ITextUnitMerger
        Update the meta fields from TextPart'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

        Specified by:
        copyTextPartMetadata in interface ITextUnitMerger
        Parameters:
        from - 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 id
      • hasMeta

        public <T extends TextPart> boolean hasMeta​(T p)
      • copyCodeMetadata

        public void copyCodeMetadata​(TextFragment from,
                                     TextFragment to)
        Description copied from interface: ITextUnitMerger
        Update the meta fields in Code'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.
        Specified by:
        copyCodeMetadata in interface ITextUnitMerger
        Parameters:
        from - TextFragment codes are used to match codes in "to"
        to - TextFragment that has its code id's updated to match "from"
      • getTargetLocale

        public LocaleId getTargetLocale()