nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

NWJS doesn't report correct locale.

Open jingle-j-bells opened this issue 2 years ago • 3 comments

NWJS Version : v0.61.0 Operating System : Windows 10.

Expected behavior

Set "Windows display language" to "English (United States)" and "Regional format" to "Chinese (Simplified, China)", NWJS should report the locale to be 'zh-CN', like node does.

Actual behavior

  1. Console output from NWJS Intl.DateTimeFormat().resolvedOptions().locale 'en-US'
  2. Output from node:

Intl.DateTimeFormat().resolvedOptions().locale 'zh-CN'

jingle-j-bells avatar Mar 02 '22 10:03 jingle-j-bells

Thanks for reporting. What does Chromium/Chrome report in your system?

rogerwang avatar Mar 13 '22 20:03 rogerwang

Chrome reports according to its own settings:

chrome://settings/languages

jingle-j-bells avatar Mar 15 '22 02:03 jingle-j-bells

It seems the same is true for keyboard locales. It might be that the Keyboard API reports back based on the users system language, but not the keyboard language. This means when someone is using a en-US OS language, but a German keyboard layout (i.e. QWRETZ) the labels are all wrong when fetching from the layout map.

Is there a way to line argument nw.js to load a specific locale?

(All on windows btw)

Regiden avatar Apr 11 '22 08:04 Regiden