@ui5/webcomponents-localization 0.0.0-b053ad005 → 0.0.0-b132dd7b9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -1
- package/.npsrc.json +3 -0
- package/CHANGELOG.md +1761 -0
- package/README.md +6 -9
- package/dist/.tsbuildinfo +1 -0
- package/dist/Assets-fetch.d.ts +1 -0
- package/dist/Assets-fetch.js +3 -0
- package/dist/Assets-fetch.js.map +1 -0
- package/dist/Assets.d.ts +1 -0
- package/dist/Assets.js +1 -0
- package/dist/Assets.js.map +1 -0
- package/dist/CalendarUtils.d.ts +3 -0
- package/dist/CalendarUtils.js +6 -0
- package/dist/CalendarUtils.js.map +1 -0
- package/dist/DateFormat.d.ts +5 -0
- package/dist/DateFormat.js +6 -2
- package/dist/DateFormat.js.map +1 -0
- package/dist/LocaleData.d.ts +5 -0
- package/dist/LocaleData.js +6 -2
- package/dist/LocaleData.js.map +1 -0
- package/dist/dates/CalendarDate.d.ts +42 -0
- package/dist/dates/CalendarDate.js +171 -201
- package/dist/dates/CalendarDate.js.map +1 -0
- package/dist/dates/ExtremeDates.d.ts +5 -0
- package/dist/dates/ExtremeDates.js +25 -35
- package/dist/dates/ExtremeDates.js.map +1 -0
- package/dist/dates/UI5Date.d.ts +5 -0
- package/dist/dates/UI5Date.js +7 -0
- package/dist/dates/UI5Date.js.map +1 -0
- package/dist/dates/UniversalDate.d.ts +47 -0
- package/dist/dates/UniversalDate.js +5 -0
- package/dist/dates/UniversalDate.js.map +1 -0
- package/dist/dates/convertMonthNumbersToMonthNames.d.ts +16 -0
- package/dist/dates/convertMonthNumbersToMonthNames.js +30 -0
- package/dist/dates/convertMonthNumbersToMonthNames.js.map +1 -0
- package/dist/dates/getDaysInMonth.d.ts +3 -0
- package/dist/dates/getDaysInMonth.js +10 -0
- package/dist/dates/getDaysInMonth.js.map +1 -0
- package/dist/dates/getRoundedTimestamp.d.ts +7 -0
- package/dist/dates/getRoundedTimestamp.js +10 -9
- package/dist/dates/getRoundedTimestamp.js.map +1 -0
- package/dist/dates/getTodayUTCTimestamp.d.ts +7 -0
- package/dist/dates/getTodayUTCTimestamp.js +3 -3
- package/dist/dates/getTodayUTCTimestamp.js.map +1 -0
- package/dist/dates/modifyDateBy.d.ts +14 -0
- package/dist/dates/modifyDateBy.js +42 -29
- package/dist/dates/modifyDateBy.js.map +1 -0
- package/dist/dates/transformDateToSecondaryType.d.ts +7 -0
- package/dist/dates/transformDateToSecondaryType.js +18 -0
- package/dist/dates/transformDateToSecondaryType.js.map +1 -0
- package/dist/features/calendar/Buddhist.js +1 -0
- package/dist/features/calendar/Buddhist.js.map +1 -0
- package/dist/features/calendar/Gregorian.js +1 -0
- package/dist/features/calendar/Gregorian.js.map +1 -0
- package/dist/features/calendar/Islamic.js +1 -0
- package/dist/features/calendar/Islamic.js.map +1 -0
- package/dist/features/calendar/Japanese.js +1 -0
- package/dist/features/calendar/Japanese.js.map +1 -0
- package/dist/features/calendar/Persian.js +1 -0
- package/dist/features/calendar/Persian.js.map +1 -0
- package/dist/generated/assets/cldr/Unicode-Data-Files-LICENSE.txt +27 -0
- package/dist/generated/assets/cldr/ar.json +1690 -511
- package/dist/generated/assets/cldr/ar_EG.json +1690 -511
- package/dist/generated/assets/cldr/ar_SA.json +1785 -607
- package/dist/generated/assets/cldr/bg.json +1663 -663
- package/dist/generated/assets/cldr/ca.json +1635 -550
- package/dist/generated/assets/cldr/cnr.json +6169 -0
- package/dist/generated/assets/cldr/cs.json +1618 -409
- package/dist/generated/assets/cldr/cy.json +1686 -640
- package/dist/generated/assets/cldr/da.json +1579 -542
- package/dist/generated/assets/cldr/de.json +1504 -374
- package/dist/generated/assets/cldr/de_AT.json +1494 -364
- package/dist/generated/assets/cldr/de_CH.json +1513 -383
- package/dist/generated/assets/cldr/el.json +1220 -273
- package/dist/generated/assets/cldr/el_CY.json +1220 -273
- package/dist/generated/assets/cldr/en.json +1619 -548
- package/dist/generated/assets/cldr/en_AU.json +1757 -637
- package/dist/generated/assets/cldr/en_GB.json +1630 -528
- package/dist/generated/assets/cldr/en_HK.json +1713 -608
- package/dist/generated/assets/cldr/en_IE.json +1678 -576
- package/dist/generated/assets/cldr/en_IN.json +1661 -555
- package/dist/generated/assets/cldr/en_NZ.json +1697 -595
- package/dist/generated/assets/cldr/en_PG.json +1698 -596
- package/dist/generated/assets/cldr/en_SG.json +1687 -582
- package/dist/generated/assets/cldr/en_ZA.json +1675 -573
- package/dist/generated/assets/cldr/es.json +1893 -704
- package/dist/generated/assets/cldr/es_AR.json +1835 -645
- package/dist/generated/assets/cldr/es_BO.json +1880 -690
- package/dist/generated/assets/cldr/es_CL.json +1721 -639
- package/dist/generated/assets/cldr/es_CO.json +1637 -554
- package/dist/generated/assets/cldr/es_MX.json +2050 -860
- package/dist/generated/assets/cldr/es_PE.json +1565 -591
- package/dist/generated/assets/cldr/es_UY.json +1593 -619
- package/dist/generated/assets/cldr/es_VE.json +1611 -637
- package/dist/generated/assets/cldr/et.json +1426 -368
- package/dist/generated/assets/cldr/fa.json +1548 -483
- package/dist/generated/assets/cldr/fi.json +1528 -343
- package/dist/generated/assets/cldr/fr.json +1435 -419
- package/dist/generated/assets/cldr/fr_BE.json +1432 -416
- package/dist/generated/assets/cldr/fr_CA.json +1571 -555
- package/dist/generated/assets/cldr/fr_CH.json +1385 -369
- package/dist/generated/assets/cldr/fr_LU.json +1435 -419
- package/dist/generated/assets/cldr/he.json +1697 -536
- package/dist/generated/assets/cldr/hi.json +1221 -193
- package/dist/generated/assets/cldr/hr.json +1760 -485
- package/dist/generated/assets/cldr/hu.json +1390 -303
- package/dist/generated/assets/cldr/id.json +1640 -570
- package/dist/generated/assets/cldr/it.json +1489 -455
- package/dist/generated/assets/cldr/it_CH.json +1489 -455
- package/dist/generated/assets/cldr/ja.json +1143 -86
- package/dist/generated/assets/cldr/kk.json +1782 -570
- package/dist/generated/assets/cldr/ko.json +1192 -162
- package/dist/generated/assets/cldr/lt.json +1383 -288
- package/dist/generated/assets/cldr/lv.json +1369 -369
- package/dist/generated/assets/cldr/mk.json +6045 -0
- package/dist/generated/assets/cldr/ms.json +1598 -551
- package/dist/generated/assets/cldr/nb.json +1265 -209
- package/dist/generated/assets/cldr/nl.json +1741 -425
- package/dist/generated/assets/cldr/nl_BE.json +1741 -425
- package/dist/generated/assets/cldr/pl.json +1903 -492
- package/dist/generated/assets/cldr/pt.json +1913 -605
- package/dist/generated/assets/cldr/pt_PT.json +1871 -633
- package/dist/generated/assets/cldr/ro.json +1590 -482
- package/dist/generated/assets/cldr/ru.json +1608 -514
- package/dist/generated/assets/cldr/ru_UA.json +1602 -508
- package/dist/generated/assets/cldr/sk.json +1629 -569
- package/dist/generated/assets/cldr/sl.json +1532 -430
- package/dist/generated/assets/cldr/sr.json +1459 -346
- package/dist/generated/assets/cldr/sr_Latn.json +2088 -991
- package/dist/generated/assets/cldr/sv.json +1508 -445
- package/dist/generated/assets/cldr/th.json +1313 -237
- package/dist/generated/assets/cldr/tr.json +1549 -436
- package/dist/generated/assets/cldr/uk.json +1619 -520
- package/dist/generated/assets/cldr/vi.json +1423 -429
- package/dist/generated/assets/cldr/zh_CN.json +1425 -342
- package/dist/generated/assets/cldr/zh_HK.json +1396 -312
- package/dist/generated/assets/cldr/zh_SG.json +1401 -317
- package/dist/generated/assets/cldr/zh_TW.json +1256 -193
- package/dist/generated/json-imports/LocaleData-fetch.d.ts +1 -0
- package/dist/generated/json-imports/LocaleData-fetch.js +93 -0
- package/dist/generated/json-imports/LocaleData-fetch.js.map +1 -0
- package/dist/generated/json-imports/LocaleData.d.ts +1 -0
- package/dist/generated/json-imports/LocaleData.js +89 -88
- package/dist/generated/json-imports/LocaleData.js.map +1 -0
- package/dist/getCachedLocaleDataInstance.d.ts +4 -0
- package/dist/getCachedLocaleDataInstance.js +6 -9
- package/dist/getCachedLocaleDataInstance.js.map +1 -0
- package/dist/locale/getLocaleData.d.ts +11 -0
- package/dist/locale/getLocaleData.js +13 -17
- package/dist/locale/getLocaleData.js.map +1 -0
- package/dist/sap/base/Event.js +59 -0
- package/dist/sap/base/Eventing.js +146 -0
- package/dist/sap/base/Log.js +2 -240
- package/dist/sap/base/assert.js +31 -5
- package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
- package/dist/sap/base/config.js +17 -0
- package/dist/sap/base/i18n/Formatting.d.ts +8 -0
- package/dist/sap/base/i18n/Formatting.js +11 -0
- package/dist/sap/base/i18n/Formatting.js.map +1 -0
- package/dist/sap/base/i18n/LanguageTag.js +173 -0
- package/dist/sap/base/i18n/Localization.d.ts +4 -0
- package/dist/sap/base/i18n/Localization.js +12 -0
- package/dist/sap/base/i18n/Localization.js.map +1 -0
- package/dist/sap/base/i18n/date/CalendarType.js +43 -0
- package/dist/sap/base/i18n/date/CalendarWeekNumbering.js +105 -0
- package/dist/sap/base/i18n/date/TimezoneUtils.js +319 -0
- package/dist/sap/base/strings/camelize.js +30 -0
- package/dist/sap/base/strings/formatMessage.js +88 -15
- package/dist/sap/base/util/LoaderExtensions.d.ts +4 -0
- package/dist/sap/base/util/LoaderExtensions.js +9 -12
- package/dist/sap/base/util/LoaderExtensions.js.map +1 -0
- package/dist/sap/base/util/ObjectPath.d.ts +4 -0
- package/dist/sap/base/util/ObjectPath.js +4 -33
- package/dist/sap/base/util/ObjectPath.js.map +1 -0
- package/dist/sap/base/util/Version.js +157 -0
- package/dist/sap/base/util/_merge.js +83 -26
- package/dist/sap/base/util/array/uniqueSort.js +37 -15
- package/dist/sap/base/util/deepClone.js +102 -0
- package/dist/sap/base/util/deepEqual.js +75 -51
- package/dist/sap/base/util/extend.js +58 -7
- package/dist/sap/base/util/isEmptyObject.js +34 -0
- package/dist/sap/base/util/isPlainObject.js +35 -1
- package/dist/sap/base/util/now.js +24 -3
- package/dist/sap/base/util/resolveReference.js +3 -0
- package/dist/sap/base/util/uid.js +27 -0
- package/dist/sap/ui/base/DataType.js +657 -0
- package/dist/sap/ui/base/Interface.js +47 -1
- package/dist/sap/ui/base/Metadata.js +435 -171
- package/dist/sap/ui/base/Object.js +284 -48
- package/dist/sap/ui/core/CalendarType.js +24 -8
- package/dist/sap/ui/core/Configuration.d.ts +17 -0
- package/dist/sap/ui/core/Configuration.js +23 -0
- package/dist/sap/ui/core/Configuration.js.map +1 -0
- package/dist/sap/ui/core/Core.d.ts +25 -0
- package/dist/sap/ui/core/Core.js +7 -32
- package/dist/sap/ui/core/Core.js.map +1 -0
- package/dist/sap/ui/core/FormatSettings.d.ts +9 -0
- package/dist/sap/ui/core/FormatSettings.js +12 -0
- package/dist/sap/ui/core/FormatSettings.js.map +1 -0
- package/dist/sap/ui/core/Locale.js +190 -142
- package/dist/sap/ui/core/LocaleData.js +2665 -1202
- package/dist/sap/ui/core/Supportability.js +5 -0
- package/dist/sap/ui/core/Theming.js +539 -0
- package/dist/sap/ui/core/date/Buddhist.js +162 -93
- package/dist/sap/ui/core/date/CalendarUtils.js +65 -0
- package/dist/sap/ui/core/date/CalendarWeekNumbering.js +30 -0
- package/dist/sap/ui/core/date/Gregorian.js +25 -10
- package/dist/sap/ui/core/date/Islamic.js +298 -185
- package/dist/sap/ui/core/date/Japanese.js +212 -117
- package/dist/sap/ui/core/date/Persian.js +324 -195
- package/dist/sap/ui/core/date/UI5Date.js +991 -0
- package/dist/sap/ui/core/date/UniversalDate.js +1251 -211
- package/dist/sap/ui/core/date/_Calendars.js +10 -1
- package/dist/sap/ui/core/format/DateFormat.js +3163 -1794
- package/dist/sap/ui/core/format/TimezoneUtil.js +24 -0
- package/package-scripts.cjs +28 -0
- package/package.json +14 -6
- package/tsconfig.json +24 -0
- package/used-modules.txt +28 -2
- package/dist/Assets-static.js +0 -2
- package/dist/dates/calculateWeekNumber.js +0 -51
- package/dist/generated/json-imports/LocaleData-static.js +0 -89
- package/dist/sap/ui/Device.js +0 -5
- package/hash.txt +0 -1
- package/package-scripts.js +0 -40
- package/src/Assets-static.js +0 -2
- package/src/Assets.js +0 -2
- package/src/DateFormat.js +0 -3
- package/src/LocaleData.js +0 -3
- package/src/dates/CalendarDate.js +0 -223
- package/src/dates/ExtremeDates.js +0 -39
- package/src/dates/calculateWeekNumber.js +0 -51
- package/src/dates/getRoundedTimestamp.js +0 -14
- package/src/dates/getTodayUTCTimestamp.js +0 -9
- package/src/dates/modifyDateBy.js +0 -42
- package/src/getCachedLocaleDataInstance.js +0 -13
- package/src/locale/getLocaleData.js +0 -27
- package/src/sap/base/util/LoaderExtensions.js +0 -17
- package/src/sap/ui/core/Core.js +0 -38
- /package/{config/.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/{src/features/calendar/Buddhist.js → dist/features/calendar/Buddhist.d.ts} +0 -0
- /package/{src/features/calendar/Gregorian.js → dist/features/calendar/Gregorian.d.ts} +0 -0
- /package/{src/features/calendar/Islamic.js → dist/features/calendar/Islamic.d.ts} +0 -0
- /package/{src/features/calendar/Japanese.js → dist/features/calendar/Japanese.d.ts} +0 -0
- /package/{src/features/calendar/Persian.js → dist/features/calendar/Persian.d.ts} +0 -0
@@ -1,51 +0,0 @@
|
|
1
|
-
import UniversalDate from "../sap/ui/core/date/UniversalDate.js";
|
2
|
-
|
3
|
-
const calculateWeekNumber = (confFirstDayOfWeek, oDate, iYear, oLocale, oLocaleData) => {
|
4
|
-
let iWeekNum = 0;
|
5
|
-
let iWeekDay = 0;
|
6
|
-
const iFirstDayOfWeek = Number.isInteger(confFirstDayOfWeek) ? confFirstDayOfWeek : oLocaleData.getFirstDayOfWeek();
|
7
|
-
|
8
|
-
// search Locale for containing "en-US", since sometimes
|
9
|
-
// when any user settings have been defined, subtag "sapufmt" is added to the locale name
|
10
|
-
// this is described inside sap.ui.core.Configuration file
|
11
|
-
if (oLocale && (oLocale.getLanguage() === "en" && oLocale.getRegion() === "US")) {
|
12
|
-
/*
|
13
|
-
* in US the week starts with Sunday
|
14
|
-
* The first week of the year starts with January 1st. But Dec. 31 is still in the last year
|
15
|
-
* So the week beginning in December and ending in January has 2 week numbers
|
16
|
-
*/
|
17
|
-
const oJanFirst = new UniversalDate(oDate.getTime());
|
18
|
-
oJanFirst.setUTCFullYear(iYear, 0, 1);
|
19
|
-
iWeekDay = oJanFirst.getUTCDay();
|
20
|
-
|
21
|
-
// get the date for the same weekday like jan 1.
|
22
|
-
const oCheckDate = new UniversalDate(oDate.getTime());
|
23
|
-
oCheckDate.setUTCDate(oCheckDate.getUTCDate() - oCheckDate.getUTCDay() + iWeekDay);
|
24
|
-
|
25
|
-
iWeekNum = Math.round((oCheckDate.getTime() - oJanFirst.getTime()) / 86400000 / 7) + 1;
|
26
|
-
} else {
|
27
|
-
// normally the first week of the year is the one where the first Thursday of the year is
|
28
|
-
// find Thursday of this week
|
29
|
-
// if the checked day is before the 1. day of the week use a day of the previous week to check
|
30
|
-
const oThursday = new UniversalDate(oDate.getTime());
|
31
|
-
oThursday.setUTCDate(oThursday.getUTCDate() - iFirstDayOfWeek);
|
32
|
-
iWeekDay = oThursday.getUTCDay();
|
33
|
-
oThursday.setUTCDate(oThursday.getUTCDate() - iWeekDay + 4);
|
34
|
-
|
35
|
-
const oFirstDayOfYear = new UniversalDate(oThursday.getTime());
|
36
|
-
oFirstDayOfYear.setUTCMonth(0, 1);
|
37
|
-
iWeekDay = oFirstDayOfYear.getUTCDay();
|
38
|
-
let iAddDays = 0;
|
39
|
-
if (iWeekDay > 4) {
|
40
|
-
iAddDays = 7; // first day of year is after Thursday, so first Thursday is in the next week
|
41
|
-
}
|
42
|
-
const oFirstThursday = new UniversalDate(oFirstDayOfYear.getTime());
|
43
|
-
oFirstThursday.setUTCDate(1 - iWeekDay + 4 + iAddDays);
|
44
|
-
|
45
|
-
iWeekNum = Math.round((oThursday.getTime() - oFirstThursday.getTime()) / 86400000 / 7) + 1;
|
46
|
-
}
|
47
|
-
|
48
|
-
return iWeekNum;
|
49
|
-
};
|
50
|
-
|
51
|
-
export default calculateWeekNumber;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Returns a timestamp with only the year, month and day (with zero hours, minutes and seconds) and without 000 for milliseconds
|
3
|
-
* @param millisecondsUTC
|
4
|
-
* @returns {number}
|
5
|
-
*/
|
6
|
-
const getRoundedTimestamp = millisecondsUTC => {
|
7
|
-
if (!millisecondsUTC) {
|
8
|
-
millisecondsUTC = new Date().getTime();
|
9
|
-
}
|
10
|
-
const rounded = millisecondsUTC - (millisecondsUTC % (24 * 60 * 60 * 1000));
|
11
|
-
return rounded / 1000;
|
12
|
-
};
|
13
|
-
|
14
|
-
export default getRoundedTimestamp;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import CalendarDate from "./CalendarDate.js";
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Returns a UTC timestamp representing today
|
5
|
-
* @public
|
6
|
-
*/
|
7
|
-
const getTodayUTCTimestamp = primaryCalendarType => CalendarDate.fromLocalJSDate(new Date(), primaryCalendarType).valueOf() / 1000;
|
8
|
-
|
9
|
-
export default getTodayUTCTimestamp;
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import CalendarDate from "./CalendarDate.js";
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Adds or subtracts a given amount of days/months/years from a date.
|
5
|
-
* If minDate or maxDate are given, the result will be enforced within these limits
|
6
|
-
*
|
7
|
-
* @param date CalendarDate instance
|
8
|
-
* @param amount how many days/months/years to add (can be a negative number)
|
9
|
-
* @param unit what to modify: "day", "month" or "year"
|
10
|
-
* @param minDate minimum date to enforce
|
11
|
-
* @param maxDate maximum date to enforce
|
12
|
-
*/
|
13
|
-
const modifyDateBy = (date, amount, unit, minDate = null, maxDate = null) => {
|
14
|
-
const newDate = new CalendarDate(date);
|
15
|
-
if (unit === "day") {
|
16
|
-
newDate.setDate(date.getDate() + amount);
|
17
|
-
} else if (unit === "month") {
|
18
|
-
newDate.setMonth(date.getMonth() + amount);
|
19
|
-
const stillSameMonth = amount === -1 && newDate.getMonth() === date.getMonth(); // f.e. PageUp remained in the same month
|
20
|
-
const monthSkipped = amount === 1 && newDate.getMonth() - date.getMonth() > 1; // f.e. PageDown skipped a whole month
|
21
|
-
if (stillSameMonth || monthSkipped) { // Select the last day of the month in any of these 2 scenarios
|
22
|
-
newDate.setDate(0);
|
23
|
-
}
|
24
|
-
} else {
|
25
|
-
newDate.setYear(date.getYear() + amount);
|
26
|
-
if (newDate.getMonth() !== date.getMonth()) { // f.e. 29th Feb to next/prev year
|
27
|
-
newDate.setDate(0); // Select the last day of the month
|
28
|
-
}
|
29
|
-
}
|
30
|
-
|
31
|
-
if (minDate && newDate.valueOf() < minDate.valueOf()) {
|
32
|
-
return new CalendarDate(minDate);
|
33
|
-
}
|
34
|
-
|
35
|
-
if (maxDate && newDate.valueOf() > maxDate.valueOf()) {
|
36
|
-
return new CalendarDate(maxDate);
|
37
|
-
}
|
38
|
-
|
39
|
-
return newDate;
|
40
|
-
};
|
41
|
-
|
42
|
-
export default modifyDateBy;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import LocaleData from "./LocaleData.js";
|
2
|
-
|
3
|
-
const cache = new Map();
|
4
|
-
|
5
|
-
const getCachedLocaleDataInstance = locale => {
|
6
|
-
if (!cache.has(locale)) {
|
7
|
-
cache.set(locale, LocaleData.getInstance(locale));
|
8
|
-
}
|
9
|
-
|
10
|
-
return cache.get(locale);
|
11
|
-
};
|
12
|
-
|
13
|
-
export default getCachedLocaleDataInstance;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import { fetchCldr } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
|
2
|
-
import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
|
3
|
-
import LocaleData from "../sap/ui/core/LocaleData.js";
|
4
|
-
|
5
|
-
const instances = new Map();
|
6
|
-
|
7
|
-
/**
|
8
|
-
* Fetches and returns а LocaleData object for the required locale
|
9
|
-
* For more information on this object's API, please see:
|
10
|
-
* https://ui5.sap.com/#/api/sap.ui.core.LocaleData
|
11
|
-
*
|
12
|
-
* @param lang - if left empty, will use the configured/current locale
|
13
|
-
* @returns {LocaleData}
|
14
|
-
*/
|
15
|
-
const getLocaleData = async lang => {
|
16
|
-
const locale = getLocale(lang);
|
17
|
-
const localeLang = locale.getLanguage();
|
18
|
-
|
19
|
-
if (!instances.has(localeLang)) {
|
20
|
-
await fetchCldr(locale.getLanguage(), locale.getRegion(), locale.getScript());
|
21
|
-
instances.set(localeLang, LocaleData.getInstance(locale));
|
22
|
-
}
|
23
|
-
|
24
|
-
return instances.get(localeLang);
|
25
|
-
};
|
26
|
-
|
27
|
-
export default getLocaleData;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { getLocaleData } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
|
2
|
-
|
3
|
-
const loadResource = moduleName => {
|
4
|
-
const moduleFormat = moduleName.match(/sap\/ui\/core\/cldr\/(\w+)\.json/);
|
5
|
-
if (!moduleFormat) {
|
6
|
-
throw new Error(`Unknown module "${moduleName}"`);
|
7
|
-
}
|
8
|
-
|
9
|
-
const localeId = moduleFormat[1];
|
10
|
-
return getLocaleData(localeId);
|
11
|
-
};
|
12
|
-
|
13
|
-
const LoaderExtensions = {
|
14
|
-
loadResource,
|
15
|
-
};
|
16
|
-
|
17
|
-
export default LoaderExtensions;
|
package/src/sap/ui/core/Core.js
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
import { getLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
|
2
|
-
import { getCalendarType } from "@ui5/webcomponents-base/dist/config/CalendarType.js";
|
3
|
-
import getDesigntimePropertyAsArray from "@ui5/webcomponents-base/dist/util/getDesigntimePropertyAsArray.js";
|
4
|
-
import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
|
5
|
-
|
6
|
-
const emptyFn = () => {};
|
7
|
-
|
8
|
-
/**
|
9
|
-
* OpenUI5 FormatSettings shim
|
10
|
-
*/
|
11
|
-
const FormatSettings = {
|
12
|
-
getFormatLocale: getLocale,
|
13
|
-
getLegacyDateFormat: emptyFn,
|
14
|
-
getLegacyDateCalendarCustomizing: emptyFn,
|
15
|
-
getCustomLocaleData: emptyFn,
|
16
|
-
};
|
17
|
-
|
18
|
-
/**
|
19
|
-
* OpenUI5 Configuration Shim
|
20
|
-
*/
|
21
|
-
const Configuration = {
|
22
|
-
getLanguage,
|
23
|
-
getCalendarType,
|
24
|
-
getSupportedLanguages: () => getDesigntimePropertyAsArray("$core-i18n-locales:,ar,bg,ca,cs,da,de,el,en,es,et,fi,fr,hi,hr,hu,it,iw,ja,ko,lt,lv,nl,no,pl,pt,ro,ru,sh,sk,sl,sv,th,tr,uk,vi,zh_CN,zh_TW$"),
|
25
|
-
getOriginInfo: emptyFn,
|
26
|
-
getFormatSettings: () => FormatSettings,
|
27
|
-
};
|
28
|
-
|
29
|
-
/**
|
30
|
-
* OpenUI5 Core shim
|
31
|
-
*/
|
32
|
-
const Core = {
|
33
|
-
getConfiguration: () => Configuration,
|
34
|
-
getLibraryResourceBundle: emptyFn(),
|
35
|
-
getFormatSettings: () => FormatSettings,
|
36
|
-
};
|
37
|
-
|
38
|
-
export default Core;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|