os-locale
Get the system locale
Last updated 11 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install os-locale 
SYNC missed versions from official npm registry.

os-locale

Get the system locale

[!NOTE] You may want new Intl.DateTimeFormat().resolvedOptions().locale instead. This package is useful for CLI tools as it also reads locale from environment variables (LC_ALL, LC_MESSAGES, LANG, LANGUAGE), which the Intl API does not fully support (it only respects LC_ALL).

Useful for localizing your module or app.

POSIX systems: The returned locale refers to the LC_MESSAGES category, suitable for selecting the language used in the user interface for message translation.

Install

npm install os-locale

Usage

import osLocale from 'os-locale';

console.log(osLocale());
//=> 'en-US'

API

osLocale()

Returns the locale.

Current Tags

  • 6.0.2                                ...           latest (4 years ago)

18 Versions

  • 6.0.2                                ...           4 years ago
  • 6.0.1                                ...           5 years ago
  • 6.0.0                                ...           5 years ago
  • 5.0.0                                ...           6 years ago
  • 4.0.0                                ...           7 years ago
  • 3.1.0                                ...           7 years ago
  • 3.0.1                                ...           8 years ago
  • 3.0.0                                ...           8 years ago
  • 2.1.0                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.4.0                                ...           11 years ago
  • 1.3.1                                ...           11 years ago
  • 1.3.0                                ...           11 years ago
  • 1.2.1                                ...           11 years ago
  • 1.2.0                                ...           11 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (3)

Copyright 2013 - present © cnpmjs.org | Home |