Browse Source

Update register-locale.ts

pull/20096/head
Masum ULU 2 years ago
committed by GitHub
parent
commit
736314902a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      npm/ng-packs/packages/core/locale/src/utils/register-locale.ts

4
npm/ng-packs/packages/core/locale/src/utils/register-locale.ts

@ -19,7 +19,7 @@ export interface RegisterLocaleData {
function loadLocale(locale: string) { function loadLocale(locale: string) {
// hard coded list works with esbuild. Source https://github.com/angular/angular-cli/issues/26904#issuecomment-1903596563 // hard coded list works with esbuild. Source https://github.com/angular/angular-cli/issues/26904#issuecomment-1903596563
var list = { const list = {
'ar': () => import('@angular/common/locales/ar'), 'ar': () => import('@angular/common/locales/ar'),
'cs': () => import('@angular/common/locales/cs'), 'cs': () => import('@angular/common/locales/cs'),
'en': () => import('@angular/common/locales/en'), 'en': () => import('@angular/common/locales/en'),
@ -53,7 +53,7 @@ export function registerLocaleForEsBuild(
return (locale: string): Promise<any> => { return (locale: string): Promise<any> => {
localeMap = { ...differentLocales, ...cultureNameLocaleFileMap }; localeMap = { ...differentLocales, ...cultureNameLocaleFileMap };
const l = localeMap[locale] || locale; const l = localeMap[locale] || locale;
var localeSupportList = "ar|cs|en|en-GB|es|de|fi|fr|hi|hu|is|it|pt|tr|ru|ro|sk|sl|zh-Hans|zh-Hant".split("|"); const localeSupportList = "ar|cs|en|en-GB|es|de|fi|fr|hi|hu|is|it|pt|tr|ru|ro|sk|sl|zh-Hans|zh-Hant".split("|");
if (localeSupportList.indexOf(locale) == -1) { if (localeSupportList.indexOf(locale) == -1) {
return; return;

Loading…
Cancel
Save