t2ym / i18n-element

I18N Base Element for Lit and Polymer
Other
9 stars 1 forks source link

Question. How I can change the language? #55

Closed alfonsorios96 closed 6 years ago

alfonsorios96 commented 6 years ago

I don't found information about methods and events for this component. I'm interesting in change language. If you can show me an example for that will be amazing ! Thanks

t2ym commented 6 years ago

As i18n-element is a wrapper class for i18n-behavior, you can find the documentation here other than the syntax for i18n-element.

Answer - How to change the language

document.querySelector('html').lang = 'ja'; // locale for the document

If observeHtmlLang property is false, the language for a specific element can be changed via element.lang = 'locale'.