From 043f104738a9f1a5b8b88e850442d175eaad461b Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 30 Aug 2017 17:33:26 -0700 Subject: [PATCH] fix(compiler): normalize the locale name (#18963) --- packages/compiler/src/aot/compiler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/compiler/src/aot/compiler.ts b/packages/compiler/src/aot/compiler.ts index 23fa187374..36e9ac582a 100644 --- a/packages/compiler/src/aot/compiler.ts +++ b/packages/compiler/src/aot/compiler.ts @@ -229,9 +229,10 @@ export class AotCompiler { const providers: CompileProviderMetadata[] = []; if (this._localeId) { + const normalizedLocale = this._localeId.replace(/_/g, '-'); providers.push({ token: createTokenForExternalReference(this._reflector, Identifiers.LOCALE_ID), - useValue: this._localeId, + useValue: normalizedLocale, }); }