Skip to content

Commit bf46813

Browse files
jandockxBenjamin E. Coe
authored andcommitted
fix(i18n): rename unclear 'implication failed' to 'missing dependent arguments' (#1317)
1 parent a3a5d05 commit bf46813

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed

locales/de.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"Invalid values:": "Unzulässige Werte:",
3030
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s",
3131
"Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s",
32-
"Implications failed:": "Implikationen fehlgeschlagen:",
32+
"Implications failed:": "Fehlende abhängige Argumente:",
3333
"Not enough arguments following: %s": "Nicht genügend Argumente nach: %s",
3434
"Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s",
3535
"Path to JSON config file": "Pfad zur JSON-Config Datei",

locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"Invalid values:": "Invalid values:",
3030
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s",
3131
"Argument check failed: %s": "Argument check failed: %s",
32-
"Implications failed:": "Implications failed:",
32+
"Implications failed:": "Missing dependent arguments:",
3333
"Not enough arguments following: %s": "Not enough arguments following: %s",
3434
"Invalid JSON config file: %s": "Invalid JSON config file: %s",
3535
"Path to JSON config file": "Path to JSON config file",

locales/fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"Invalid values:": "Valeurs invalides:",
2929
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s",
3030
"Argument check failed: %s": "Echec de la vérification de l'argument: %s",
31-
"Implications failed:": "Implications échouées:",
31+
"Implications failed:": "Arguments dépendants manquants:",
3232
"Not enough arguments following: %s": "Pas assez d'arguments suivant: %s",
3333
"Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s",
3434
"Path to JSON config file": "Chemin du fichier de configuration JSON",

locales/it.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"Invalid values:": "Valori non validi:",
3030
"Argument: %s, Given: %s, Choices: %s": "Argomento: %s, Richiesto: %s, Scelte: %s",
3131
"Argument check failed: %s": "Controllo dell'argomento fallito: %s",
32-
"Implications failed:": "Argomenti impliciti non soddisfatti:",
32+
"Implications failed:": "Argomenti dipendenti mancanti:",
3333
"Not enough arguments following: %s": "Argomenti insufficienti dopo: %s",
3434
"Invalid JSON config file: %s": "File di configurazione JSON non valido: %s",
3535
"Path to JSON config file": "Percorso del file di configurazione JSON",

locales/nl.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"Invalid values:": "Ongeldige waarden:",
3030
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeven: %s, Keuzes: %s",
3131
"Argument check failed: %s": "Argumentcontrole mislukt: %s",
32-
"Implications failed:": "Mislukte implicaties:",
32+
"Implications failed:": "Ontbrekende afhankelijke argumenten:",
3333
"Not enough arguments following: %s": "Niet genoeg argumenten na: %s",
3434
"Invalid JSON config file: %s": "Ongeldig JSON-config-bestand: %s",
3535
"Path to JSON config file": "Pad naar JSON-config-bestand",

test/validation.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
const checkUsage = require('./helpers/utils').checkOutput
55
const expect = require('chai').expect
6+
const english = require('../locales/en.json')
67
let yargs = require('../')
78

89
require('chai').should()
@@ -13,13 +14,15 @@ describe('validation tests', () => {
1314
})
1415

1516
describe('implies', () => {
17+
const implicationsFailedPattern = new RegExp(english['Implications failed:'])
18+
1619
it("fails if '_' populated, and implied argument not set", (done) => {
1720
yargs(['cat'])
1821
.implies({
1922
1: 'foo' // 1 arg in _ means --foo is required
2023
})
2124
.fail((msg) => {
22-
msg.should.match(/Implications failed/)
25+
msg.should.match(implicationsFailedPattern)
2326
return done()
2427
})
2528
.parse()
@@ -32,7 +35,7 @@ describe('validation tests', () => {
3235
'foo': 1 // --foo means 1 arg in _ is required
3336
})
3437
.fail((msg) => {
35-
msg.should.match(/Implications failed/)
38+
msg.should.match(implicationsFailedPattern)
3639
return done()
3740
})
3841
.parse()
@@ -62,7 +65,7 @@ describe('validation tests', () => {
6265
'--no-bar': 'foo' // when --bar is not given, --foo is required
6366
})
6467
.fail((msg) => {
65-
msg.should.match(/Implications failed/)
68+
msg.should.match(implicationsFailedPattern)
6669
return done()
6770
})
6871
.parse()
@@ -74,7 +77,7 @@ describe('validation tests', () => {
7477
'bar': '--no-foo' // --bar means --foo cannot be given
7578
})
7679
.fail((msg) => {
77-
msg.should.match(/Implications failed/)
80+
msg.should.match(implicationsFailedPattern)
7881
return done()
7982
})
8083
.parse()
@@ -89,7 +92,7 @@ describe('validation tests', () => {
8992
})
9093
.fail((msg) => {
9194
failCalled = true
92-
msg.should.match(/Implications failed/)
95+
msg.should.match(implicationsFailedPattern)
9396
})
9497
.parse()
9598
failCalled.should.equal(true)
@@ -121,7 +124,7 @@ describe('validation tests', () => {
121124
})
122125
.fail((msg) => {
123126
failCalled = true
124-
msg.should.match(/Implications failed/)
127+
msg.should.match(implicationsFailedPattern)
125128
})
126129
.parse()
127130
failCalled.should.equal(true)
@@ -150,7 +153,7 @@ describe('validation tests', () => {
150153
implies: 'foo'
151154
})
152155
.fail((msg) => {
153-
msg.should.match(/Implications failed/)
156+
msg.should.match(implicationsFailedPattern)
154157
return done()
155158
})
156159
.parse()

test/yargs.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ const expect = require('chai').expect
55
const fs = require('fs')
66
const path = require('path')
77
const checkOutput = require('./helpers/utils').checkOutput
8+
const english = require('../locales/en.json')
89
let yargs
910
const YError = require('../lib/yerror')
1011

1112
require('chai').should()
1213

1314
const noop = () => {}
15+
const implicationsFailedPattern = new RegExp(english['Implications failed:'])
1416

1517
describe('yargs dsl tests', () => {
1618
beforeEach(() => {
@@ -56,7 +58,7 @@ describe('yargs dsl tests', () => {
5658
.parse()
5759
)
5860

59-
r.errors[2].should.match(/Implications failed/)
61+
r.errors[2].should.match(implicationsFailedPattern)
6062
})
6163

6264
it('accepts an object for describes', () => {
@@ -79,7 +81,7 @@ describe('yargs dsl tests', () => {
7981
x: 'y'
8082
})
8183
.fail((msg) => {
82-
msg.should.match(/Implications failed/)
84+
msg.should.match(implicationsFailedPattern)
8385
return done()
8486
})
8587
.parse()

0 commit comments

Comments
 (0)