Although this code has been part of Angular 9.x I only noticed this error when upgrading to Angular 9.1.x because historically the source locale data was not injected when localizing, but as of angular/angular-cli#16394 (9.1.0) it is now included. This tipped me off that my other bundles were not being built properly, and this change allows me to build a valid ES5 bundle (I have also added a verification step to my build pipeline to alert me if this error appears again in any of my bundles). I found the `locales/global/*.js` file paths being referenced by the `I18nOptions` in @angular-devkit/build-angular/src/utils/i18n-options.ts, and following that it looks like it is actually loaded and used in @angular-devkit/build-angular/src/utils/process-bundle.ts. I saw the function `terserMangle` does appear that it is likely aware of the build being ES5, but I'm not sure why this is not producing a valid ES5 bundle. This change updates `tools/gulp-tasks/cldr/extract.js` to produce ES5 compliant `locales/global/*.js` and that fixes my issue. However, I am not sure if @angular-devkit/build-angular should be modified to produce a valid ES5 bundle instead or if the files could be TypeScript rather than JavaScript files. A test that a valid ES5 bundle is produced would be helpful, and I hope this is reproducible and not some issue with my config. PR Close #36342
27 lines
2.5 KiB
JavaScript
27 lines
2.5 KiB
JavaScript
/**
|
||
* @license
|
||
* Copyright Google Inc. All Rights Reserved.
|
||
*
|
||
* Use of this source code is governed by an MIT-style license that can be
|
||
* found in the LICENSE file at https://angular.io/license
|
||
*/
|
||
|
||
// THIS CODE IS GENERATED - DO NOT MODIFY
|
||
// See angular/tools/gulp-tasks/cldr/extract.js
|
||
|
||
(
|
||
function(global) {
|
||
global.ng = global.ng || {};
|
||
global.ng.common = global.ng.common || {};
|
||
global.ng.common.locales = global.ng.common.locales || {};
|
||
var u = undefined;
|
||
function plural(n) {
|
||
var i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length;
|
||
if (i === 1 && v === 0) return 1;
|
||
return 5;
|
||
}
|
||
global.ng.common.locales['ca-es-valencia'] = ['ca-ES-VALENCIA',[['a. m.','p. m.'],u,u],u,[['dg','dl','dt','dc','dj','dv','ds'],['dg.','dl.','dt.','dc.','dj.','dv.','ds.'],['diumenge','dilluns','dimarts','dimecres','dijous','divendres','dissabte'],['dg.','dl.','dt.','dc.','dj.','dv.','ds.']],u,[['GN','FB','MÇ','AB','MG','JN','JL','AG','ST','OC','NV','DS'],['de gen.','de febr.','de març','d’abr.','de maig','de juny','de jul.','d’ag.','de set.','d’oct.','de nov.','de des.'],['de gener','de febrer','de març','d’abril','de maig','de juny','de juliol','d’agost','de setembre','d’octubre','de novembre','de desembre']],[['GN','FB','MÇ','AB','MG','JN','JL','AG','ST','OC','NV','DS'],['gen.','febr.','març','abr.','maig','juny','jul.','ag.','set.','oct.','nov.','des.'],['gener','febrer','març','abril','maig','juny','juliol','agost','setembre','octubre','novembre','desembre']],[['aC','dC'],u,['abans de Crist','després de Crist']],1,[6,0],['d/M/yy','d MMM y','d MMMM \'de\' y','EEEE, d MMMM \'de\' y'],['H:mm','H:mm:ss','H:mm:ss z','H:mm:ss zzzz'],['{1} {0}','{1}, {0}','{1} \'a\' \'les\' {0}',u],[',','.',';','%','+','-','E','×','‰','∞','NaN',':'],['#,##0.###','#,##0%','#,##0.00 ¤','#E0'],'EUR','€','euro',{'AUD':['AU$','$'],'BRL':[u,'R$'],'CAD':[u,'$'],'CNY':[u,'¥'],'ESP':['₧'],'MXN':[u,'$'],'THB':['฿'],'USD':[u,'$'],'VEF':[u,'Bs F'],'XCD':[u,'$'],'XXX':[]},'ltr', plural, [[['mitjanit','mat.','matí','md','tarda','vespre','nit'],['mitjanit','matinada','matí','migdia','tarda','vespre','nit'],u],[['mitjanit','matinada','matí','migdia','tarda','vespre','nit'],u,u],['00:00',['00:00','06:00'],['06:00','12:00'],['12:00','13:00'],['13:00','19:00'],['19:00','21:00'],['21:00','24:00']]]];
|
||
})(
|
||
typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global ||
|
||
typeof window !== 'undefined' && window);
|