feat(codegen): Add an error message when the locale is not provided (#11104)
This commit is contained in:
parent
3dd85cb7f1
commit
e220a80093
|
@ -143,7 +143,11 @@ export class CodeGenerator {
|
|||
const transFile = cliOptions.i18nFile;
|
||||
const locale = cliOptions.locale;
|
||||
let transContent: string = '';
|
||||
if (transFile && locale) {
|
||||
if (transFile) {
|
||||
if (!locale) {
|
||||
throw new Error(
|
||||
`The translation file (${transFile}) locale must be provided. Use the --locale option.`);
|
||||
}
|
||||
transContent = nodeFs.readFileSync(transFile, 'utf8');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue