@ocombe
Could you please generate a file named locale_all.ts in the folder common/i18n-data with the following structure:
// import all locales
import af from './locale_af';
import ardz from './locale_ar-DZ';
import {registerLocaleData} from '@angular/common';
let locale: any;
// add cases for each locale
switch (goog.LOCALE) {
case 'af':
locale = af;
break;
case 'ar_DZ':
case 'ar-DZ':
locale = ardz;
break;
default:
locale = en;
}
registerLocaleData(locale);
The model is https://github.com/google/closure-library/blob/048a4c201e1b3c40ef55ba753aabe7287ce341a0/closure/goog/i18n/datetimepatterns.js#L2134
The rationale is that this file will be included automatically when building the CommonModule with closure. The effect will be that the data for the target locale will be included and all other files will be tree shaken away.
Edit: We probably do not want all the locales in the imports and switch case. Please add the ability to pass a list of locales to your generation script. Thanks !
@ocombe
Could you please generate a file named
locale_all.tsin the foldercommon/i18n-datawith the following structure:The model is https://github.com/google/closure-library/blob/048a4c201e1b3c40ef55ba753aabe7287ce341a0/closure/goog/i18n/datetimepatterns.js#L2134
The rationale is that this file will be included automatically when building the
CommonModulewith closure. The effect will be that the data for the target locale will be included and all other files will be tree shaken away.Edit: We probably do not want all the locales in the imports and switch case. Please add the ability to pass a list of locales to your generation script. Thanks !