A web component centric solution for i18n (inspired by pkaske/i18-n and ebidel/i18n-msg). Designed for individual web components that come with translations built into the component.
Changed to use navigator.languages[0] to get the browser language instead of navigator.language because Chrome sets navigator.language to the OS language instead of the preferred language set by the user in the browser.
Changes
This is a Chrome only issue.
navigator.languages[0]
to get the browser language instead ofnavigator.language
because Chrome setsnavigator.language
to the OS language instead of the preferred language set by the user in the browser.