@ui5/webcomponents-localization 1.14.5 → 1.14.7
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/CHANGELOG.md +20 -0
- package/dist/generated/assets/cldr/ar.json +102 -62
- package/dist/generated/assets/cldr/ar_EG.json +102 -62
- package/dist/generated/assets/cldr/ar_SA.json +102 -62
- package/dist/generated/assets/cldr/bg.json +364 -325
- package/dist/generated/assets/cldr/ca.json +491 -453
- package/dist/generated/assets/cldr/cs.json +431 -324
- package/dist/generated/assets/cldr/cy.json +608 -340
- package/dist/generated/assets/cldr/da.json +290 -227
- package/dist/generated/assets/cldr/de.json +348 -241
- package/dist/generated/assets/cldr/de_AT.json +348 -241
- package/dist/generated/assets/cldr/de_CH.json +347 -240
- package/dist/generated/assets/cldr/el.json +128 -100
- package/dist/generated/assets/cldr/el_CY.json +128 -100
- package/dist/generated/assets/cldr/en.json +538 -512
- package/dist/generated/assets/cldr/en_AU.json +583 -520
- package/dist/generated/assets/cldr/en_GB.json +485 -441
- package/dist/generated/assets/cldr/en_HK.json +519 -474
- package/dist/generated/assets/cldr/en_IE.json +485 -440
- package/dist/generated/assets/cldr/en_IN.json +465 -420
- package/dist/generated/assets/cldr/en_NZ.json +505 -460
- package/dist/generated/assets/cldr/en_PG.json +505 -460
- package/dist/generated/assets/cldr/en_SG.json +505 -460
- package/dist/generated/assets/cldr/en_ZA.json +485 -440
- package/dist/generated/assets/cldr/es.json +709 -456
- package/dist/generated/assets/cldr/es_AR.json +687 -434
- package/dist/generated/assets/cldr/es_BO.json +721 -468
- package/dist/generated/assets/cldr/es_CL.json +567 -422
- package/dist/generated/assets/cldr/es_CO.json +485 -339
- package/dist/generated/assets/cldr/es_MX.json +734 -481
- package/dist/generated/assets/cldr/es_PE.json +409 -372
- package/dist/generated/assets/cldr/es_UY.json +433 -396
- package/dist/generated/assets/cldr/es_VE.json +453 -416
- package/dist/generated/assets/cldr/et.json +340 -307
- package/dist/generated/assets/cldr/fa.json +96 -34
- package/dist/generated/assets/cldr/fi.json +359 -308
- package/dist/generated/assets/cldr/fr.json +347 -321
- package/dist/generated/assets/cldr/fr_BE.json +347 -321
- package/dist/generated/assets/cldr/fr_CA.json +458 -432
- package/dist/generated/assets/cldr/fr_CH.json +290 -264
- package/dist/generated/assets/cldr/fr_LU.json +347 -321
- package/dist/generated/assets/cldr/he.json +241 -130
- package/dist/generated/assets/cldr/hi.json +103 -53
- package/dist/generated/assets/cldr/hr.json +467 -410
- package/dist/generated/assets/cldr/hu.json +246 -195
- package/dist/generated/assets/cldr/id.json +478 -406
- package/dist/generated/assets/cldr/it.json +418 -362
- package/dist/generated/assets/cldr/it_CH.json +418 -362
- package/dist/generated/assets/cldr/ja.json +58 -18
- package/dist/generated/assets/cldr/kk.json +562 -398
- package/dist/generated/assets/cldr/ko.json +36 -15
- package/dist/generated/assets/cldr/lt.json +320 -231
- package/dist/generated/assets/cldr/lv.json +184 -120
- package/dist/generated/assets/cldr/ms.json +460 -388
- package/dist/generated/assets/cldr/nb.json +160 -92
- package/dist/generated/assets/cldr/nl.json +621 -373
- package/dist/generated/assets/cldr/nl_BE.json +621 -373
- package/dist/generated/assets/cldr/pl.json +590 -279
- package/dist/generated/assets/cldr/pt.json +696 -334
- package/dist/generated/assets/cldr/pt_PT.json +730 -454
- package/dist/generated/assets/cldr/ro.json +409 -339
- package/dist/generated/assets/cldr/ru.json +317 -279
- package/dist/generated/assets/cldr/ru_UA.json +312 -274
- package/dist/generated/assets/cldr/sk.json +454 -413
- package/dist/generated/assets/cldr/sl.json +118 -80
- package/dist/generated/assets/cldr/sr.json +294 -142
- package/dist/generated/assets/cldr/sr_Latn.json +972 -824
- package/dist/generated/assets/cldr/sv.json +382 -338
- package/dist/generated/assets/cldr/th.json +56 -36
- package/dist/generated/assets/cldr/tr.json +371 -320
- package/dist/generated/assets/cldr/uk.json +340 -290
- package/dist/generated/assets/cldr/vi.json +352 -328
- package/dist/generated/assets/cldr/zh_CN.json +34 -10
- package/dist/generated/assets/cldr/zh_HK.json +33 -9
- package/dist/generated/assets/cldr/zh_SG.json +33 -9
- package/dist/generated/assets/cldr/zh_TW.json +32 -8
- package/dist/sap/base/Event.js +59 -0
- package/dist/sap/base/Eventing.js +147 -0
- package/dist/sap/base/Log.js +2 -239
- package/dist/sap/base/assert.js +28 -1
- package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
- package/dist/sap/base/config.js +17 -0
- package/dist/sap/base/i18n/Formatting.js +1130 -0
- package/dist/sap/base/i18n/LanguageTag.js +173 -0
- package/dist/sap/base/i18n/Localization.js +721 -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/ObjectPath.js +95 -3
- 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 +157 -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 +436 -171
- package/dist/sap/ui/base/Object.js +284 -48
- package/dist/sap/ui/core/CalendarType.js +24 -8
- package/dist/sap/ui/core/Locale.js +190 -155
- package/dist/sap/ui/core/LocaleData.js +2661 -1351
- 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 -87
- package/dist/sap/ui/core/date/CalendarUtils.js +61 -32
- package/dist/sap/ui/core/date/CalendarWeekNumbering.js +30 -7
- 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 +210 -115
- package/dist/sap/ui/core/date/Persian.js +324 -195
- package/dist/sap/ui/core/date/UI5Date.js +923 -237
- package/dist/sap/ui/core/date/UniversalDate.js +1238 -256
- package/dist/sap/ui/core/date/_Calendars.js +10 -1
- package/dist/sap/ui/core/format/DateFormat.js +3174 -2111
- package/dist/sap/ui/core/format/TimezoneUtil.js +24 -89
- package/package-scripts.cjs +6 -11
- package/package.json +9 -5
- package/used-modules.txt +24 -1
- package/dist/sap/ui/Device.js +0 -5
@@ -1,159 +1,194 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
return this.sScript;
|
36
|
-
},
|
37
|
-
getRegion: function () {
|
38
|
-
return this.sRegion;
|
39
|
-
},
|
40
|
-
getVariant: function () {
|
41
|
-
return this.sVariant;
|
42
|
-
},
|
43
|
-
getVariantSubtags: function () {
|
44
|
-
return this.sVariant ? this.sVariant.split('-') : [];
|
45
|
-
},
|
46
|
-
getExtension: function () {
|
47
|
-
return this.sExtension;
|
48
|
-
},
|
49
|
-
getExtensionSubtags: function () {
|
50
|
-
return this.sExtension ? this.sExtension.slice(2).split('-') : [];
|
51
|
-
},
|
52
|
-
getPrivateUse: function () {
|
53
|
-
return this.sPrivateUse;
|
54
|
-
},
|
55
|
-
getPrivateUseSubtags: function () {
|
56
|
-
return this.sPrivateUse ? this.sPrivateUse.slice(2).split('-') : [];
|
57
|
-
},
|
58
|
-
hasPrivateUseSubtag: function (sSubtag) {
|
59
|
-
assert(sSubtag && sSubtag.match(/^[0-9A-Z]{1,8}$/i), 'subtag must be a valid BCP47 private use tag');
|
60
|
-
return this.getPrivateUseSubtags().indexOf(sSubtag) >= 0;
|
61
|
-
},
|
62
|
-
toString: function () {
|
63
|
-
return join(this.sLanguage, this.sScript, this.sRegion, this.sVariant, this.sExtension, this.sPrivateUse);
|
64
|
-
},
|
65
|
-
toLanguageTag: function () {
|
66
|
-
var sLanguage = this.getModernLanguage();
|
67
|
-
var sScript = this.sScript;
|
68
|
-
if (sLanguage === 'sr' && sScript === 'Latn') {
|
69
|
-
sLanguage = 'sh';
|
70
|
-
sScript = null;
|
71
|
-
}
|
72
|
-
return join(sLanguage, sScript, this.sRegion, this.sVariant, this.sExtension, this.sPrivateUse);
|
73
|
-
},
|
74
|
-
getModernLanguage: function () {
|
75
|
-
return M_ISO639_OLD_TO_NEW[this.sLanguage] || this.sLanguage;
|
76
|
-
},
|
77
|
-
getSAPLogonLanguage: function () {
|
78
|
-
return this._getSAPLogonLanguage();
|
79
|
-
},
|
80
|
-
_getSAPLogonLanguage: function () {
|
81
|
-
var sLanguage = this.sLanguage || '';
|
82
|
-
if (sLanguage.indexOf('-') >= 0) {
|
83
|
-
sLanguage = sLanguage.slice(0, sLanguage.indexOf('-'));
|
84
|
-
}
|
85
|
-
sLanguage = M_ISO639_OLD_TO_NEW[sLanguage] || sLanguage;
|
86
|
-
if (sLanguage === 'zh' && !this.sScript && this.sRegion === 'TW') {
|
87
|
-
return 'ZF';
|
88
|
-
}
|
89
|
-
return M_LOCALE_TO_ABAP_LANGUAGE[join(sLanguage, this.sScript)] || M_LOCALE_TO_ABAP_LANGUAGE[join(sLanguage, this.sRegion)] || M_LOCALE_TO_ABAP_LANGUAGE[getPseudoLanguageTag(this.sPrivateUse)] || sLanguage.toUpperCase();
|
90
|
-
},
|
91
|
-
getPreferredCalendarType: function () {
|
92
|
-
return Locale._mPreferredCalendar[this.getLanguage() + '-' + this.getRegion()] || Locale._mPreferredCalendar[this.getLanguage()] || Locale._mPreferredCalendar['default'];
|
1
|
+
/*!
|
2
|
+
* OpenUI5
|
3
|
+
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
5
|
+
*/
|
6
|
+
//Provides the locale object sap.ui.core.Locale
|
7
|
+
import assert from "../../base/assert.js";
|
8
|
+
import BaseObject from "../base/Object.js";
|
9
|
+
import Localization from "../../base/i18n/Localization.js";
|
10
|
+
import LanguageTag from "../../base/i18n/LanguageTag.js";
|
11
|
+
var mCache = Object.create(null);
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Creates an instance of the Locale.
|
15
|
+
*
|
16
|
+
* @class Locale represents a locale setting, consisting of a language, script, region, variants, extensions and private use section.
|
17
|
+
*
|
18
|
+
* @param {string} sLocale the locale identifier, in format en-US or en_US.
|
19
|
+
*
|
20
|
+
* @extends sap.ui.base.Object
|
21
|
+
* @author SAP SE
|
22
|
+
* @version 1.120.3
|
23
|
+
* @public
|
24
|
+
* @alias sap.ui.core.Locale
|
25
|
+
*/
|
26
|
+
var Locale = BaseObject.extend("sap.ui.core.Locale", /** @lends sap.ui.core.Locale.prototype */{
|
27
|
+
constructor: function (vLocale) {
|
28
|
+
BaseObject.apply(this);
|
29
|
+
if (vLocale instanceof LanguageTag) {
|
30
|
+
this.oLanguageTag = vLocale;
|
31
|
+
this.sLocaleId = this.oLanguageTag.toString();
|
32
|
+
} else {
|
33
|
+
this.oLanguageTag = new LanguageTag(vLocale);
|
34
|
+
this.sLocaleId = vLocale;
|
93
35
|
}
|
36
|
+
Object.assign(this, this.oLanguageTag);
|
37
|
+
this.sLanguage = this.language;
|
38
|
+
},
|
39
|
+
/**
|
40
|
+
* Get the locale language.
|
41
|
+
*
|
42
|
+
* Note that the case might differ from the original script tag
|
43
|
+
* (Lower case is enforced as recommended by BCP47/ISO639).
|
44
|
+
*
|
45
|
+
* @returns {string} the language code
|
46
|
+
* @public
|
47
|
+
*/
|
48
|
+
getLanguage: function () {
|
49
|
+
return this.language;
|
50
|
+
},
|
51
|
+
/**
|
52
|
+
* Get the locale script or <code>null</code> if none was specified.
|
53
|
+
*
|
54
|
+
* Note that the case might differ from the original language tag
|
55
|
+
* (Upper case first letter and lower case reminder enforced as
|
56
|
+
* recommended by BCP47/ISO15924)
|
57
|
+
*
|
58
|
+
* @returns {string|null} the script code or <code>null</code>
|
59
|
+
* @public
|
60
|
+
*/
|
61
|
+
getScript: function () {
|
62
|
+
return this.script;
|
63
|
+
},
|
64
|
+
/**
|
65
|
+
* Get the locale region or <code>null</code> if none was specified.
|
66
|
+
*
|
67
|
+
* Note that the case might differ from the original script tag
|
68
|
+
* (Upper case is enforced as recommended by BCP47/ISO3166-1).
|
69
|
+
*
|
70
|
+
* @returns {string} the ISO3166-1 region code (2-letter or 3-digits)
|
71
|
+
* @public
|
72
|
+
*/
|
73
|
+
getRegion: function () {
|
74
|
+
return this.region;
|
75
|
+
},
|
76
|
+
/**
|
77
|
+
* Get the locale variants as a single string or <code>null</code>.
|
78
|
+
*
|
79
|
+
* Multiple variants are separated by a dash '-'.
|
80
|
+
*
|
81
|
+
* @returns {string|null} the variant or <code>null</code>
|
82
|
+
* @public
|
83
|
+
*/
|
84
|
+
getVariant: function () {
|
85
|
+
return this.variant;
|
86
|
+
},
|
87
|
+
/**
|
88
|
+
* Get the locale variants as an array of individual variants.
|
89
|
+
*
|
90
|
+
* The separating dashes are not part of the result.
|
91
|
+
* If there is no variant section in the locale tag, an empty array is returned.
|
92
|
+
*
|
93
|
+
* @returns {string[]} the individual variant sections
|
94
|
+
* @public
|
95
|
+
*/
|
96
|
+
getVariantSubtags: function () {
|
97
|
+
return this.variantSubtags;
|
98
|
+
},
|
99
|
+
/**
|
100
|
+
* Get the locale extension as a single string or <code>null</code>.
|
101
|
+
*
|
102
|
+
* The extension always consists of a singleton character (not 'x'),
|
103
|
+
* a dash '-' and one or more extension token, each separated
|
104
|
+
* again with a dash.
|
105
|
+
*
|
106
|
+
* Use {@link #getExtensions} to get the individual extension tokens as an array.
|
107
|
+
*
|
108
|
+
* @returns {string|null} the extension or <code>null</code>
|
109
|
+
* @public
|
110
|
+
*/
|
111
|
+
getExtension: function () {
|
112
|
+
return this.extension;
|
113
|
+
},
|
114
|
+
/**
|
115
|
+
* Get the locale extensions as an array of tokens.
|
116
|
+
*
|
117
|
+
* The leading singleton and the separating dashes are not part of the result.
|
118
|
+
* If there is no extensions section in the locale tag, an empty array is returned.
|
119
|
+
*
|
120
|
+
* @returns {string[]} the individual extension sections
|
121
|
+
* @public
|
122
|
+
*/
|
123
|
+
getExtensionSubtags: function () {
|
124
|
+
return this.extensionSubtags;
|
125
|
+
},
|
126
|
+
/**
|
127
|
+
* Get the locale private use section or <code>null</code>.
|
128
|
+
*
|
129
|
+
* @returns {string} the private use section
|
130
|
+
* @public
|
131
|
+
*/
|
132
|
+
getPrivateUse: function () {
|
133
|
+
return this.privateUse;
|
134
|
+
},
|
135
|
+
/**
|
136
|
+
* Get the locale private use section as an array of tokens.
|
137
|
+
*
|
138
|
+
* The leading singleton and the separating dashes are not part of the result.
|
139
|
+
* If there is no private use section in the locale tag, an empty array is returned.
|
140
|
+
*
|
141
|
+
* @returns {string[]} the tokens of the private use section
|
142
|
+
* @public
|
143
|
+
*/
|
144
|
+
getPrivateUseSubtags: function () {
|
145
|
+
return this.privateUseSubtags;
|
146
|
+
},
|
147
|
+
/**
|
148
|
+
* Check if a subtag is provided
|
149
|
+
*
|
150
|
+
* @param {string} sSubtag The subtag to check
|
151
|
+
* @returns {boolean} Wether the subtag is provided or not
|
152
|
+
*/
|
153
|
+
hasPrivateUseSubtag: function (sSubtag) {
|
154
|
+
assert(sSubtag && sSubtag.match(/^[0-9A-Z]{1,8}$/i), "subtag must be a valid BCP47 private use tag");
|
155
|
+
return this.privateUseSubtags.indexOf(sSubtag) >= 0;
|
156
|
+
},
|
157
|
+
toString: function () {
|
158
|
+
return this.oLanguageTag.toString();
|
159
|
+
},
|
160
|
+
/**
|
161
|
+
* Best guess to get a proper SAP Logon Language for this locale.
|
162
|
+
*
|
163
|
+
* Conversions taken into account:
|
164
|
+
* <ul>
|
165
|
+
* <li>use the language part only</li>
|
166
|
+
* <li>convert old ISO639 codes to newer ones (e.g. 'iw' to 'he')</li>
|
167
|
+
* <li>for Chinese, map 'Traditional Chinese' or region 'TW' to SAP proprietary code 'zf'</li>
|
168
|
+
* <li>map private extensions x-saptrc, x-sappsd and saprigi to SAP pseudo languages '1Q', '2Q' and '3Q'</li>
|
169
|
+
* <li>remove ext. language sub tags</li>
|
170
|
+
* <li>convert to uppercase</li>
|
171
|
+
* </ul>
|
172
|
+
*
|
173
|
+
* Note that the conversion also returns a result for languages that are not
|
174
|
+
* supported by the default set of SAP languages. This method has no knowledge
|
175
|
+
* about the concrete languages of any given backend system.
|
176
|
+
*
|
177
|
+
* @returns {string} a language code that should
|
178
|
+
* @public
|
179
|
+
* @since 1.17.0
|
180
|
+
* @deprecated As of 1.44, use {@link sap.ui.core.Configuration#getSAPLogonLanguage} instead
|
181
|
+
* as that class allows to configure an SAP Logon language.
|
182
|
+
*/
|
183
|
+
getSAPLogonLanguage: function () {
|
184
|
+
return Localization._getSAPLogonLanguage(this);
|
185
|
+
}
|
94
186
|
});
|
95
|
-
function
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
var M_ISO639_OLD_TO_NEW = {
|
102
|
-
'iw': 'he',
|
103
|
-
'ji': 'yi'
|
104
|
-
};
|
105
|
-
var M_ABAP_LANGUAGE_TO_LOCALE = {
|
106
|
-
'ZH': 'zh-Hans',
|
107
|
-
'ZF': 'zh-Hant',
|
108
|
-
'SH': 'sr-Latn',
|
109
|
-
'6N': 'en-GB',
|
110
|
-
'1P': 'pt-PT',
|
111
|
-
'1X': 'es-MX',
|
112
|
-
'3F': 'fr-CA',
|
113
|
-
'1Q': 'en-US-x-saptrc',
|
114
|
-
'2Q': 'en-US-x-sappsd',
|
115
|
-
'3Q': 'en-US-x-saprigi'
|
116
|
-
};
|
117
|
-
var M_LOCALE_TO_ABAP_LANGUAGE = inverse(M_ABAP_LANGUAGE_TO_LOCALE);
|
118
|
-
function getDesigntimePropertyAsArray(sValue) {
|
119
|
-
var m = /\$([-a-z0-9A-Z._]+)(?::([^$]*))?\$/.exec(sValue);
|
120
|
-
return m && m[2] ? m[2].split(/,/) : null;
|
121
|
-
}
|
122
|
-
var A_RTL_LOCALES = getDesigntimePropertyAsArray('$cldr-rtl-locales:ar,fa,he$') || [];
|
123
|
-
Locale._cldrLocales = getDesigntimePropertyAsArray('$cldr-locales:ar,ar_EG,ar_SA,bg,ca,cy,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,sr_Latn,sv,th,tr,uk,vi,zh_CN,zh_HK,zh_SG,zh_TW$');
|
124
|
-
Locale._mPreferredCalendar = {
|
125
|
-
'ar-SA': CalendarType.Islamic,
|
126
|
-
'fa': CalendarType.Persian,
|
127
|
-
'th': CalendarType.Buddhist,
|
128
|
-
'default': CalendarType.Gregorian
|
129
|
-
};
|
130
|
-
Locale._coreI18nLocales = getDesigntimePropertyAsArray('$core-i18n-locales:,ar,bg,ca,cs,da,de,el,en,en_GB,es,es_MX,et,fi,fr,hi,hr,hu,it,iw,ja,kk,ko,lt,lv,ms,nl,no,pl,pt,ro,ru,sh,sk,sl,sv,th,tr,uk,vi,zh_CN,zh_TW$');
|
131
|
-
Locale._impliesRTL = function (vLanguage) {
|
132
|
-
var oLocale = vLanguage instanceof Locale ? vLanguage : new Locale(vLanguage);
|
133
|
-
var sLanguage = oLocale.getLanguage() || '';
|
134
|
-
sLanguage = sLanguage && M_ISO639_OLD_TO_NEW[sLanguage] || sLanguage;
|
135
|
-
var sRegion = oLocale.getRegion() || '';
|
136
|
-
if (sRegion && A_RTL_LOCALES.indexOf(sLanguage + '_' + sRegion) >= 0) {
|
137
|
-
return true;
|
138
|
-
}
|
139
|
-
return A_RTL_LOCALES.indexOf(sLanguage) >= 0;
|
140
|
-
};
|
141
|
-
Locale.fromSAPLogonLanguage = function (sSAPLogonLanguage) {
|
142
|
-
if (sSAPLogonLanguage && typeof sSAPLogonLanguage === 'string') {
|
143
|
-
sSAPLogonLanguage = M_ABAP_LANGUAGE_TO_LOCALE[sSAPLogonLanguage.toUpperCase()] || sSAPLogonLanguage;
|
144
|
-
try {
|
145
|
-
return new Locale(sSAPLogonLanguage);
|
146
|
-
} catch (e) {
|
147
|
-
}
|
148
|
-
}
|
187
|
+
Locale._getCoreLocale = function (oLocale) {
|
188
|
+
if (oLocale instanceof LanguageTag) {
|
189
|
+
oLocale = mCache[oLocale.toString()] || new Locale(oLocale);
|
190
|
+
mCache[oLocale.toString()] = oLocale;
|
191
|
+
}
|
192
|
+
return oLocale;
|
149
193
|
};
|
150
|
-
function join() {
|
151
|
-
return Array.prototype.filter.call(arguments, Boolean).join('-');
|
152
|
-
}
|
153
|
-
function inverse(obj) {
|
154
|
-
return Object.keys(obj).reduce(function (inv, key) {
|
155
|
-
inv[obj[key]] = key;
|
156
|
-
return inv;
|
157
|
-
}, {});
|
158
|
-
}
|
159
194
|
export default Locale;
|