Skip to content

Commit

Permalink
fix(compiler-cli): use --locale parameter for transformers (#18988)
Browse files Browse the repository at this point in the history
PR Close #18988
  • Loading branch information
ocombe authored and mhevery committed Sep 1, 2017
1 parent 590b805 commit 22c4090
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/compiler-cli/integrationtest/tsconfig-build.json
Expand Up @@ -6,7 +6,6 @@
"debug": true,
"enableSummariesForJit": true,
"alwaysCompileGeneratedCode": true,
"locale": "fi",
"i18nFormat": "xlf"
},

Expand Down
3 changes: 3 additions & 0 deletions packages/compiler-cli/src/main.ts
Expand Up @@ -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};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-cli/src/transformers/program.ts
Expand Up @@ -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');
Expand Down

0 comments on commit 22c4090

Please sign in to comment.