ecma402 icon indicating copy to clipboard operation
ecma402 copied to clipboard

Get current locale by new Intl.Locale() without tag.

Open WORMSS opened this issue 1 year ago • 3 comments

Is there any reason I need to do

new Intl.Locale(new Intl.DateTimeFormat().resolvedOptions().locale).weekInfo.firstDay

instead of just

new Intl.Locale().weekInfo.firstDay

to get the current locale?

WORMSS avatar Feb 03 '24 09:02 WORMSS

How would you like to handle a situation where because of available data your datetimeformat resolved locale is different from your numberformat resolved locale?

zbraniecki avatar Feb 04 '24 03:02 zbraniecki

This is requesting that new Intl.Locale() without a tag to return the DefaultLocale() . I think this is different from what this proposal intend to do - accessing information in a determined locale. Move to ECMA402 for discussion

FrankYFTang avatar Apr 25 '24 22:04 FrankYFTang

Previous discussions:

  • https://github.com/tc39/proposal-intl-locale/issues/15
  • https://github.com/tc39/proposal-intl-locale/issues/84

anba avatar Apr 26 '24 08:04 anba