feat(compiler): add location note to extracted xliff2 files (#16791)

Add source location as a note tag as `<note category="location">path/to/file.ts:start_line[,end_line]</note>`.
`[,end_line]` part is optional and specified only if the end line is different from the start line.

Fixes  #16531
This commit is contained in:
Olivier Combe
2017-05-22 20:20:45 +02:00
committed by Chuck Jazdzewski
parent 85d4c4b82e
commit 08dfe91b95
4 changed files with 111 additions and 10 deletions

View File

@ -88,17 +88,25 @@ const EXPECTED_XLIFF2 = `<?xml version="1.0" encoding="UTF-8" ?>
<notes>
<note category="description">desc</note>
<note category="meaning">meaning</note>
<note category="location">src/basic.ts:1</note>
</notes>
<segment>
<source>translate me</source>
</segment>
</unit>
<unit id="3492007542396725315">
<notes>
<note category="location">src/basic.ts:5</note>
<note category="location">src/entry_components.ts:1</note>
</notes>
<segment>
<source>Welcome</source>
</segment>
</unit>
<unit id="126808141597411718">
<notes>
<note category="location">node_modules/third_party/other_comp.d.ts:1,2</note>
</notes>
<segment>
<source>other-3rdP-component
multi-lines</source>