mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
0e1cbecc2c
The `generate-locales-tool` now needs to run as ESM because we changed the `ts_library` rule. This commit accounts for the ESM syntax but removing CJS code parts like `require.main === module`. Also imports using `require` need to be changed to their ESM equivalents. PR Close #48521
24 lines
766 B
TypeScript
24 lines
766 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC 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
|
|
*/
|
|
import {CldrData} from '../cldr-data';
|
|
import {generateClosureLocaleFile} from '../closure-locale-file';
|
|
import {generateBaseCurrencies} from '../locale-base-currencies';
|
|
|
|
import {BASE_LOCALE} from './base-locale';
|
|
|
|
/** Generates the Google3 closure-locale file and prints it to the stdout. */
|
|
function main() {
|
|
const cldrData = new CldrData();
|
|
const baseLocaleData = cldrData.getLocaleData(BASE_LOCALE)!;
|
|
const baseCurrencies = generateBaseCurrencies(baseLocaleData);
|
|
|
|
process.stdout.write(generateClosureLocaleFile(cldrData, baseCurrencies));
|
|
}
|
|
|
|
main();
|