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
{{ message }}
Repository navigation
Output from Date.getLocaleString('de') looks different on Windows #29338
changed the title [-]new Date.getLocaleString('de') looks different on Windows[/-][+]Output from Date.getLocaleString('de') looks different on Windows[/+]on Aug 27, 2019
I have not installed full-icu on my windows machine (at least npm ls does not find it and I do not remember ever installing it) and on the macOs it was not found either. I installed Node.js via the windows installer from https://nodejs.org/en/ with the default settings. I reproduced the behavior via node console, after I have seen the different output in my log file from my electron app.
I know that I did get the same output as on MacOs with electron 1.8.8 on this windows machine which should have contained node.js 8.2.1.
Are there settings in the windows installer that I should have changed from default in the newer versions?
No, you don't have to (and can't) tweak anything in the installer. The release binaries are all i18n-enabled but they only ship the English locale; the full-icu package contains all the other locales.
If you get proper localized output on your Mac, that means full-icu is installed. It's possible it's installed globally (npm install -g full-icu).
If you upgraded Node.js on your Windows machine, the full-icu package probably needs to be upgraded as well.
npm ls -g full-icu /usr/local/lib └── (empty) It does not seem to be installed on mac.
After installing full-icu globally on my windows machine I do not see any difference.
npm i full-icu -g
C:\Users\taeubnerm\AppData\Roaming\npm\node-full-icu-path -> C:\Users\taeubnerm\ AppData\Roaming\npm\node_modules\full-icu\node-icu-data.js
> [email protected] postinstall C:\Users\taeubnerm\AppData\Roaming\npm\node_modules \full-icu
> node postinstall.js
npm install icu4c-data@64l (Node 12.9.1 and small-icu 64.2) -> icudt64l.dat
full-icu$ C:\Program Files\nodejs\node.exe C:\Users\taeubnerm\AppData\Roaming\np m\node_modules\npm\bin\npm-cli.js install icu4c-data@64l
+ [email protected]
added 1 package from 1 contributor in 61.277s
√ icudt64l.dat (link)
Node will use this ICU datafile if the environment variable NODE_ICU_DATA is set to “C:\Users\taeubnerm\AppData\Roaming\npm\node_modules\full-icu”
or with node --icu-data-dir=C:\Users\taeubnerm\AppData\Roaming\npm\node_modules\full-icu YOURAPP.js
For package.json:
{"scripts":{"start":"node --icu-data-dir=C:\\Users\\taeubnerm\\AppData\\Roaming\\npm\\node_modules\\full-icu YOURAPP.js"}}
By the way, if you have full data, running this in node:
> new Intl.DateTimeFormat('es',{month:'long'}).format(new Date(9E8));
... will show “enero”. If it shows “January” you don't have full data.
News: Please see https://github.com/icu-project/full-icu-npm/issues/6
+ [email protected]
added 1 package from 1 contributor in 62.341s
$ node
Welcome to Node.js v12.9.1.
Type ".help" for more information.
> new Date().toLocaleString('de')
'2019-8-27 12:46:31'
>new Intl.DateTimeFormat('es',{month:'long'}).format(new Date(9E8));
'M01'
EDIT:
After reading again, I set the NODE_ICU_DATA env variable and started a new shell, and now it works with the node console. I guess I have to figure out how it works with electron now.
Activity
[-]new Date.getLocaleString('de') looks different on Windows[/-][+]Output from Date.getLocaleString('de') looks different on Windows[/+]bnoordhuis commentedon Aug 27, 2019
I suspect you have full-icu installed on one machine but not the other.
Either that or one of the node binaries is i18n-enabled while the other is not. Release binaries from https://nodejs.org/ are all i18n-enabled.
MareikeTaeubner commentedon Aug 27, 2019
I have not installed full-icu on my windows machine (at least npm ls does not find it and I do not remember ever installing it) and on the macOs it was not found either. I installed Node.js via the windows installer from https://nodejs.org/en/ with the default settings. I reproduced the behavior via node console, after I have seen the different output in my log file from my electron app.
I know that I did get the same output as on MacOs with electron 1.8.8 on this windows machine which should have contained node.js 8.2.1.
Are there settings in the windows installer that I should have changed from default in the newer versions?
bnoordhuis commentedon Aug 27, 2019
No, you don't have to (and can't) tweak anything in the installer. The release binaries are all i18n-enabled but they only ship the English locale; the full-icu package contains all the other locales.
If you get proper localized output on your Mac, that means full-icu is installed. It's possible it's installed globally (
npm install -g full-icu).If you upgraded Node.js on your Windows machine, the full-icu package probably needs to be upgraded as well.
MareikeTaeubner commentedon Aug 27, 2019
npm ls -g full-icu /usr/local/lib └── (empty)It does not seem to be installed on mac.After installing full-icu globally on my windows machine I do not see any difference.
EDIT:
After reading again, I set the NODE_ICU_DATA env variable and started a new shell, and now it works with the node console. I guess I have to figure out how it works with electron now.
Thank you for your help.
bnoordhuis commentedon Aug 27, 2019
I'm fairly sure electron bundles the full ICU data.
Happy to hear it's working now. I'll close out the issue.