On the internationalization of dynamic data #4037
Unanswered
toffeeBlock
asked this question in
Q&A
Replies: 1 comment
-
Try this instead: list.map(key => {
return msg(html`<components label=${key.label}></components>`);
}) The |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a component as follows:
where list is dynamically configured, possibly as follows:
When I use
@lit/localize
for internationalization, this is what I write:When I generate the xlf file via
lit-localize extract
, I get an error:Expected first argument to msg() to be a string or Lit template.
I tried to use
msg(html `${key.label}`)
to generate the xlf, and it doesn't give me an error, but it generatesThat is to say, no matter how I configure it, when switching languages, the label attribute can't be changed according to the current language, I would like to ask, is Lit currently unsupported this feature? Or is there something wrong with my writing style.
Currently I can only configure the xlf file manually according to the different label values, instead of using the lit-localize extract to generate it automatically!
I'm looking forward to a reply, thanks!
Beta Was this translation helpful? Give feedback.
All reactions