Terence D. Honles 078b0be4dc fix(common): locales/global/*.js are not ES5 compliant (#36342)
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
2020-04-09 11:30:32 -07:00

134 lines
3.4 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @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) {
if (n === 1) return 1;
return 5;
}
global.ng.common.locales['bg'] = [
'bg',
[['am', 'pm'], u, ['пр.об.', 'сл.об.']],
[['am', 'pm'], u, u],
[
['н', 'п', 'в', 'с', 'ч', 'п', 'с'],
['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
[
'неделя', 'понеделник', 'вторник', 'сряда',
'четвъртък', 'петък', 'събота'
],
['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб']
],
u,
[
['я', 'ф', 'м', 'а', 'м', 'ю', 'ю', 'а', 'с', 'о', 'н', 'д'],
[
'яну', 'фев', 'март', 'апр', 'май', 'юни', 'юли', 'авг', 'сеп',
'окт', 'ное', 'дек'
],
[
'януари', 'февруари', 'март', 'април', 'май', 'юни', 'юли',
'август', 'септември', 'октомври', 'ноември',
'декември'
]
],
u,
[['пр.Хр.', 'сл.Хр.'], u, ['преди Христа', 'след Христа']],
1,
[6, 0],
['d.MM.yy \'г\'.', 'd.MM.y \'г\'.', 'd MMMM y \'г\'.', 'EEEE, d MMMM y \'г\'.'],
['H:mm', 'H:mm:ss', 'H:mm:ss z', 'H:mm:ss zzzz'],
['{1}, {0}', u, u, u],
[',', ' ', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],
['#,##0.###', '#,##0%', '0.00 ¤', '#E0'],
'BGN',
'лв.',
'Български лев',
{
'ARS': [],
'AUD': [],
'BBD': [],
'BDT': [],
'BGN': ['лв.'],
'BMD': [],
'BND': [],
'BRL': [],
'BSD': [],
'BYN': [],
'BZD': [],
'CAD': [],
'CLP': [],
'CNY': [],
'COP': [],
'CRC': [],
'CUP': [],
'DOP': [],
'FJD': [],
'FKP': [],
'GBP': [u, '£'],
'GIP': [],
'GYD': [],
'HKD': [],
'ILS': [],
'INR': [],
'JMD': [],
'JPY': [u, '¥'],
'KHR': [],
'KRW': [],
'KYD': [],
'KZT': [],
'LAK': [],
'LRD': [],
'MNT': [],
'MXN': [],
'NAD': [],
'NGN': [],
'NZD': [],
'PHP': [],
'PYG': [],
'RON': [],
'SBD': [],
'SGD': [],
'SRD': [],
'SSP': [],
'TRY': [],
'TTD': [],
'TWD': [],
'UAH': [],
'USD': ['щ.д.', '$'],
'UYU': [],
'VND': [],
'XCD': [u, '$']
},
'ltr',
plural,
[
[
[
'полунощ', 'сутринта', 'на обяд', 'следобед',
'вечерта', 'през нощта'
],
u, u
],
u,
[
'00:00', ['04:00', '11:00'], ['11:00', '14:00'], ['14:00', '18:00'], ['18:00', '22:00'],
['22:00', '04:00']
]
]
];
})(typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global ||
typeof window !== 'undefined' && window);