fix(compiler): i18n - ignore alt-trans tags in XLIFF 1.2 (#33450)

The parser was accidentally reading the `target` tag
below the `alt-trans` target and overriding the correct
`target` tag.

(This already worked in `$localize` but a test has been
added to confirm.)

Fixes #33161

PR Close #33450
This commit is contained in:
Pete Bacon Darwin
2019-10-28 20:19:27 +00:00
committed by Andrew Kushnir
parent a3034ef92e
commit 936700ad9f
3 changed files with 54 additions and 0 deletions

View File

@ -25,6 +25,7 @@ const _MARKER_TAG = 'mrk';
const _FILE_TAG = 'file';
const _SOURCE_TAG = 'source';
const _SEGMENT_SOURCE_TAG = 'seg-source';
const _ALT_TRANS_TAG = 'alt-trans';
const _TARGET_TAG = 'target';
const _UNIT_TAG = 'trans-unit';
const _CONTEXT_GROUP_TAG = 'context-group';
@ -222,6 +223,7 @@ class XliffParser implements ml.Visitor {
// ignore those tags
case _SOURCE_TAG:
case _SEGMENT_SOURCE_TAG:
case _ALT_TRANS_TAG:
break;
case _TARGET_TAG: