JavaScript - get the complete list of locales supported by the browser

后端 未结 2 2175
忘掉有多难
忘掉有多难 2021-02-19 03:59

I\'ve found supportedLocalesOf, but is there a way to get all supported locales, not just check which among a given list are supported?

The \'*\' tag option des

2条回答
  •  南方客
    南方客 (楼主)
    2021-02-19 04:51

    The locale used and the form of the string returned are entirely implementation-dependen. It uses a string with a BCP 47 language tag. It is somehow still related to unicode locale.

    You still can find the list of locales argument in Country Code list. But if some of the country code does not work, you can go UNICODE LOCALE DATA MARKUP LANGUAGE (LDML) to see the list of correct locales implemented there.

    Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation

提交回复
热议问题