Get OS's default locale language code.
The returned locale language code is normalized to the format "ll-cc":
- all lower cases
- _ is replaced with -
- ll is language code, cc is country code
npm install machine-locale
require("machine-locale")(function(err, locale) {
console.log(locale)
})
In windows, first run will take quite a while, due to the slowness of "systeminfo" command.