build(common): fix bad `root` reference in global locale files (#33662)

There was a mistake in the generation of the global
locale files, where `root` was being used instead of
the correctl `global`.

PR Close #33662
This commit is contained in:
Pete Bacon Darwin 2019-11-07 19:31:14 +00:00 committed by Kara Erickson
parent e31f62045d
commit db2c606d41
1 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ module.exports = (gulp, done) => {
console.log(`\t${I18N_DATA_EXTRA_FOLDER}/${locale}.ts`); console.log(`\t${I18N_DATA_EXTRA_FOLDER}/${locale}.ts`);
fs.writeFileSync( fs.writeFileSync(
`${RELATIVE_I18N_DATA_EXTRA_FOLDER}/${locale}.ts`, generateLocaleExtra(locale, localeData)); `${RELATIVE_I18N_DATA_EXTRA_FOLDER}/${locale}.ts`, generateLocaleExtra(locale, localeData));
console.log(`\t${I18N_GLOBAL_FOLDER}/${locale}.ts`); console.log(`\t${I18N_GLOBAL_FOLDER}/${locale}.js`);
fs.writeFileSync( fs.writeFileSync(
`${RELATIVE_I18N_GLOBAL_FOLDER}/${locale}.js`, `${RELATIVE_I18N_GLOBAL_FOLDER}/${locale}.js`,
generateGlobalLocale( generateGlobalLocale(
@ -140,7 +140,7 @@ function generateGlobalLocale(locale, localeData, baseCurrencies) {
global.ng.common.locales = global.ng.common.locales || {}; global.ng.common.locales = global.ng.common.locales || {};
const u = undefined; const u = undefined;
${getPluralFunction(locale, false)} ${getPluralFunction(locale, false)}
root.ng.common.locales['${normalizeLocale(locale)}'] = ${data}; global.ng.common.locales['${normalizeLocale(locale)}'] = ${data};
})(typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global || typeof window !== 'undefined' && window); })(typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global || typeof window !== 'undefined' && window);
`; `;
} }