app-localize-behavior icon indicating copy to clipboard operation
app-localize-behavior copied to clipboard

Support usage of lang attribute <html lang="fr"> as default language value

Open JaySunSyn opened this issue 7 years ago • 2 comments

  • <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?

JaySunSyn avatar Aug 06 '17 17:08 JaySunSyn

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?

JaySunSyn avatar Aug 14 '17 19:08 JaySunSyn

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)

notwaldorf avatar Feb 28 '18 20:02 notwaldorf