Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.22 KB

index.md

File metadata and controls

37 lines (29 loc) · 1.22 KB

Documentation

API

import { getUserLocale } from 'win32-user-locale'

// getUserLocale returns undefined if the underlying
// GetLocaleInfoEx calll fails
const locale = getUserLocale() ?? 'en-US'

console.log(locale) // en-SE for example

Setup

$ git clone /~https://github.com/desktop/win32-user-locale
$ cd win32-user-locale
$ yarn

As this project builds a native module, you'll need these dependencies along with a recent version of Node:

  • Python
    • Let Python install for all users and (customized install) and _ensure the Add python.exe to Path option is selected.
  • One of Visual Studio 2019, Visual C++ Build Tools or Visual Studio 2019
    • Visual C++ Build Tools
      • Run npm config set msvs_version 2019 to tell node to use this toolchain.
    • Visual Studio 2019
      • Ensure you select the Desktop development with C++ feature as that is required by Node.js for installing native modules.
      • Run npm config set msvs_version 2019 to tell node to use this toolchain.