Skip to content

Commit

Permalink
fix(translations): fix pluralization in error messages. (#1557)
Browse files Browse the repository at this point in the history
  • Loading branch information
mleguen committed Feb 18, 2020
1 parent 996329b commit 94fa38c
Show file tree
Hide file tree
Showing 24 changed files with 230 additions and 72 deletions.
24 changes: 21 additions & 3 deletions lib/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ module.exports = function validation (yargs, usage, y18n) {
)
} else {
usage.fail(
__('Not enough non-option arguments: got %s, need at least %s', _s, demandedCommands._.min)
__n(
'Not enough non-option arguments: got %s, need at least %s',
'Not enough non-option arguments: got %s, need at least %s',
_s,
_s,
demandedCommands._.min
)
)
}
} else if (_s > demandedCommands._.max) {
Expand All @@ -37,7 +43,13 @@ module.exports = function validation (yargs, usage, y18n) {
)
} else {
usage.fail(
__('Too many non-option arguments: got %s, maximum of %s', _s, demandedCommands._.max)
__n(
'Too many non-option arguments: got %s, maximum of %s',
'Too many non-option arguments: got %s, maximum of %s',
_s,
_s,
demandedCommands._.max
)
)
}
}
Expand All @@ -49,7 +61,13 @@ module.exports = function validation (yargs, usage, y18n) {
self.positionalCount = function positionalCount (required, observed) {
if (observed < required) {
usage.fail(
__('Not enough non-option arguments: got %s, need at least %s', observed, required)
__n(
'Not enough non-option arguments: got %s, need at least %s',
'Not enough non-option arguments: got %s, need at least %s',
observed,
observed,
required
)
)
}
}
Expand Down
10 changes: 8 additions & 2 deletions locales/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "магчымасці:",
"aliases:": "аліасы:",
"generated-value": "згенераванае значэнне",
"Not enough non-option arguments: got %s, need at least %s": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s",
"Too many non-option arguments: got %s, maximum of %s": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s",
"other": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s",
"other": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s"
},
"Missing argument value: %s": {
"one": "Не хапае значэння аргументу: %s",
"other": "Не хапае значэнняў аргументаў: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "Möglichkeiten:",
"aliases:": "Aliase:",
"generated-value": "Generierter-Wert",
"Not enough non-option arguments: got %s, need at least %s": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt",
"Too many non-option arguments: got %s, maximum of %s": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt",
"other": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt",
"other": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt"
},
"Missing argument value: %s": {
"one": "Fehlender Argumentwert: %s",
"other": "Fehlende Argumentwerte: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "choices:",
"aliases:": "aliases:",
"generated-value": "generated-value",
"Not enough non-option arguments: got %s, need at least %s": "Not enough non-option arguments: got %s, need at least %s",
"Too many non-option arguments: got %s, maximum of %s": "Too many non-option arguments: got %s, maximum of %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Not enough non-option arguments: got %s, need at least %s",
"other": "Not enough non-option arguments: got %s, need at least %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Too many non-option arguments: got %s, maximum of %s",
"other": "Too many non-option arguments: got %s, maximum of %s"
},
"Missing argument value: %s": {
"one": "Missing argument value: %s",
"other": "Missing argument values: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "selección:",
"aliases:": "alias:",
"generated-value": "valor-generado",
"Not enough non-option arguments: got %s, need at least %s": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
"Too many non-option arguments: got %s, maximum of %s": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
"other": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
"other": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s"
},
"Missing argument value: %s": {
"one": "Falta argumento: %s",
"other": "Faltan argumentos: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "vaihtoehdot:",
"aliases:": "aliakset:",
"generated-value": "generoitu-arvo",
"Not enough non-option arguments: got %s, need at least %s": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s",
"Too many non-option arguments: got %s, maximum of %s": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s",
"other": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s",
"other": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s"
},
"Missing argument value: %s": {
"one": "Argumentin arvo puuttuu: %s",
"other": "Argumentin arvot puuttuvat: %s"
Expand Down
56 changes: 33 additions & 23 deletions locales/fr.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
{
"Commands:": "Commandes:",
"Options:": "Options:",
"Examples:": "Exemples:",
"Commands:": "Commandes :",
"Options:": "Options :",
"Examples:": "Exemples :",
"boolean": "booléen",
"count": "comptage",
"string": "chaine de caractère",
"count": "compteur",
"string": "chaîne de caractères",
"number": "nombre",
"array": "tableau",
"required": "requis",
"default:": "défaut:",
"choices:": "choix:",
"default:": "défaut :",
"choices:": "choix :",
"aliases:": "alias :",
"generated-value": "valeur générée",
"Not enough non-option arguments: got %s, need at least %s": "Pas assez d'arguments non-option: reçu %s, besoin d'au moins %s",
"Too many non-option arguments: got %s, maximum of %s": "Trop d'arguments non-option: reçu %s, maximum %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Pas assez d'arguments (hors options) : reçu %s, besoin d'au moins %s",
"other": "Pas assez d'arguments (hors options) : reçus %s, besoin d'au moins %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Trop d'arguments (hors options) : reçu %s, maximum de %s",
"other": "Trop d'arguments (hors options) : reçus %s, maximum de %s"
},
"Missing argument value: %s": {
"one": "Argument manquant: %s",
"other": "Arguments manquants: %s"
"one": "Argument manquant : %s",
"other": "Arguments manquants : %s"
},
"Missing required argument: %s": {
"one": "Argument requis manquant: %s",
"other": "Arguments requis manquants: %s"
"one": "Argument requis manquant : %s",
"other": "Arguments requis manquants : %s"
},
"Unknown argument: %s": {
"one": "Argument inconnu: %s",
"other": "Arguments inconnus: %s"
"one": "Argument inconnu : %s",
"other": "Arguments inconnus : %s"
},
"Invalid values:": "Valeurs invalides:",
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s",
"Argument check failed: %s": "Echec de la vérification de l'argument: %s",
"Implications failed:": "Arguments dépendants manquants:",
"Not enough arguments following: %s": "Pas assez d'arguments suivant: %s",
"Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s",
"Invalid values:": "Valeurs invalides :",
"Argument: %s, Given: %s, Choices: %s": "Argument : %s, donné : %s, choix : %s",
"Argument check failed: %s": "Echec de la vérification de l'argument : %s",
"Implications failed:": "Arguments dépendants manquants :",
"Not enough arguments following: %s": "Pas assez d'arguments après : %s",
"Invalid JSON config file: %s": "Fichier de configuration JSON invalide : %s",
"Path to JSON config file": "Chemin du fichier de configuration JSON",
"Show help": "Affiche de l'aide",
"Show help": "Affiche l'aide",
"Show version number": "Affiche le numéro de version",
"Arguments %s and %s are mutually exclusive" : "Les arguments %s et %s sont mutuellement exclusifs"
"Did you mean %s?": "Vouliez-vous dire %s ?",
"Arguments %s and %s are mutually exclusive" : "Les arguments %s et %s sont mutuellement exclusifs",
"Positionals:": "Arguments positionnels :",
"command": "commande"
}
10 changes: 8 additions & 2 deletions locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "विकल्प:",
"aliases:": "उपनाम:",
"generated-value": "उत्पन्न-मूल्य",
"Not enough non-option arguments: got %s, need at least %s": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है",
"Too many non-option arguments: got %s, maximum of %s": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है",
"other": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य",
"other": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य"
},
"Missing argument value: %s": {
"one": "कुछ तर्को के मूल्य गुम हैं: %s",
"other": "कुछ तर्को के मूल्य गुम हैं: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "lehetőségek:",
"aliases:": "aliaszok:",
"generated-value": "generált-érték",
"Not enough non-option arguments: got %s, need at least %s": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell",
"Too many non-option arguments: got %s, maximum of %s": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell",
"other": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet",
"other": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet"
},
"Missing argument value: %s": {
"one": "Hiányzó argumentum érték: %s",
"other": "Hiányzó argumentum értékek: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
"aliases:": "istilah lain:",
"choices:": "pilihan:",
"generated-value": "nilai-yang-dihasilkan",
"Not enough non-option arguments: got %s, need at least %s": "Argumen wajib kurang: hanya %s, minimal %s",
"Too many non-option arguments: got %s, maximum of %s": "Terlalu banyak argumen wajib: ada %s, maksimal %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Argumen wajib kurang: hanya %s, minimal %s",
"other": "Argumen wajib kurang: hanya %s, minimal %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Terlalu banyak argumen wajib: ada %s, maksimal %s",
"other": "Terlalu banyak argumen wajib: ada %s, maksimal %s"
},
"Missing argument value: %s": {
"one": "Kurang argumen: %s",
"other": "Kurang argumen: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "scelte:",
"aliases:": "alias:",
"generated-value": "valore generato",
"Not enough non-option arguments: got %s, need at least %s": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s",
"Too many non-option arguments: got %s, maximum of %s": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s",
"other": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s",
"other": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s"
},
"Missing argument value: %s": {
"one": "Argomento mancante: %s",
"other": "Argomenti mancanti: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "選択してください:",
"aliases:": "エイリアス:",
"generated-value": "生成された値",
"Not enough non-option arguments: got %s, need at least %s": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:",
"Too many non-option arguments: got %s, maximum of %s": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:",
"other": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:",
"other": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:"
},
"Missing argument value: %s": {
"one": "引数が見つかりません: %s",
"other": "引数が見つかりません: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "선택:",
"aliases:": "별칭:",
"generated-value": "생성된 값",
"Not enough non-option arguments: got %s, need at least %s": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다",
"Too many non-option arguments: got %s, maximum of %s": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다",
"other": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다",
"other": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다"
},
"Missing argument value: %s": {
"one": "인자값을 받지 못했습니다: %s",
"other": "인자값들을 받지 못했습니다: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
"default:": "standard:",
"choices:": "valg:",
"generated-value": "generert-verdi",
"Not enough non-option arguments: got %s, need at least %s": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s",
"Too many non-option arguments: got %s, maximum of %s": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s",
"other": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s",
"other": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s"
},
"Missing argument value: %s": {
"one": "Mangler argument verdi: %s",
"other": "Mangler argument verdier: %s"
Expand Down
10 changes: 8 additions & 2 deletions locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
"choices:": "keuzes:",
"aliases:": "aliassen:",
"generated-value": "gegenereerde waarde",
"Not enough non-option arguments: got %s, need at least %s": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig",
"Too many non-option arguments: got %s, maximum of %s": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig",
"other": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s",
"other": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s"
},
"Missing argument value: %s": {
"one": "Missende argumentwaarde: %s",
"other": "Missende argumentwaarden: %s"
Expand Down
12 changes: 8 additions & 4 deletions locales/nn.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
"default:": "standard:",
"choices:": "val:",
"generated-value": "generert-verdi",
"Not enough non-option arguments: got %s, need at least %s":
"Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s",
"Too many non-option arguments: got %s, maximum of %s":
"For mange ikkje-alternativ argument: fekk %s, maksimum %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s",
"other": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "For mange ikkje-alternativ argument: fekk %s, maksimum %s",
"other": "For mange ikkje-alternativ argument: fekk %s, maksimum %s"
},
"Missing argument value: %s": {
"one": "Manglar argumentverdi: %s",
"other": "Manglar argumentverdiar: %s"
Expand Down
Loading

0 comments on commit 94fa38c

Please sign in to comment.