-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Description
lit-localize extract does not properly handle html calls within html within msg.
Steps to Reproduce
Include the following code
msg(html`Hello <b>${html`<i>World</i>`}</b>!`, {id: "foo"});And run lit-localize extract
Expected Results
<trans-unit id="foo">
<source>Hello <x id="0" equiv-text="<b>${html`<i>World</i>`}</b>"/>!</source>
</trans-unit>Actual Results
<trans-unit id="foo">
<source>Hello <x id="0" equiv-text="<b>"/>html `<x id="1" equiv-text="<i>"/>World<x id="2" equiv-text="</i>${`}</b>"/>!</source>
</trans-unit>Above results are for xliff format but similar results are seen for xlb format as well.
Workaround for now is probably not to use html within html to create a placeholder, something like
html`${msg('Hello')} <b><i>World</i></b>!`;though that doesn't allow a translator to switch the order if that's necessary. Perhaps #1890 would allow this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done