mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-25 22:37:18 +10:00
Change confirmation response to case insensitive
This commit is contained in:
parent
0cfd8ce22b
commit
f7368e4824
1 changed files with 4 additions and 4 deletions
|
|
@ -159,10 +159,10 @@ const translateLanguage = (targetLang, source, target, diff) => {
|
|||
return confirmTranslation(targetLang, key, translation);
|
||||
})
|
||||
.then(answers => {
|
||||
// 'y' or 'N'
|
||||
// y|Y|n|N
|
||||
const confirmation = answers.value;
|
||||
|
||||
if (confirmation === 'N') {
|
||||
if (/n/i.test(confirmation)) {
|
||||
console.log('Discarding new translation');
|
||||
throw new BreakToRunWithTarget();
|
||||
}
|
||||
|
|
@ -271,8 +271,8 @@ const confirmTranslation = (targetLang, key, translation) => {
|
|||
name: 'value',
|
||||
message: `Do you want to add the ${targetLangName(targetLang)} translation ${chalk.green(
|
||||
translation
|
||||
)} for the key ${chalk.blueBright(key)}? (y/N)`,
|
||||
validate: value => value === 'y' || value === 'N',
|
||||
)} for the key ${chalk.blueBright(key)}? (y/n)`,
|
||||
validate: value => /y/i.test(value) || /n/i.test(value),
|
||||
},
|
||||
]);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue