Skip to content

Commit

Permalink
fix: "deprecated" translation
Browse files Browse the repository at this point in the history
  • Loading branch information
laggingreflex committed Feb 21, 2020
1 parent 4c1ac6e commit d285bf8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/usage.js
Expand Up @@ -295,9 +295,11 @@ module.exports = function usage (yargs, y18n) {
if (~options.number.indexOf(key)) type = `[${__('number')}]`

const extra = [
(key in deprecatedOptions)
? `[${__('deprecated')}${typeof deprecatedOptions[key] === 'string'
? `: ${deprecatedOptions[key]}` : ''}]` : null,
(key in deprecatedOptions) ? (
typeof deprecatedOptions[key] === 'string'
? `[${__('deprecated: %s', deprecatedOptions[key])}]`
: `[${__('deprecated')}]`
) : null,
type,
(key in demandedOptions) ? `[${__('required')}]` : null,
options.choices && options.choices[key] ? `[${__('choices:')} ${
Expand Down
4 changes: 3 additions & 1 deletion locales/en.json
Expand Up @@ -44,5 +44,7 @@
"Did you mean %s?": "Did you mean %s?",
"Arguments %s and %s are mutually exclusive" : "Arguments %s and %s are mutually exclusive",
"Positionals:": "Positionals:",
"command": "command"
"command": "command",
"deprecated": "deprecated",
"deprecated: %s": "deprecated: %s"
}

0 comments on commit d285bf8

Please sign in to comment.