Skip to content

Commit

Permalink
fix(framework): openUI5 cldr support re-added (#1207)
Browse files Browse the repository at this point in the history
vladitasev authored Feb 11, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent c411774 commit 6bf40a2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/base/src/asset-registries/LocaleData.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { registerModuleContent } from "../ResourceLoaderOverrides.js";
import { fetchJsonOnce } from "../util/FetchHelper.js";
import { getFeature } from "../FeaturesRegistry.js";

const OpenUI5Support = getFeature("OpenUI5Support");

const supportedLocales = ["ar", "ar_EG", "ar_SA", "bg", "ca", "cs", "da", "de", "de_AT", "de_CH", "el", "el_CY", "en", "en_AU", "en_GB", "en_HK", "en_IE", "en_IN", "en_NZ", "en_PG", "en_SG", "en_ZA", "es", "es_AR", "es_BO", "es_CL", "es_CO", "es_MX", "es_PE", "es_UY", "es_VE", "et", "fa", "fi", "fr", "fr_BE", "fr_CA", "fr_CH", "fr_LU", "he", "hi", "hr", "hu", "id", "it", "it_CH", "ja", "kk", "ko", "lt", "lv", "ms", "nb", "nl", "nl_BE", "pl", "pt", "pt_PT", "ro", "ru", "ru_UA", "sk", "sl", "sr", "sv", "th", "tr", "uk", "vi", "zh_CN", "zh_HK", "zh_SG", "zh_TW"];

@@ -63,9 +66,13 @@ const fetchCldr = async (language, region, script) => {
resolveMissingMappings();
const localeId = calcLocale(language, region, script);

const cldrObj = cldrData[localeId];
let cldrObj = cldrData[localeId];
const url = cldrUrls[localeId];

if (!cldrObj && OpenUI5Support) {
cldrObj = OpenUI5Support.getLocaleDataObject();
}

if (cldrObj) {
// inlined from build or fetched independently
registerModuleContent(`sap/ui/core/cldr/${localeId}.json`, cldrObj);

0 comments on commit 6bf40a2

Please sign in to comment.