Comparing version 3.19.0 to 3.20.0
## Change Log | ||
### v3.20.0 (2015/08/20 01:29 +00:00) | ||
- [#231](https://github.com/bcoe/yargs/pull/231) Merge pull request #231 from bcoe/detect-locale (@sindresorhus) | ||
- [#235](https://github.com/bcoe/yargs/pull/235) adds german translation to yargs (@maxrimue) | ||
### v3.19.0 (2015/08/14 05:12 +00:00) | ||
@@ -4,0 +8,0 @@ - [#224](https://github.com/bcoe/yargs/pull/224) added Portuguese translation (@codemonkey3045) |
var assert = require('assert') | ||
var Completion = require('./lib/completion') | ||
var osLocale = require('os-locale') | ||
var Parser = require('./lib/parser') | ||
@@ -21,3 +22,3 @@ var path = require('path') | ||
directory: path.resolve(__dirname, './locales'), | ||
locale: 'en', | ||
locale: osLocale.sync(), | ||
updateFiles: false | ||
@@ -409,2 +410,3 @@ }) | ||
self.locale = function (locale) { | ||
if (arguments.length === 0) return y18n.getLocale() | ||
y18n.setLocale(locale) | ||
@@ -411,0 +413,0 @@ return self |
@@ -176,8 +176,8 @@ // this file handles outputting usage instructions, | ||
var extra = [ | ||
type, | ||
demanded[key] ? '[' + __('required') + ']' : null, | ||
options.choices && options.choices[key] ? '[' + __('choices:') + ' ' + | ||
self.stringifiedValues(options.choices[key]) + ']' : null, | ||
defaultString(options.default[key], options.defaultDescription[key]) | ||
].filter(Boolean).join(' ') | ||
type, | ||
demanded[key] ? '[' + __('required') + ']' : null, | ||
options.choices && options.choices[key] ? '[' + __('choices:') + ' ' + | ||
self.stringifiedValues(options.choices[key]) + ']' : null, | ||
defaultString(options.default[key], options.defaultDescription[key]) | ||
].filter(Boolean).join(' ') | ||
@@ -184,0 +184,0 @@ ui.span( |
{ | ||
"name": "yargs", | ||
"version": "3.19.0", | ||
"version": "3.20.0", | ||
"description": "Light-weight option parsing with an argv hash. No optstrings attached.", | ||
@@ -17,12 +17,13 @@ "main": "./index.js", | ||
"decamelize": "^1.0.0", | ||
"os-locale": "^1.2.0", | ||
"window-size": "^0.1.1", | ||
"y18n": "^3.0.0" | ||
"y18n": "^3.1.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.0.0", | ||
"coveralls": "^2.11.2", | ||
"coveralls": "^2.11.4", | ||
"hashish": "0.0.4", | ||
"mocha": "^2.2.1", | ||
"nyc": "^3.1.0", | ||
"standard": "^5.0.2" | ||
"standard": "^5.1.0" | ||
}, | ||
@@ -29,0 +30,0 @@ "scripts": { |
@@ -653,6 +653,20 @@ yargs | ||
.locale() | ||
--------- | ||
Return the locale that yargs is currently using. | ||
By default, yargs will auto-detect the operating system's locale | ||
(via [os-locale](https://www.npmjs.com/package/os-locale)) so that | ||
yargs-generated help content will display in the user's language. | ||
To override this behavior with a static locale, pass the desired locale as a | ||
string to this method (see below). | ||
.locale(locale) | ||
--------------- | ||
Set a locale other than the default `en` locale: | ||
Override the auto-detected locale from the user's operating system with a static | ||
locale. Note that the OS locale can be modified by setting/exporting the `LC_ALL` | ||
environment variable. | ||
@@ -695,2 +709,3 @@ ```js | ||
* **de:** German. | ||
* **en:** American English. | ||
@@ -697,0 +712,0 @@ * **es:** Spanish. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123272
16
1625
1087
6
+ Addedos-locale@^1.2.0
+ Addedinvert-kv@1.0.0(transitive)
+ Addedlcid@1.0.0(transitive)
+ Addedos-locale@1.4.0(transitive)
Updatedy18n@^3.1.0