feat(compiler): add "original" placeholder value on extracted XMB (#25079)
Update XMB placeholders(<ph>) to include the original value on top of an example. Placeholders can by definition have one example(<ex>) tag and a text node. The text node is used by TC as the "original" value from the placeholder, while the example should represent a dummy value. For example: <ph name="PET"><ex>Gopher</ex>{{ petName }}</ph>. This change makes sure that we have the original text, but it *DOES NOT* make sure that the example is correct. The example has the same wrong behavior of showing the interpolation text rather than a useful example. No breaking changes, but tools that depend on the previous behavior and don't consider the full XMB definition may fail to parse the XMB. Fixes b/72565847 PR Close #25079
This commit is contained in:

committed by
Igor Minar

parent
24789e9ad9
commit
e99d860393
@ -48,14 +48,14 @@ lines</p>`;
|
||||
<!ELEMENT ex (#PCDATA)>
|
||||
]>
|
||||
<messagebundle>
|
||||
<msg id="7056919470098446707"><source>file.ts:3</source>translatable element <ph name="START_BOLD_TEXT"><ex><b></ex></ph>with placeholders<ph name="CLOSE_BOLD_TEXT"><ex></b></ex></ph> <ph name="INTERPOLATION"><ex>{{ interpolation}}</ex></ph></msg>
|
||||
<msg id="2981514368455622387"><source>file.ts:4</source>{VAR_PLURAL, plural, =0 {<ph name="START_PARAGRAPH"><ex><p></ex></ph>test<ph name="CLOSE_PARAGRAPH"><ex></p></ex></ph>} }</msg>
|
||||
<msg id="7056919470098446707"><source>file.ts:3</source>translatable element <ph name="START_BOLD_TEXT"><ex><b></ex><b></ph>with placeholders<ph name="CLOSE_BOLD_TEXT"><ex></b></ex></b></ph> <ph name="INTERPOLATION"><ex>{{ interpolation}}</ex>{{ interpolation}}</ph></msg>
|
||||
<msg id="2981514368455622387"><source>file.ts:4</source>{VAR_PLURAL, plural, =0 {<ph name="START_PARAGRAPH"><ex><p></ex><p></ph>test<ph name="CLOSE_PARAGRAPH"><ex></p></ex></p></ph>} }</msg>
|
||||
<msg id="7999024498831672133" desc="d" meaning="m"><source>file.ts:5</source>foo</msg>
|
||||
<msg id="i" desc="d" meaning="m"><source>file.ts:6</source>foo</msg>
|
||||
<msg id="bar"><source>file.ts:7</source>foo</msg>
|
||||
<msg id="baz"><source>file.ts:8</source>{VAR_PLURAL, plural, =0 {{VAR_SELECT, select, other {<ph name="START_PARAGRAPH"><ex><p></ex></ph>deeply nested<ph name="CLOSE_PARAGRAPH"><ex></p></ex></ph>} } } }</msg>
|
||||
<msg id="6997386649824869937"><source>file.ts:9</source>Test: <ph name="ICU"><ex>{ count, plural, =0 {...} =other {...}}</ex></ph></msg>
|
||||
<msg id="5229984852258993423"><source>file.ts:9</source>{VAR_PLURAL, plural, =0 {{VAR_SELECT, select, other {<ph name="START_PARAGRAPH"><ex><p></ex></ph>deeply nested<ph name="CLOSE_PARAGRAPH"><ex></p></ex></ph>} } } =other {a lot} }</msg>
|
||||
<msg id="baz"><source>file.ts:8</source>{VAR_PLURAL, plural, =0 {{VAR_SELECT, select, other {<ph name="START_PARAGRAPH"><ex><p></ex><p></ph>deeply nested<ph name="CLOSE_PARAGRAPH"><ex></p></ex></p></ph>} } } }</msg>
|
||||
<msg id="6997386649824869937"><source>file.ts:9</source>Test: <ph name="ICU"><ex>{ count, plural, =0 {...} =other {...}}</ex>{ count, plural, =0 {...} =other {...}}</ph></msg>
|
||||
<msg id="5229984852258993423"><source>file.ts:9</source>{VAR_PLURAL, plural, =0 {{VAR_SELECT, select, other {<ph name="START_PARAGRAPH"><ex><p></ex><p></ph>deeply nested<ph name="CLOSE_PARAGRAPH"><ex></p></ex></p></ph>} } } =other {a lot} }</msg>
|
||||
<msg id="2340165783990709777"><source>file.ts:10,11</source>multi
|
||||
lines</msg>
|
||||
</messagebundle>
|
||||
|
Reference in New Issue
Block a user