'lit web component localization using lit-translate

I am using lit-localization(https://www.npmjs.com/package/lit-translate) to change component language. But all documentations and demos are using typescript.

If anyone have done web component localization using lit-translate, please share it how you did it using javascript. If not what is the solution to localize my web component.

https://github.com/andreasbm/lit-translate



Solution 1:[1]

I could solve this issue following this document. using npm dedupe.

There shouldn't be multiple lit-html maintained inside node_modules folder. runing npm dedupe , it Searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree,

npm ls lit-html

a
+-- b <-- depends on [email protected]
|   `-- [email protected]
`-- d <-- depends on c@~1.0.9
    `-- [email protected]

npm dedupe

a
+-- b
+-- d
`-- [email protected]

so running npm dedupe solved my issue. Thanks.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rishni