You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prioritize enviornment variables over Intl.DateTimeFormat
While `Intl.DateTimeFormat` should be the most reliable way to get the
user's locale, it lacks flexibility.
For example, on Windows PowerShell, there's no way to change the
detection result in-session (you have to logout and login again).
So in order to provide an escape hatch for developers and users who
want to temporarily change the locale, we prioritize environment
variables over `Intl.DateTimeFormat`.
In POSIX shells, you can do `LANG=zh_CN.UTF-8` to change the locale to
Chinese;
In CMD, it's `set LANG=zh_CN.UTF-8`;
In PowerShell, it's `$env:LANG = 'zh_CN.UTF-8'`.
Closes#369
0 commit comments