fix(compiler): add support for marker tags in xliff serializers (#21250)

The Xliff serializer now supports the tags `seg-source` and `mrk`, while the Xliff2 serializer now supports `mrk`.
Fixes #21078
PR Close #21250
This commit is contained in:
Olivier Combe
2018-01-02 11:19:16 +01:00
committed by Miško Hevery
parent 0d55600fd8
commit 02352bcd9e
4 changed files with 54 additions and 7 deletions

View File

@ -238,6 +238,24 @@ lines</source>
lignes</target>
</segment>
</unit>
<unit id="mrk-test">
<notes>
<note id="n1" appliesTo="target">Please check the translation for 'namespace'. On also can use 'espace de nom',but I think most technical manuals use the English term.</note>
</notes>
<segment>
<source>You use your own namespace.</source>
<target>Vous pouvez utiliser votre propre <mrk id="m1" type="comment" ref="#n1">namespace</mrk>.</target>
</segment>
</unit>
<unit id="mrk-test2">
<notes>
<note id="n1" appliesTo="target">Please check the translation for 'namespace'. On also can use 'espace de nom',but I think most technical manuals use the English term.</note>
</notes>
<segment>
<source>You use your own namespace.</source>
<target>Vous pouvez utiliser <mrk id="m1" type="comment" ref="#n1">votre propre <mrk id="m2" type="comment" ref="#n1">namespace</mrk></mrk>.</target>
</segment>
</unit>
</file>
</xliff>
`;
@ -289,7 +307,9 @@ lignes</target>
'5229984852258993423': '{VAR_PLURAL, plural, =0 {[{VAR_SELECT, select, other {[<ph' +
' name="START_PARAGRAPH"/>, profondément imbriqué, <ph name="CLOSE_PARAGRAPH"/>]}}, ]}, =other {[beaucoup]}}',
'2340165783990709777': `multi
lignes`
lignes`,
'mrk-test': 'Vous pouvez utiliser votre propre namespace.',
'mrk-test2': 'Vous pouvez utiliser votre propre namespace.'
});
});

View File

@ -221,6 +221,20 @@ lignes</target>
<context context-type="linenumber">12</context>
</context-group>
</trans-unit>
<trans-unit id="mrk-test">
<source>First sentence.</source>
<seg-source>
<invalid-tag>Should not be parsed</invalid-tag>
</seg-source>
<target>Translated <mrk mtype="seg" mid="1">first sentence</mrk>.</target>
</trans-unit>
<trans-unit id="mrk-test2">
<source>First sentence. Second sentence.</source>
<seg-source>
<invalid-tag>Should not be parsed</invalid-tag>
</seg-source>
<target>Translated <mrk mtype="seg" mid="1"><mrk mtype="seg" mid="2">first</mrk> sentence</mrk>.</target>
</trans-unit>
</body>
</file>
</xliff>
@ -273,7 +287,9 @@ lignes</target>
'{VAR_PLURAL, plural, =0 {[{VAR_SELECT, select, other {[<ph' +
' name="START_PARAGRAPH"/>, profondément imbriqué, <ph name="CLOSE_PARAGRAPH"/>]}}, ]}, =other {[beaucoup]}}',
'fcfa109b0e152d4c217dbc02530be0bcb8123ad1': `multi
lignes`
lignes`,
'mrk-test': 'Translated first sentence.',
'mrk-test2': 'Translated first sentence.'
});
});