trnaslationRunner: import yargs

environments/review-i18n-ci-cmjeej/deployments/1903
Alex Gleason 2022-12-28 23:21:28 -06:00
rodzic 141241ab2c
commit 73315e4095
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -3,6 +3,7 @@ import path from 'path';
import * as parser from 'intl-messageformat-parser';
import manageTranslations, { readMessageFiles, ExtractedDescriptor } from 'react-intl-translations-manager';
import yargs from 'yargs';
type Validator = (language: string) => void;
@ -68,14 +69,15 @@ Available languages:
${availableLanguages.join(', ')}
`;
const { argv } = require('yargs')
const argv = yargs
.usage(usage)
.option('f', {
alias: 'force',
default: false,
describe: 'force using the provided languages. create files if not exists.',
type: 'boolean',
});
})
.parseSync();
// check if message directory exists
if (!fs.existsSync(messagesDirectory)) {
@ -87,7 +89,7 @@ Try to run "yarn build" first`);
}
// determine the languages list
const languages: string[] = (argv._.length > 0) ? argv._ : availableLanguages;
const languages: string[] = (argv._.length > 0) ? argv._.map(String) : availableLanguages;
const validators: Validator[] = [
testRFC5646,