fix(compiler-cli): use `--locale` parameter for transformers (#18988)

PR Close #18988
This commit is contained in:
Olivier Combe 2017-08-31 23:11:29 +02:00 committed by Miško Hevery
parent 590b8052fe
commit 22c409029c
3 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,6 @@
"debug": true,
"enableSummariesForJit": true,
"alwaysCompileGeneratedCode": true,
"locale": "fi",
"i18nFormat": "xlf"
},

View File

@ -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};
}

View File

@ -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');