We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should we have components with a locale property? (date-picker, input-date-picker, input)
locale
We have a few components using a locale property for specifying the locale to use for the component.
However, there's already a global attribute to handle this. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/lang#syntax
Currently, the default for the locale prop is set to use the document's lang or "en". like so:
/** BCP 47 language tag for desired language and country format */ @Prop() locale?: string = document.documentElement.lang || "en";
However, it should probably just use the lang on the host and if not specified, it should fallback to use any element.closest('[lang]').lang and maybe even fallback to navigator.language if not set on the HTML. See https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language
lang
element.closest('[lang]').lang
navigator.language
Does this sound correct?
cc @eriklharper
The text was updated successfully, but these errors were encountered:
I agree. This is quite similar to the page theme. It is basically a global that all our components should be aware of.
Sorry, something went wrong.
This makes sense. We can deprecate locale props and remove prior to 1.0.0 since it wouldn't affect the behavior.
Fixed by #3354
No branches or pull requests
Question
Should we have components with a
locale
property? (date-picker, input-date-picker, input)Helpful Details
We have a few components using a
locale
property for specifying the locale to use for the component.However, there's already a global attribute to handle this. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/lang#syntax
Currently, the default for the
locale
prop is set to use the document's lang or "en". like so:However, it should probably just use the
lang
on the host and if not specified, it should fallback to use anyelement.closest('[lang]').lang
and maybe even fallback tonavigator.language
if not set on the HTML. See https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/languageDoes this sound correct?
cc @eriklharper
The text was updated successfully, but these errors were encountered: