Lit-localize is confusing me. #4489
Replies: 2 comments 2 replies
-
While code inside expression does not affect the ID generation, in cases of nested templates, it can affect However, changing those tsconfig compile options alone shouldn't really change things unless it resulted in a different source code being loaded due to the different module resolution mode. Based on the message, it seems like it found |
Beta Was this translation helpful? Give feedback.
-
I don't understand. Does that mean I need a different translation unit for each of these otherwise identical tagged strings?
|
Beta Was this translation helpful? Give feedback.
-
I've been working on the authentik SSO project, and we've been using lit-localize for about a year now in runtime mode, quite happily and successfully. Today, though, I hit something... bewildering.
In
tsconfig.json
, after changing from"module": "esnext", "moduleResolution": "node"
to"module": "nodenext", "moduleResolution": "nodenext"
,lit-localize extract
suddenly began reporting:But if I go look at the Polish file, I don't see any conflict.
The documentation says that "the code inside the expression does NOT affect the ID of the translation unit, only its position."
First, I take from this that, even if I changed the variable name, the translations files ought not to need manual intervention. That there's an expression in that position ought to be enough, right?
Second, why the heck would changing the module resolution mode eff up lit-localize this way?
I don't want to mark this as a bug (yet); I don't know what's causing it, I don't have a solid repro, and it may just be all on my end, but, like, what the heck?
Beta Was this translation helpful? Give feedback.
All reactions