Initial commit
[yaffs-website] / node_modules / os-locale / readme.md
1 # os-locale [![Build Status](https://travis-ci.org/sindresorhus/os-locale.svg?branch=master)](https://travis-ci.org/sindresorhus/os-locale)
2
3 > Get the system [locale](http://en.wikipedia.org/wiki/Locale)
4
5 Useful for localizing your module or app.
6
7 POSIX systems: The returned locale refers to the [`LC_MESSAGE`](http://www.gnu.org/software/libc/manual/html_node/Locale-Categories.html#Locale-Categories) category, suitable for selecting the language used in the user interface for message translation.
8
9
10 ## Install
11
12 ```
13 $ npm install --save os-locale
14 ```
15
16
17 ## Usage
18
19 ```js
20 var osLocale = require('os-locale');
21
22 osLocale(function (err, locale) {
23         console.log(locale);
24         //=> 'en_US'
25 });
26 ```
27
28
29 ## API
30
31 ### osLocale([options], callback(error, locale))
32
33 ### osLocale.sync([options])
34
35 Returns the locale.
36
37 #### options.spawn
38
39 Type: `boolean`  
40 Default: `true`
41
42 Set to `false` to avoid spawning subprocesses and instead only resolve the locale from environment variables.
43
44
45 ## License
46
47 MIT © [Sindre Sorhus](http://sindresorhus.com)