get-user-locale icon indicating copy to clipboard operation
get-user-locale copied to clipboard

Unsupported locales

Open 0x54321 opened this issue 3 years ago • 3 comments

Hi, thanks for the great package. 🙂

I've noticed a couple of errors in my site's error log due to getUserLocale strings that are incompatible with the Intl.NumberFormat constructor. The ones that I've seen so far are:

  • C
  • posix
  • en-US,en

I'm not quite sure what systems are generating those locales, but they really should be filtered out, since they apparently aren't compatible with the Intl standard.

Cheers

0x54321 avatar Oct 19 '20 15:10 0x54321

Hi @0x54321, that's interesting! Do you have any more information, e.g. browser/OS on which these errors happened? That would be hugely helpful.

wojtekmaj avatar Oct 19 '20 16:10 wojtekmaj

Some recent examples - "en-US,en" was generated by Mac OS X 10.15.3 / Safari 13.0.5 and Windows 10 / Firefox 81.0 "en-US@posix" was generated by Linux / Chrome 80.0.3987

I can't find the info for "C", but I think it was also Linux-related.

0x54321 avatar Oct 19 '20 16:10 0x54321

I found one as well - Huawei's PetalBot search crawler apparently returns en-US.UTF-8 which blows up when you try to pass that to an Intl method.

osdiab avatar May 05 '21 06:05 osdiab

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

github-actions[bot] avatar Jul 03 '23 01:07 github-actions[bot]