app-localize-behavior
app-localize-behavior copied to clipboard
Support usage of lang attribute <html lang="fr"> as default language value
-
<my-localize-elem use-html-language>
to use the lang attribute of the html tag. (would be cool if defaulted to true) -
<my-localize-elem resource-url="/src/locals.json">
to auto load resource. (would be cool as well to be defaulted to this.resolveUrl('locales.json'))
Use document.documentElement.lang = "de"
to change the language within the whole app.
What do you think?
Thanks! Guess, we first need to agree on a concept.
We have 2 options here, the browser language navigator.language
and the language set in the html tag which reflects the default app (default?) language.
Would you only pick one of those and if, which one?
I'd prefer to use the browser language and as a fallback the language set on the html tag. Would you agree?
I think if I were to pick only one, it would be the language on the html
tag. navigator.language
isn't supported in IE11 and old Safari versions (so we can't use it)