]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commit
refactor: improve locale detection
authorHaoqun Jiang <haoqunjiang@gmail.com>
Mon, 16 Oct 2023 17:21:02 +0000 (01:21 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Mon, 16 Oct 2023 17:21:02 +0000 (01:21 +0800)
commitd0cd083566fd0eee9ffcc85015ffab2fb551e169
treed663114d12130ceeccebca9b664f4176f888bf1c
parent8fbe012b377131d0eb8227d36bf2b0aa0b5e16d3
refactor: improve locale detection

ECMA-402 support in Node.js should be reliable now, as it's building
with full-icu by default since Node.js 13. So I made it the first
choice.

Actually, I'm not even sure if the remaining variables are still useful.
But if they are used, here are my modifications:

- As for POSIX environment variables, I chose `LC_MESSAGES` over
`LC_CTYPE`, as it better reflects the purpose of the usage (we are using
the detection result to show prompt messages).
- I removed `LANGSPEC` because I can't find any documentation of it except
for one single mention in Wikipedia. I can't find any real usage of it
on my Windows machine.
- As we no longer use `LC_CTYPE`, it seems that `C` is no longer a
possible value for `shellLocale`, so I removed the fallback check logic.

If no more bug reports of Windows users are received in the coming
months, I think we can remove the TODO comment entirely.
utils/getLanguage.ts