fix(compiler-cli): use `--locale` parameter for transformers (#18988)
PR Close #18988
This commit is contained in:
parent
590b8052fe
commit
22c409029c
|
@ -6,7 +6,6 @@
|
|||
"debug": true,
|
||||
"enableSummariesForJit": true,
|
||||
"alwaysCompileGeneratedCode": true,
|
||||
"locale": "fi",
|
||||
"i18nFormat": "xlf"
|
||||
},
|
||||
|
||||
|
|
|
@ -97,6 +97,9 @@ function readCommandLineAndConfiguration(args: any): ParsedConfiguration {
|
|||
const allDiagnostics: Diagnostics = [];
|
||||
const config = readConfiguration(project);
|
||||
const options = mergeCommandLineParams(args, config.options);
|
||||
if (options.locale) {
|
||||
options.i18nInLocale = options.locale;
|
||||
}
|
||||
return {project, rootNames: config.rootNames, options, errors: config.errors};
|
||||
}
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ function getAotCompilerOptions(options: CompilerOptions): AotCompilerOptions {
|
|||
let translations: string = '';
|
||||
|
||||
if (options.i18nInFile) {
|
||||
if (!options.locale) {
|
||||
if (!options.i18nInLocale) {
|
||||
throw new Error(`The translation file (${options.i18nInFile}) locale must be provided.`);
|
||||
}
|
||||
translations = fs.readFileSync(options.i18nInFile, 'utf8');
|
||||
|
|
Loading…
Reference in New Issue