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
32 lines
3.1 KiB
JavaScript
32 lines
3.1 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;
|
||
if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&
|
||
!(i % 100 >= 12 && i % 100 <= 14))
|
||
return 3;
|
||
if (v === 0 && !(i === 1) && i % 10 === Math.floor(i % 10) && i % 10 >= 0 && i % 10 <= 1 ||
|
||
v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||
|
||
v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)
|
||
return 4;
|
||
return 5;
|
||
}
|
||
global.ng.common.locales['pl'] = ['pl',[['a','p'],['AM','PM'],u],u,[['n','p','w','ś','c','p','s'],['niedz.','pon.','wt.','śr.','czw.','pt.','sob.'],['niedziela','poniedziałek','wtorek','środa','czwartek','piątek','sobota'],['nie','pon','wto','śro','czw','pią','sob']],[['N','P','W','Ś','C','P','S'],['niedz.','pon.','wt.','śr.','czw.','pt.','sob.'],['niedziela','poniedziałek','wtorek','środa','czwartek','piątek','sobota'],['nie','pon','wto','śro','czw','pią','sob']],[['s','l','m','k','m','c','l','s','w','p','l','g'],['sty','lut','mar','kwi','maj','cze','lip','sie','wrz','paź','lis','gru'],['stycznia','lutego','marca','kwietnia','maja','czerwca','lipca','sierpnia','września','października','listopada','grudnia']],[['S','L','M','K','M','C','L','S','W','P','L','G'],['sty','lut','mar','kwi','maj','cze','lip','sie','wrz','paź','lis','gru'],['styczeń','luty','marzec','kwiecień','maj','czerwiec','lipiec','sierpień','wrzesień','październik','listopad','grudzień']],[['p.n.e.','n.e.'],u,['przed naszą erą','naszej ery']],1,[6,0],['dd.MM.y','d MMM y','d MMMM y','EEEE, d MMMM y'],['HH:mm','HH:mm:ss','HH:mm:ss z','HH:mm:ss zzzz'],['{1}, {0}',u,'{1} {0}',u],[',',' ',';','%','+','-','E','×','‰','∞','NaN',':'],['#,##0.###','#,##0%','#,##0.00 ¤','#E0'],'PLN','zł','złoty polski',{'AUD':[u,'$'],'CAD':[u,'$'],'CNY':[u,'¥'],'GBP':[u,'£'],'HKD':[u,'$'],'ILS':[u,'₪'],'INR':[u,'₹'],'JPY':[u,'¥'],'KRW':[u,'₩'],'MXN':[u,'$'],'NZD':[u,'$'],'PLN':['zł'],'RON':[u,'lej'],'TWD':[u,'NT$'],'USD':[u,'$'],'VND':[u,'₫']},'ltr', plural, [[['o półn.','w poł.','rano','przed poł.','po poł.','wiecz.','w nocy'],['o północy','w południe','rano','przed południem','po południu','wieczorem','w nocy'],u],[['półn.','poł.','rano','przedpoł.','popoł.','wiecz.','noc'],['północ','południe','rano','przedpołudnie','popołudnie','wieczór','noc'],u],['00:00','12:00',['06:00','10:00'],['10:00','12:00'],['12:00','18:00'],['18:00','21:00'],['21:00','06:00']]]];
|
||
})(typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global ||
|
||
typeof window !== 'undefined' && window);
|