diff --git a/packages/compiler-cli/linker/src/file_linker/linker_environment.ts b/packages/compiler-cli/linker/src/file_linker/linker_environment.ts index c8024dc8a1..ff1401b028 100644 --- a/packages/compiler-cli/linker/src/file_linker/linker_environment.ts +++ b/packages/compiler-cli/linker/src/file_linker/linker_environment.ts @@ -20,6 +20,12 @@ export class LinkerEnvironment { static create( host: AstHost, factory: AstFactory, options: Partial): LinkerEnvironment { - return new LinkerEnvironment(host, factory, {...DEFAULT_LINKER_OPTIONS, ...options}); + return new LinkerEnvironment(host, factory, { + enableI18nLegacyMessageIdFormat: options.enableI18nLegacyMessageIdFormat ?? + DEFAULT_LINKER_OPTIONS.enableI18nLegacyMessageIdFormat, + i18nNormalizeLineEndingsInICUs: options.i18nNormalizeLineEndingsInICUs ?? + DEFAULT_LINKER_OPTIONS.i18nNormalizeLineEndingsInICUs, + i18nUseExternalIds: options.i18nUseExternalIds ?? DEFAULT_LINKER_OPTIONS.i18nUseExternalIds, + }); } } diff --git a/packages/compiler-cli/linker/src/file_linker/linker_options.ts b/packages/compiler-cli/linker/src/file_linker/linker_options.ts index d76de5b577..9c4d8feed0 100644 --- a/packages/compiler-cli/linker/src/file_linker/linker_options.ts +++ b/packages/compiler-cli/linker/src/file_linker/linker_options.ts @@ -20,6 +20,13 @@ export interface LinkerOptions { * The default is `false`. */ i18nNormalizeLineEndingsInICUs: boolean; + + /** + * Whether translation variable name should contain external message id + * (used by Closure Compiler's output of `goog.getMsg` for transition period) + * The default is `false`. + */ + i18nUseExternalIds: boolean; } /** @@ -28,4 +35,5 @@ export interface LinkerOptions { export const DEFAULT_LINKER_OPTIONS: LinkerOptions = { enableI18nLegacyMessageIdFormat: true, i18nNormalizeLineEndingsInICUs: false, + i18nUseExternalIds: false, };