@openui5/sap.ui.core 1.115.1 → 1.116.0
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/.dtsgenrc +18 -0
- package/.eslintrc.json +11 -0
- package/.reuse/dep5 +0 -5
- package/THIRDPARTY.txt +1 -7
- package/package.json +1 -1
- package/src/jquery.sap.global.js +1 -1
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.sjax.js +2 -2
- package/src/jquery.sap.storage.js +3 -3
- package/src/sap/base/Event.js +106 -0
- package/src/sap/base/Eventing.js +320 -0
- package/src/sap/base/config.js +1 -1
- package/src/sap/base/i18n/Formatting.js +991 -0
- package/src/sap/base/i18n/LanguageTag.js +189 -0
- package/src/sap/base/i18n/Localization.js +711 -0
- package/src/sap/base/i18n/ResourceBundle.js +5 -20
- package/src/sap/base/i18n/date/CalendarType.js +54 -0
- package/src/sap/base/i18n/date/CalendarWeekNumbering.js +105 -0
- package/src/sap/base/i18n/date/TimezoneUtils.js +287 -0
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +1 -1
- package/src/sap/base/util/restricted/_compact.js +1 -1
- package/src/sap/base/util/restricted/_curry.js +1 -1
- package/src/sap/base/util/restricted/_debounce.js +1 -1
- package/src/sap/base/util/restricted/_difference.js +1 -1
- package/src/sap/base/util/restricted/_differenceBy.js +1 -1
- package/src/sap/base/util/restricted/_differenceWith.js +1 -1
- package/src/sap/base/util/restricted/_flatMap.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
- package/src/sap/base/util/restricted/_flatten.js +1 -1
- package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
- package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
- package/src/sap/base/util/restricted/_intersection.js +1 -1
- package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
- package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
- package/src/sap/base/util/restricted/_isEqual.js +1 -1
- package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
- package/src/sap/base/util/restricted/_isNil.js +1 -1
- package/src/sap/base/util/restricted/_max.js +1 -1
- package/src/sap/base/util/restricted/_merge.js +1 -1
- package/src/sap/base/util/restricted/_mergeWith.js +1 -1
- package/src/sap/base/util/restricted/_min.js +1 -1
- package/src/sap/base/util/restricted/_omit.js +1 -1
- package/src/sap/base/util/restricted/_pick.js +1 -1
- package/src/sap/base/util/restricted/_pickBy.js +1 -1
- package/src/sap/base/util/restricted/_throttle.js +1 -1
- package/src/sap/base/util/restricted/_toArray.js +1 -1
- package/src/sap/base/util/restricted/_union.js +1 -1
- package/src/sap/base/util/restricted/_unionBy.js +1 -1
- package/src/sap/base/util/restricted/_unionWith.js +1 -1
- package/src/sap/base/util/restricted/_uniq.js +1 -1
- package/src/sap/base/util/restricted/_uniqBy.js +1 -1
- package/src/sap/base/util/restricted/_uniqWith.js +1 -1
- package/src/sap/base/util/restricted/_without.js +1 -1
- package/src/sap/base/util/restricted/_xor.js +1 -1
- package/src/sap/base/util/restricted/_xorBy.js +1 -1
- package/src/sap/base/util/restricted/_xorWith.js +1 -1
- package/src/sap/base/util/restricted/_zipObject.js +1 -1
- package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
- package/src/sap/ui/Device.js +3 -3
- package/src/sap/ui/Global.js +4 -4
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +4 -12
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +8 -12
- package/src/sap/ui/base/ManagedObjectMetadata.js +30 -7
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/base/SyncPromise.js +10 -5
- package/src/sap/ui/core/.library +2 -2
- package/src/sap/ui/core/AccessKeysEnablement.js +10 -5
- package/src/sap/ui/core/AnimationMode.js +49 -0
- package/src/sap/ui/core/BusyIndicator.js +33 -42
- package/src/sap/ui/core/CalendarType.js +11 -37
- package/src/sap/ui/core/Component.js +4 -5
- package/src/sap/ui/core/ComponentContainer.js +1 -1
- package/src/sap/ui/core/ComponentMetadata.js +2 -2
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +409 -1270
- package/src/sap/ui/core/Control.js +4 -12
- package/src/sap/ui/core/ControlBehavior.js +157 -0
- package/src/sap/ui/core/Core.js +124 -132
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/Element.js +14 -3
- package/src/sap/ui/core/ElementMetadata.js +1 -1
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/Fragment.js +1 -1
- package/src/sap/ui/core/HTML.js +1 -1
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +1 -1
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +5 -7
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +12 -12
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/Lib.js +109 -22
- package/src/sap/ui/core/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +151 -430
- package/src/sap/ui/core/LocaleData.js +39 -11
- package/src/sap/ui/core/Manifest.js +1 -1
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/RenderManager.js +1 -1
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/StaticArea.js +31 -17
- package/src/sap/ui/core/Theming.js +451 -0
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +1 -1
- package/src/sap/ui/core/UIComponent.js +1 -1
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +1 -1
- package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
- package/src/sap/ui/core/XMLTemplateProcessor.js +1 -0
- package/src/sap/ui/core/_IconRegistry.js +7 -1
- package/src/sap/ui/core/date/CalendarWeekNumbering.js +12 -83
- package/src/sap/ui/core/date/UI5Date.js +2 -2
- package/src/sap/ui/core/delegate/ItemNavigation.js +8 -10
- package/src/sap/ui/core/delegate/ScrollEnablement.js +5 -5
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +1 -1
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/DateFormat.js +20 -15
- package/src/sap/ui/core/format/TimezoneUtil.js +15 -273
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/library.js +3 -3
- package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
- package/src/sap/ui/core/message/Message.js +1 -1
- package/src/sap/ui/core/message/MessageManager.js +1 -1
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +1 -1
- package/src/sap/ui/core/messagebundle_cs.properties +1 -1
- package/src/sap/ui/core/messagebundle_cy.properties +1 -1
- package/src/sap/ui/core/messagebundle_da.properties +1 -1
- package/src/sap/ui/core/messagebundle_de.properties +1 -1
- package/src/sap/ui/core/messagebundle_el.properties +1 -1
- package/src/sap/ui/core/messagebundle_en.properties +1 -1
- package/src/sap/ui/core/messagebundle_en_GB.properties +1 -1
- package/src/sap/ui/core/messagebundle_es.properties +1 -1
- package/src/sap/ui/core/messagebundle_es_MX.properties +1 -1
- package/src/sap/ui/core/messagebundle_et.properties +1 -1
- package/src/sap/ui/core/messagebundle_id.properties +1 -1
- package/src/sap/ui/core/messagebundle_it.properties +49 -49
- package/src/sap/ui/core/messagebundle_iw.properties +1 -1
- package/src/sap/ui/core/messagebundle_kk.properties +1 -1
- package/src/sap/ui/core/messagebundle_ko.properties +1 -1
- package/src/sap/ui/core/messagebundle_lt.properties +1 -1
- package/src/sap/ui/core/messagebundle_lv.properties +1 -1
- package/src/sap/ui/core/messagebundle_ms.properties +8 -8
- package/src/sap/ui/core/messagebundle_nl.properties +1 -1
- package/src/sap/ui/core/messagebundle_no.properties +1 -1
- package/src/sap/ui/core/messagebundle_pl.properties +1 -1
- package/src/sap/ui/core/messagebundle_pt.properties +1 -1
- package/src/sap/ui/core/messagebundle_pt_PT.properties +1 -1
- package/src/sap/ui/core/messagebundle_ro.properties +1 -1
- package/src/sap/ui/core/messagebundle_sh.properties +1 -1
- package/src/sap/ui/core/messagebundle_sv.properties +1 -1
- package/src/sap/ui/core/messagebundle_th.properties +1 -1
- package/src/sap/ui/core/messagebundle_uk.properties +21 -21
- package/src/sap/ui/core/messagebundle_vi.properties +1 -1
- package/src/sap/ui/core/mvc/HTMLView.js +1 -1
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +1 -1
- package/src/sap/ui/core/mvc/XMLView.js +1 -1
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +14 -16
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/routing/HashChanger.js +1 -0
- package/src/sap/ui/core/routing/Route.js +1 -0
- package/src/sap/ui/core/routing/Router.js +3 -1
- package/src/sap/ui/core/rules/Config.support.js +2 -2
- package/src/sap/ui/core/rules/Model.support.js +3 -1
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +1 -1
- package/src/sap/ui/core/support/controls/TimelineOverview.js +1 -1
- package/src/sap/ui/core/support/plugins/ControlTree.js +2 -2
- package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +1 -1
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
- package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +4 -4
- package/src/sap/ui/core/themes/base/base.less +41 -20
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.ttf +0 -0
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
- package/src/sap/ui/core/theming/Parameters.js +6 -5
- package/src/sap/ui/core/theming/ThemeManager.js +310 -447
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +5 -10
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +1 -1
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +3 -1
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/events/PseudoEvents.js +17 -9
- package/src/sap/ui/model/Binding.js +19 -15
- package/src/sap/ui/model/ClientModel.js +1 -1
- package/src/sap/ui/model/CompositeBinding.js +57 -19
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/DataState.js +1 -1
- package/src/sap/ui/model/ListBinding.js +42 -1
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +5 -4
- package/src/sap/ui/model/PropertyBinding.js +10 -0
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +4 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/base/ManagedObjectModel.js +1 -1
- package/src/sap/ui/model/json/JSONModel.js +1 -1
- package/src/sap/ui/model/message/MessageModel.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
- package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
- package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
- package/src/sap/ui/model/odata/ODataModel.js +1 -1
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +8 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +3 -3
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +3 -2
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +14 -3
- package/src/sap/ui/model/odata/v2/ODataModel.js +45 -31
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/Context.js +7 -3
- package/src/sap/ui/model/odata/v4/ODataBinding.js +68 -39
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +12 -8
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +30 -8
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +11 -9
- package/src/sap/ui/model/odata/v4/ODataModel.js +10 -14
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +64 -31
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +21 -16
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +2 -0
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +37 -14
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +11 -1
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +7 -4
- package/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js +4 -4
- package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +1 -1
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- package/src/sap/ui/model/type/Date.js +1 -1
- package/src/sap/ui/model/type/DateInterval.js +1 -1
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +1 -1
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +1 -1
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/Opa5.js +1 -1
- package/src/sap/ui/test/autowaiter/_autoWaiter.js +1 -1
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/test/gherkin/simpleGherkinParser.js +10 -5
- package/src/sap/ui/test/matchers/LabelFor.js +1 -0
- package/src/sap/ui/thirdparty/caja-html-sanitizer.js +111 -96
- package/src/sap/ui/util/ActivityDetection.js +7 -1
- package/src/sap/ui/util/Mobile.js +11 -8
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/ui5loader-autoconfig.js +5 -2
- package/src/ui5loader.js +169 -185
- package/test/sap/ui/core/FormatHelper.js +3 -2
- package/test/sap/ui/core/demokit/docuindex.json +6 -0
- package/test/sap/ui/core/demokit/sample/OpaBusyIndicator/OpaBusyIndicator.js +1 -1
- package/test/sap/ui/core/demokit/sample/OpaMatchers/OpaMatchers.js +2 -2
- package/test/sap/ui/core/demokit/sample/ViewTemplate/types/MIT.ODataTypes.html +9 -14
- package/test/sap/ui/core/demokit/sample/ViewTemplate/types/Opa.qunit.js +7 -0
- package/test/sap/ui/core/demokit/sample/common/pages/Any.js +1 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/DataAggregation/tests/filter.js +2 -2
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Component.js +27 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ListReport.controller.js +43 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ListReport.view.xml +47 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Main.controller.js +27 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Main.view.xml +7 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/NotFound.view.xml +8 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ObjectPage.controller.js +123 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ObjectPage.view.xml +92 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Opa.qunit.html +27 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Opa.qunit.js +69 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/README.html +55 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/SandboxModel.js +56 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/POST-SalesOrderList.json +66 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000000')-SO_2_SOITEM.json +57 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000000').json +20 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000001').json +9 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000007')-SO_2_BP.json +12 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList.json +62 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_CurrencyCode.json +85 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_CurrencyCode.xml +185 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_ProductID.json +93 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_ProductID.xml +262 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/metadata.xml +1779 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/manifest.json +134 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/pages/Main.js +119 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/MultipleInlineCreationRowsGrid/pages/Main.js +0 -41
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V2/manifest.json +1 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V4/manifest.json +1 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrders/Main.controller.js +5 -17
- package/test/sap/ui/core/demokit/sample/odata/v4/ServerDrivenPaging/Main.view.xml +3 -3
- package/test/sap/ui/core/demokit/tutorial/odatav4/08/webapp/test/integration/arrangements/Startup.js +1 -1
- package/test/sap/ui/core/demokit/tutorial/odatav4/11/webapp/test/integration/arrangements/Startup.js +1 -1
- package/test/sap/ui/core/qunit/CompositeBinding.qunit.js +25 -7
- package/test/sap/ui/core/qunit/ControlRenderer.qunit.js +86 -2
- package/test/sap/ui/core/qunit/DataState.qunit.js +2 -7
- package/test/sap/ui/core/qunit/HTML.qunit.js +31 -31
- package/test/sap/ui/core/qunit/Lib.qunit.js +55 -2
- package/test/sap/ui/core/qunit/LocalBusyIndicator.qunit.js +22 -15
- package/test/sap/ui/core/qunit/ManagedObject.qunit.js +5 -3
- package/test/sap/ui/core/qunit/Object.qunit.js +4 -1
- package/test/sap/ui/core/qunit/ThemeManager.qunit.js +2 -2
- package/test/sap/ui/core/qunit/ThemeParameters.qunit.js +9 -3
- package/test/sap/ui/core/qunit/Theming.beforeBootstrap.qunit.js +13 -0
- package/test/sap/ui/core/qunit/Theming.qunit.js +229 -0
- package/test/sap/ui/core/qunit/analytics/AnalyticalTreeBindingAdapter.qunit.js +2 -7
- package/test/sap/ui/core/qunit/analytics/ODataModelAdapter.qunit.js +2 -7
- package/test/sap/ui/core/qunit/app/MessageListBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/base/i18n/Formatting.qunit.html +24 -0
- package/test/sap/ui/core/qunit/base/i18n/Formatting.qunit.js +275 -0
- package/test/sap/ui/core/qunit/base/i18n/Localization.qunit.js +259 -0
- package/test/sap/ui/core/qunit/base/i18n/ResourceBundle.qunit.js +5 -6
- package/test/sap/ui/core/qunit/base/security/sanitizeHTML.qunit.js +17 -0
- package/test/sap/ui/core/qunit/bootstrap/BootstrapPreload.qunit.js +1 -2
- package/test/sap/ui/core/qunit/bootstrap/BootstrapWithCustomBootTask.beforeBootstrap.qunit.js +13 -12
- package/test/sap/ui/core/qunit/bootstrap/Configuration.qunit.js +388 -254
- package/test/sap/ui/core/qunit/bootstrap/ThemeVersion.qunit.js +19 -30
- package/test/sap/ui/core/qunit/component/Models.qunit.js +7 -28
- package/test/sap/ui/core/qunit/component/Models_unavoidablySync.qunit.js +8 -26
- package/test/sap/ui/core/qunit/component/testdata/async/lib2/library-preload.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib2/library-preload.json +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/lib2/library.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib3/library-preload.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib3/library-preload.json +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/lib3/library.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib4/library-preload.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/lib4/library-preload.json +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/lib4/library.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/manifestcomp/Component-preload.js +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/manifestcomp/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/mycomp/Component-preload.js +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/mycomp/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/async/mysubcomp/Component-preload.js +1 -1
- package/test/sap/ui/core/qunit/component/testdata/async/mysubcomp/Component.js +2 -3
- package/test/sap/ui/core/qunit/component/testdata/customizing/customer/ext/Component.js +0 -4
- package/test/sap/ui/core/qunit/component/testdata/customizing/customer/ext/sync/Component.js +2 -6
- package/test/sap/ui/core/qunit/component/testdata/customizing/customersub/Component.js +0 -4
- package/test/sap/ui/core/qunit/component/testdata/inherit/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/inherit/parent/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/inheritAsync/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsync/parentA/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsync/parentB/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/parentA/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/parentB/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/other/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/terminologies/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component1/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component2/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component3/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/component5/Component.js +2 -2
- package/test/sap/ui/core/qunit/component/testdata/terminologies/reuse/Component.js +2 -3
- package/test/sap/ui/core/qunit/component/testdata/v1/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/v1empty/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/v1inline/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v1missing/Component.js +2 -7
- package/test/sap/ui/core/qunit/component/testdata/v2/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v2asyncRootView/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v2empty/Component.js +2 -9
- package/test/sap/ui/core/qunit/component/testdata/v2inline/Component.js +2 -5
- package/test/sap/ui/core/qunit/component/testdata/v2missing/Component.js +2 -9
- package/test/sap/ui/core/qunit/component/testdata/v2version/Component.js +2 -2
- package/test/sap/ui/core/qunit/dnd/DragDropInfo.qunit.js +1 -2
- package/test/sap/ui/core/qunit/generic/legacy/ControlMemoryLeaks.qunit.js +2 -0
- package/test/sap/ui/core/qunit/generic/legacy/DuplicateIdCheck.qunit.js +2 -0
- package/test/sap/ui/core/qunit/gherkin/dataTableUtils.qunit.js +2 -2
- package/test/sap/ui/core/qunit/i18n/Locale.qunit.js +0 -52
- package/test/sap/ui/core/qunit/i18n/LocaleData.qunit.js +1 -1
- package/test/sap/ui/core/qunit/i18n/UniversalDate.qunit.js +14 -24
- package/test/sap/ui/core/qunit/i18n/testsuite.i18n.qunit.js +18 -0
- package/test/sap/ui/core/qunit/internal/1RingModels.qunit.js +1 -0
- package/test/sap/ui/core/qunit/json/JSONListBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/json/JSONPropertyBinding.qunit.js +7 -12
- package/test/sap/ui/core/qunit/json/JSONTwoWay.qunit.js +3 -8
- package/test/sap/ui/core/qunit/loader/fixture/amd-with-export-true/module1.js +2 -2
- package/test/sap/ui/core/qunit/messages/MessageMixin.qunit.js +2 -7
- package/test/sap/ui/core/qunit/messages/messagesUsage.qunit.js +1 -1
- package/test/sap/ui/core/qunit/model/Binding.qunit.js +36 -11
- package/test/sap/ui/core/qunit/model/ClientListBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/ClientTreeBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/CompositeDataState.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/Context.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/ContextBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/ListBinding.qunit.js +63 -6
- package/test/sap/ui/core/qunit/model/Model.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/PropertyBinding.qunit.js +40 -0
- package/test/sap/ui/core/qunit/model/TreeBinding.qunit.js +2 -7
- package/test/sap/ui/core/qunit/model/TreeBindingAdapter.qunit.js +2 -7
- package/test/sap/ui/core/qunit/mvc/XMLView.qunit.js +9 -8
- package/test/sap/ui/core/qunit/mvc/extensions/Controllerextensions.qunit.js +4 -4
- package/test/sap/ui/core/qunit/mvc/extensions/Controllerextensions_legacy.qunit.js +4 -4
- package/test/sap/ui/core/qunit/odata/AnnotationParserNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/ODataMessageParser.qunit.js +1 -1
- package/test/sap/ui/core/qunit/odata/ODataMessageParserNoFakeService.qunit.js +2 -8
- package/test/sap/ui/core/qunit/odata/ODataMetadataNoFakeService.qunit.js +1 -6
- package/test/sap/ui/core/qunit/odata/type/DateTimeBase.qunit.js +24 -0
- package/test/sap/ui/core/qunit/odata/v2/Context.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/ODataContextBindingNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/ODataListBindingNoFakeService.qunit.js +31 -17
- package/test/sap/ui/core/qunit/odata/v2/ODataModel.integration.qunit.js +28 -19
- package/test/sap/ui/core/qunit/odata/v2/ODataModelNoFakeService.qunit.js +70 -15
- package/test/sap/ui/core/qunit/odata/v2/ODataPropertyBindingNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/ODataTreeBindingFlatNoFakeService.qunit.js +4 -9
- package/test/sap/ui/core/qunit/odata/v2/ODataTreeBindingNoFakeService.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v2/_CreatedContextsCache.qunit.js +2 -7
- package/test/sap/ui/core/qunit/odata/v4/AnnotationHelper.qunit.js +1 -1
- package/test/sap/ui/core/qunit/odata/v4/Context.qunit.js +45 -17
- package/test/sap/ui/core/qunit/odata/v4/ODataBinding.qunit.js +152 -151
- package/test/sap/ui/core/qunit/odata/v4/ODataContextBinding.qunit.js +55 -27
- package/test/sap/ui/core/qunit/odata/v4/ODataListBinding.qunit.js +119 -4
- package/test/sap/ui/core/qunit/odata/v4/ODataMetaModel.qunit.js +3 -3
- package/test/sap/ui/core/qunit/odata/v4/ODataModel.integration.qunit.js +754 -195
- package/test/sap/ui/core/qunit/odata/v4/ODataModel.qunit.js +42 -53
- package/test/sap/ui/core/qunit/odata/v4/ODataParentBinding.qunit.js +283 -170
- package/test/sap/ui/core/qunit/odata/v4/ODataPropertyBinding.qunit.js +103 -78
- package/test/sap/ui/core/qunit/odata/v4/lib/_AggregationCache.qunit.js +3 -0
- package/test/sap/ui/core/qunit/odata/v4/lib/_Cache.qunit.js +87 -58
- package/test/sap/ui/core/qunit/odata/v4/lib/_Helper.qunit.js +3 -1
- package/test/sap/ui/core/qunit/odata/v4/lib/_Requestor.qunit.js +124 -22
- package/test/sap/ui/core/qunit/odata/v4/testsuite.odatav4.qunit.js +4 -0
- package/test/sap/ui/core/qunit/opa/_LogCollector.qunit.js +1 -1
- package/test/sap/ui/core/qunit/performance/trace/FESR.qunit.js +5 -0
- package/test/sap/ui/core/qunit/resource/ResourceModel.qunit.js +17 -37
- package/test/sap/ui/core/qunit/routing/HashChanger.qunit.js +1 -6
- package/test/sap/ui/core/qunit/routing/RouterHashChanger.qunit.js +1 -10
- package/test/sap/ui/core/qunit/routing/async/Router.qunit.js +1 -22
- package/test/sap/ui/core/qunit/routing/async/Target.qunit.js +1 -4
- package/test/sap/ui/core/qunit/rule/model/modelSupport.qunit.js +34 -1
- package/test/sap/ui/core/qunit/testdata/fastnavigation/view/FastNavigation.view.xml +2 -2
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/i18n.properties +1 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/library.js +10 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/manifest.json +10 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib2/library.js +10 -0
- package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib2/messagebundle.properties +1 -0
- package/test/sap/ui/core/qunit/testsuites/testsuite.databinding.qunit.js +3 -0
- package/test/sap/ui/core/qunit/testsuites/testsuite.theming.qunit.js +29 -0
- package/test/sap/ui/core/qunit/types/DateFormatTimezones.qunit.js +397 -607
- package/test/sap/ui/core/qunit/types/SimpleType.qunit.js +16 -2
- package/test/sap/ui/core/qunit/types/Types.qunit.js +2 -37
- package/test/sap/ui/core/qunit/types/testsuite.types.qunit.js +1 -1
- package/test/sap/ui/core/qunit/util/SyncPromise.qunit.js +4 -1
- package/test/sap/ui/core/qunit/util/jQuery.sap.measure.qunit.js +16 -11
- package/test/sap/ui/core/qunit/xml/XMLListBinding.qunit.js +1 -3
- package/test/sap/ui/core/qunit/xml/XMLModel.qunit.js +4 -14
- package/test/sap/ui/core/qunit/xml/XMLPropertyBinding.qunit.js +7 -11
- package/test/sap/ui/core/qunit/xml/XMLTreeBinding.qunit.js +1 -1
- package/test/sap/ui/core/qunit/xml/XMLTwoWay.qunit.js +3 -7
- package/test/sap/ui/core/relnotes/changes-1.115.json +1 -37
- package/test/sap/ui/core/relnotes/changes-1.116.json +82 -0
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/firstItem-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/initial.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/lastItem-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/leftDownBtn-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/myButtonSample-contextMenu.ref.lnk +1 -1
- package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/rightDownBtn-contextMenu.ref.lnk +1 -1
- package/test/testsuite/js/samples.js +2 -0
- package/ui5.yaml +1 -1
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
/*global globalThis*/
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/base/config",
|
|
9
|
+
"sap/base/Eventing",
|
|
10
|
+
"sap/base/Log",
|
|
11
|
+
"sap/base/i18n/LanguageTag",
|
|
12
|
+
"sap/base/i18n/date/CalendarType",
|
|
13
|
+
"sap/base/i18n/date/TimezoneUtils"
|
|
14
|
+
], function(
|
|
15
|
+
BaseConfig,
|
|
16
|
+
Eventing,
|
|
17
|
+
Log,
|
|
18
|
+
LanguageTag,
|
|
19
|
+
CalendarType,
|
|
20
|
+
TimezoneUtils
|
|
21
|
+
) {
|
|
22
|
+
"use strict";
|
|
23
|
+
var mChanges;
|
|
24
|
+
var oWritableConfig = BaseConfig.getWritableInstance();
|
|
25
|
+
var bLanguageWarningLogged = false;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A map of preferred Calendar types according to the language.
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
var _mPreferredCalendar = {
|
|
32
|
+
"ar-SA": CalendarType.Islamic,
|
|
33
|
+
"fa": CalendarType.Persian,
|
|
34
|
+
"th": CalendarType.Buddhist,
|
|
35
|
+
"default": CalendarType.Gregorian
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Note: keys must be uppercase
|
|
39
|
+
var M_ABAP_LANGUAGE_TO_LOCALE = {
|
|
40
|
+
"ZH" : "zh-Hans",
|
|
41
|
+
"ZF" : "zh-Hant",
|
|
42
|
+
"SH" : "sr-Latn",
|
|
43
|
+
"6N" : "en-GB",
|
|
44
|
+
"1P" : "pt-PT",
|
|
45
|
+
"1X" : "es-MX",
|
|
46
|
+
"3F" : "fr-CA",
|
|
47
|
+
"1Q" : "en-US-x-saptrc",
|
|
48
|
+
"2Q" : "en-US-x-sappsd",
|
|
49
|
+
"3Q" : "en-US-x-saprigi"
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var M_ISO639_OLD_TO_NEW = {
|
|
53
|
+
"iw" : "he",
|
|
54
|
+
"ji" : "yi"
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var M_LOCALE_TO_ABAP_LANGUAGE = inverse(M_ABAP_LANGUAGE_TO_LOCALE);
|
|
58
|
+
|
|
59
|
+
function inverse(obj) {
|
|
60
|
+
return Object.keys(obj).reduce(function(inv, key) {
|
|
61
|
+
inv[obj[key]] = key;
|
|
62
|
+
return inv;
|
|
63
|
+
}, {});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Maps wellknown private use extensions to pseudo language tags.
|
|
68
|
+
* @param {string} sPrivateUse A Locale
|
|
69
|
+
* @returns {string} the pseudo language tag
|
|
70
|
+
* @private
|
|
71
|
+
*/
|
|
72
|
+
function getPseudoLanguageTag(sPrivateUse) {
|
|
73
|
+
if ( sPrivateUse ) {
|
|
74
|
+
var m = /-(saptrc|sappsd|saprigi)(?:-|$)/i.exec(sPrivateUse);
|
|
75
|
+
return m && "en-US-x-" + m[1].toLowerCase();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Helper to analyze and parse designtime (aka buildtime) variables
|
|
81
|
+
*
|
|
82
|
+
* At buildtime, the build can detect a pattern like $some-variable-name:some-value$
|
|
83
|
+
* and replace 'some-value' with a value determined at buildtime (here: the actual list of locales).
|
|
84
|
+
*
|
|
85
|
+
* At runtime, config method removes the surrounding pattern ('$some-variable-name:' and '$') and leaves only the 'some-value'.
|
|
86
|
+
* Additionally, config value is parsed as a comma-separated list (because config is the only use case here).
|
|
87
|
+
*
|
|
88
|
+
* The mimic of the comments is borrowed from the CVS (Concurrent Versions System),
|
|
89
|
+
* see http://web.mit.edu/gnu/doc/html/cvs_17.html.
|
|
90
|
+
*
|
|
91
|
+
* If no valid <code>sValue</code> is given, <code>null</code> is returned
|
|
92
|
+
*
|
|
93
|
+
* @param {string} sValue The raw designtime property e.g. $cldr-rtl-locales:ar,fa,he$
|
|
94
|
+
* @returns {string[]|null} The designtime property e.g. ['ar', 'fa', 'he']
|
|
95
|
+
* @private
|
|
96
|
+
*/
|
|
97
|
+
function getDesigntimePropertyAsArray(sValue) {
|
|
98
|
+
var m = /\$([-a-z0-9A-Z._]+)(?::([^$]*))?\$/.exec(sValue);
|
|
99
|
+
return (m && m[2]) ? m[2].split(/,/) : null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* A list of locales for which the CLDR specifies "right-to-left"
|
|
104
|
+
* as the character orientation.
|
|
105
|
+
*
|
|
106
|
+
* The string literal below is substituted during the build.
|
|
107
|
+
* The value is determined from the CLDR JSON files which are
|
|
108
|
+
* bundled with the UI5 runtime.
|
|
109
|
+
*/
|
|
110
|
+
var A_RTL_LOCALES = getDesigntimePropertyAsArray("$cldr-rtl-locales:ar,fa,he$") || [];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* List of locales for which translated texts have been bundled with the UI5 runtime.
|
|
114
|
+
* @private
|
|
115
|
+
*/
|
|
116
|
+
var _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$");
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Checks whether the given language tag implies a character orientation
|
|
120
|
+
* of 'right-to-left' ('RTL').
|
|
121
|
+
*
|
|
122
|
+
* The implementation of config method and the configuration above assume
|
|
123
|
+
* that when a language (e.g. 'ar') is marked as 'RTL', then all language/region
|
|
124
|
+
* combinations for that language (e.g. 'ar_SA') will be 'RTL' as well,
|
|
125
|
+
* even if the combination is not mentioned in the above configuration.
|
|
126
|
+
* There is no means to define RTL=false for a language/region, when RTL=true for
|
|
127
|
+
* the language alone.
|
|
128
|
+
*
|
|
129
|
+
* As of 3/2013 config is true for all locales/regions supported by UI5.
|
|
130
|
+
*
|
|
131
|
+
* @param {sap.base.i18n.LanguageTag} oLanguageTag LanguageTag to check
|
|
132
|
+
* @returns {boolean} <code>true</code> if <code>vLanguage</code> implies RTL,
|
|
133
|
+
* otherwise <code>false</code>
|
|
134
|
+
* @private
|
|
135
|
+
*/
|
|
136
|
+
function impliesRTL(oLanguageTag) {
|
|
137
|
+
var sLanguage = oLanguageTag.language || "";
|
|
138
|
+
sLanguage = Localization.getModernLanguage(oLanguageTag.language);
|
|
139
|
+
var sRegion = oLanguageTag.region || "";
|
|
140
|
+
if ( sRegion && A_RTL_LOCALES.indexOf(sLanguage + "_" + sRegion) >= 0 ) {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
return A_RTL_LOCALES.indexOf(sLanguage) >= 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Retrieves a Locale for the given SAP logon language or BCP47 tag.
|
|
148
|
+
*
|
|
149
|
+
* @param {string} sSAPLogonLanguage
|
|
150
|
+
* A SAP logon language, e.g. "ZF" or a BCP47 language tag
|
|
151
|
+
* @returns {object} An object containing the mapped LogonLanguage and a LanguageTag if created
|
|
152
|
+
* @private
|
|
153
|
+
*/
|
|
154
|
+
function fromSAPLogonLanguage(sSAPLogonLanguage) {
|
|
155
|
+
var oLanguageTag;
|
|
156
|
+
if (sSAPLogonLanguage && typeof sSAPLogonLanguage === 'string') {
|
|
157
|
+
sSAPLogonLanguage = M_ABAP_LANGUAGE_TO_LOCALE[sSAPLogonLanguage.toUpperCase()] || sSAPLogonLanguage;
|
|
158
|
+
try {
|
|
159
|
+
oLanguageTag = new LanguageTag(sSAPLogonLanguage);
|
|
160
|
+
} catch (e) {
|
|
161
|
+
// ignore
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
languageTag: oLanguageTag,
|
|
166
|
+
SAPLogonLanguage: sSAPLogonLanguage
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Helper that creates a LanguageTag object from the given language
|
|
172
|
+
* or, throws an error for non BCP-47 compliant languages.
|
|
173
|
+
*
|
|
174
|
+
* @param {string} sLanguage A BCP-47 compliant language
|
|
175
|
+
* @return {sap.base.i18n.LanguageTag} The resulting LanguageTag
|
|
176
|
+
* @throws {TypeError} Throws a TypeError for unknown languages
|
|
177
|
+
* @private
|
|
178
|
+
*/
|
|
179
|
+
function createLanguageTag(sLanguage) {
|
|
180
|
+
var oLanguageTag;
|
|
181
|
+
if (sLanguage) {
|
|
182
|
+
oLanguageTag = new LanguageTag(sLanguage);
|
|
183
|
+
}
|
|
184
|
+
return oLanguageTag;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Helper Functions
|
|
188
|
+
function detectLanguage() {
|
|
189
|
+
return globalThis.navigator ? (globalThis.navigator.languages && globalThis.navigator.languages[0]) || globalThis.navigator.language || "en" : new Intl.Collator().resolvedOptions().locale || "en";
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function check(bCondition, sMessage) {
|
|
193
|
+
if ( !bCondition ) {
|
|
194
|
+
throw new Error(sMessage);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function join() {
|
|
199
|
+
return Array.prototype.filter.call(arguments, Boolean).join("-");
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Checks if the provided timezone is valid and logs an error if not.
|
|
204
|
+
*
|
|
205
|
+
* @param {string} sTimezone The IANA timezone ID
|
|
206
|
+
* @returns {boolean} Returns true if the timezone is valid
|
|
207
|
+
*/
|
|
208
|
+
function checkTimezone(sTimezone) {
|
|
209
|
+
var bIsValidTimezone = TimezoneUtils.isValidTimezone(sTimezone);
|
|
210
|
+
if (!bIsValidTimezone) {
|
|
211
|
+
Log.error("The provided timezone '" + sTimezone + "' is not a valid IANA timezone ID." +
|
|
212
|
+
" Falling back to browser's local timezone '" + TimezoneUtils.getLocalTimezone() + "'.");
|
|
213
|
+
}
|
|
214
|
+
return bIsValidTimezone;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Configuration for localization specific parameters
|
|
219
|
+
* @private
|
|
220
|
+
* @ui5-restricted sap.ui.core
|
|
221
|
+
* @alias module:sap/base/i18n/Localization
|
|
222
|
+
* @namespace
|
|
223
|
+
* @mixes module:sap/base/Eventing
|
|
224
|
+
* @borrows module:sap/base/Eventing#attachEvent as attachEvent
|
|
225
|
+
* @borrows module:sap/base/Eventing#attachEventOnce as attachEventOnce
|
|
226
|
+
* @borrows module:sap/base/Eventing#detachEvent as detachEvent
|
|
227
|
+
* @borrows module:sap/base/Eventing#fireEvent as fireEvent
|
|
228
|
+
* @borrows module:sap/base/Eventing#hasListeners as hasListeners
|
|
229
|
+
* @borrows module:sap/base/Eventing#getEventingParent as getEventingParent
|
|
230
|
+
* @borrows module:sap/base/Eventing#toString as toString
|
|
231
|
+
*/
|
|
232
|
+
var Localization = {
|
|
233
|
+
/**
|
|
234
|
+
* The <code>change</code> event is fired, when the configuration options are changed.
|
|
235
|
+
*
|
|
236
|
+
* @name module:sap/base/i18n/Localization.change
|
|
237
|
+
* @event
|
|
238
|
+
* @private
|
|
239
|
+
* @ui5-restricted sap.ui.core
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Attaches the <code>fnFunction</code> event handler to the {@link #event:change change} event
|
|
244
|
+
* of <code>sap.base.i18n.Localization</code>.
|
|
245
|
+
*
|
|
246
|
+
* @param {function} fnFunction
|
|
247
|
+
* The function to be called when the event occurs
|
|
248
|
+
* @private
|
|
249
|
+
* @ui5-restricted sap.ui.core
|
|
250
|
+
*/
|
|
251
|
+
attachChange: function(fnFunction) {
|
|
252
|
+
Localization.attachEvent("change", fnFunction);
|
|
253
|
+
},
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Detaches event handler <code>fnFunction</code> from the {@link #event:change change} event of
|
|
257
|
+
* this <code>sap.base.i18n.Localization</code>.
|
|
258
|
+
*
|
|
259
|
+
* @param {function} fnFunction Function to be called when the event occurs
|
|
260
|
+
* @private
|
|
261
|
+
* @ui5-restricted sap.ui.core
|
|
262
|
+
*/
|
|
263
|
+
detachChange: function(fnFunction) {
|
|
264
|
+
Localization.detachEvent("change", fnFunction);
|
|
265
|
+
},
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Returns a string that identifies the current language.
|
|
269
|
+
*
|
|
270
|
+
* The value returned by config method in most cases corresponds to the exact value that has been
|
|
271
|
+
* configured by the user or application or that has been determined from the user agent settings.
|
|
272
|
+
* It has not been normalized, but has been validated against a relaxed version of
|
|
273
|
+
* {@link http://www.ietf.org/rfc/bcp/bcp47.txt BCP47}, allowing underscores ('_') instead of the
|
|
274
|
+
* suggested dashes ('-') and not taking the case of letters into account.
|
|
275
|
+
*
|
|
276
|
+
* The exceptions mentioned above affect languages that have been specified via the URL parameter
|
|
277
|
+
* <code>sap-language</code>. That parameter by definition represents an SAP logon language code
|
|
278
|
+
* ('ABAP language'). Most but not all of these language codes are valid ISO639 two-letter languages
|
|
279
|
+
* and as such are valid BCP47 language tags. For better BCP47 compliance, the framework
|
|
280
|
+
* maps the following non-BCP47 SAP logon codes to a BCP47 substitute:
|
|
281
|
+
* <pre>
|
|
282
|
+
* "ZH" --> "zh-Hans" // script 'Hans' added to distinguish it from zh-Hant
|
|
283
|
+
* "ZF" --> "zh-Hant" // ZF is not a valid ISO639 code, use the compliant language + script 'Hant'
|
|
284
|
+
* "1Q" --> "en-US-x-saptrc" // special language code for supportability (tracing),
|
|
285
|
+
* represented as en-US with a private extension
|
|
286
|
+
* "2Q" --> "en-US-x-sappsd" // special language code for supportability (pseudo translation),
|
|
287
|
+
* represented as en-US with a private extension
|
|
288
|
+
* "3Q" --> "en-US-x-saprigi" // special language code for the Rigi pseudo language,
|
|
289
|
+
* represented as en-US with a private extension
|
|
290
|
+
* </pre>
|
|
291
|
+
*
|
|
292
|
+
* For a normalized BCP47 tag, call {@link #getLanguageTag} or call {@link #getLanguageTag} to get a
|
|
293
|
+
* {@link sap.base.i18n.LanguageTag LanguageTag} object matching the language.
|
|
294
|
+
*
|
|
295
|
+
* @return {string} Language string as configured
|
|
296
|
+
* @public
|
|
297
|
+
*/
|
|
298
|
+
getLanguage : function () {
|
|
299
|
+
var oLanguageTag,
|
|
300
|
+
sDerivedLanguage;
|
|
301
|
+
|
|
302
|
+
var sLanguage = oWritableConfig.get({
|
|
303
|
+
name: "sapUiLanguage",
|
|
304
|
+
type: BaseConfig.Type.String,
|
|
305
|
+
external: true
|
|
306
|
+
});
|
|
307
|
+
var sSapLocale = oWritableConfig.get({
|
|
308
|
+
name: "sapLocale",
|
|
309
|
+
type: BaseConfig.Type.String,
|
|
310
|
+
external: true
|
|
311
|
+
});
|
|
312
|
+
var sSapLanguage = oWritableConfig.get({
|
|
313
|
+
name: "sapLanguage",
|
|
314
|
+
type: BaseConfig.Type.String,
|
|
315
|
+
external: true
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
if (sSapLocale) {
|
|
319
|
+
oLanguageTag = createLanguageTag(sSapLocale);
|
|
320
|
+
sDerivedLanguage = sSapLocale;
|
|
321
|
+
} else if (sSapLanguage) {
|
|
322
|
+
if (!sLanguage && !bLanguageWarningLogged) {
|
|
323
|
+
// only complain about an invalid sap-language if neither sap-locale nor sap-ui-language are given
|
|
324
|
+
Log.warning("sap-language '" + sSapLanguage + "' is not a valid BCP47 language tag and will only be used as SAP logon language");
|
|
325
|
+
// Avoid multiple logging of this warning
|
|
326
|
+
bLanguageWarningLogged = true;
|
|
327
|
+
}
|
|
328
|
+
//fromSAPLogonLanguage catches errors oLanguageTag could be undefined
|
|
329
|
+
var oSAPLogonLanguage = fromSAPLogonLanguage(sSapLanguage);
|
|
330
|
+
oLanguageTag = oSAPLogonLanguage.languageTag;
|
|
331
|
+
sDerivedLanguage = oSAPLogonLanguage.languageTag && oSAPLogonLanguage.SAPLogonLanguage;
|
|
332
|
+
}
|
|
333
|
+
if (!oLanguageTag) {
|
|
334
|
+
if (sLanguage) {
|
|
335
|
+
oLanguageTag = createLanguageTag(sLanguage);
|
|
336
|
+
sDerivedLanguage = sLanguage;
|
|
337
|
+
} else {
|
|
338
|
+
sDerivedLanguage = detectLanguage();
|
|
339
|
+
oLanguageTag = createLanguageTag(sLanguage);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return sDerivedLanguage;
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Get the modern language
|
|
347
|
+
*
|
|
348
|
+
* @param {string} sLanguage The language string
|
|
349
|
+
* @returns {string} The modern language
|
|
350
|
+
* @private
|
|
351
|
+
* @ui5-restricted sap.ui.core
|
|
352
|
+
*/
|
|
353
|
+
getModernLanguage : function(sLanguage) {
|
|
354
|
+
return M_ISO639_OLD_TO_NEW[sLanguage] || sLanguage;
|
|
355
|
+
},
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Sets a new language to be used from now on for language/region dependent
|
|
359
|
+
* functionality (e.g. formatting, data types, translated texts, ...).
|
|
360
|
+
*
|
|
361
|
+
* When the language can't be interpreted as a BCP47 language (using the relaxed syntax
|
|
362
|
+
* described in {@link #getLanguage}, an error will be thrown.
|
|
363
|
+
*
|
|
364
|
+
* When the language has changed, the Core will fire its
|
|
365
|
+
* {@link sap.ui.core.Core#event:localizationChanged localizationChanged} event.
|
|
366
|
+
*
|
|
367
|
+
*
|
|
368
|
+
* <h3>Restrictions</h3>
|
|
369
|
+
*
|
|
370
|
+
* The framework <strong>does not</strong> guarantee that already created, language
|
|
371
|
+
* dependent objects will be updated by config call. It therefore remains best practice
|
|
372
|
+
* for applications to switch the language early, e.g. before any language dependent
|
|
373
|
+
* objects are created. Applications that need to support more dynamic changes of
|
|
374
|
+
* the language should listen to the <code>localizationChanged</code> event and adapt
|
|
375
|
+
* all language dependent objects that they use (e.g. by rebuilding their UI).
|
|
376
|
+
*
|
|
377
|
+
* Currently, the framework notifies the following objects about a change of the
|
|
378
|
+
* localization settings before it fires the <code>localizationChanged</code> event:
|
|
379
|
+
*
|
|
380
|
+
* <ul>
|
|
381
|
+
* <li>date and number data types that are used in property bindings or composite
|
|
382
|
+
* bindings in existing Elements, Controls, UIAreas or Components</li>
|
|
383
|
+
* <li>ResourceModels currently assigned to the Core, a UIArea, Component,
|
|
384
|
+
* Element or Control</li>
|
|
385
|
+
* <li>Elements or Controls that implement the <code>onlocalizationChanged</code> hook
|
|
386
|
+
* (note the lowercase 'l' in onlocalizationChanged)</li>
|
|
387
|
+
* </ul>
|
|
388
|
+
*
|
|
389
|
+
* It furthermore derives the RTL mode from the new language, if no explicit RTL
|
|
390
|
+
* mode has been set. If the RTL mode changes, the following additional actions will be taken:
|
|
391
|
+
*
|
|
392
|
+
* <ul>
|
|
393
|
+
* <li>the URLs of already loaded library theme files will be changed</li>
|
|
394
|
+
* <li>the <code>dir</code> attribute of the page will be changed to reflect the new mode.</li>
|
|
395
|
+
* <li>all UIAreas will be invalidated (which results in a rendering of the whole UI5 UI)</li>
|
|
396
|
+
* </ul>
|
|
397
|
+
*
|
|
398
|
+
* config method does not accept SAP language codes for <code>sLanguage</code>. Instead, a second
|
|
399
|
+
* parameter <code>sSAPLogonLanguage</code> can be provided with an SAP language code corresponding
|
|
400
|
+
* to the given language. A given value will be returned by the {@link #getSAPLogonLanguage} method.
|
|
401
|
+
* It is up to the caller to provide a consistent pair of BCP47 language and SAP language code.
|
|
402
|
+
* The SAP language code is only checked to be of length 2 and must consist of letters or digits only.
|
|
403
|
+
*
|
|
404
|
+
* <b>Note</b>: When using config method please take note of and respect the above mentioned restrictions.
|
|
405
|
+
*
|
|
406
|
+
* @param {string} sLanguage the new language as a BCP47 compliant language tag; case doesn't matter
|
|
407
|
+
* and underscores can be used instead of dashes to separate components (compatibility with Java Locale IDs)
|
|
408
|
+
* @param {string} [sSAPLogonLanguage] SAP language code that corresponds to the <code>sLanguage</code>;
|
|
409
|
+
* if a value is specified, future calls to <code>getSAPLogonLanguage</code> will return that value;
|
|
410
|
+
* if no value is specified, the framework will use the ISO639 language part of <code>sLanguage</code>
|
|
411
|
+
* as SAP Logon language.
|
|
412
|
+
* @throws {Error} When <code>sLanguage</code> can't be interpreted as a BCP47 language or when
|
|
413
|
+
* <code>sSAPLanguage</code> is given and can't be interpreted as SAP language code.
|
|
414
|
+
*
|
|
415
|
+
* @see http://scn.sap.com/docs/DOC-14377
|
|
416
|
+
* @public
|
|
417
|
+
*/
|
|
418
|
+
setLanguage : function (sLanguage, sSAPLogonLanguage) {
|
|
419
|
+
var oLanguageTag = createLanguageTag(sLanguage),
|
|
420
|
+
bOldRTL = Localization.getRTL();
|
|
421
|
+
|
|
422
|
+
check(oLanguageTag, "Configuration.setLanguage: sLanguage must be a valid BCP47 language tag");
|
|
423
|
+
check(sSAPLogonLanguage == null || (typeof sSAPLogonLanguage === 'string' && /^[A-Z0-9]{2,2}$/i.test(sSAPLogonLanguage)),
|
|
424
|
+
"Configuration.setLanguage: sSAPLogonLanguage must be null or be a string of length 2, consisting of digits and latin characters only");
|
|
425
|
+
|
|
426
|
+
if ( oLanguageTag.toString() != Localization.getLanguageTag().toString() ||
|
|
427
|
+
sSAPLogonLanguage !== oWritableConfig.get({
|
|
428
|
+
name: "sapLanguage",
|
|
429
|
+
type: BaseConfig.Type.String,
|
|
430
|
+
defaultValue: undefined,
|
|
431
|
+
external: true
|
|
432
|
+
})) {
|
|
433
|
+
oWritableConfig.set("sapLanguage", sSAPLogonLanguage);
|
|
434
|
+
oWritableConfig.set("sapUiLanguage", oLanguageTag.toString());
|
|
435
|
+
mChanges = {};
|
|
436
|
+
mChanges.language = Localization.getLanguageTag().toString();
|
|
437
|
+
var bRtl = Localization.getRTL();
|
|
438
|
+
if ( bOldRTL != bRtl ) {
|
|
439
|
+
mChanges.rtl = bRtl;
|
|
440
|
+
}
|
|
441
|
+
fireChange();
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Retrieves the configured IANA timezone ID.
|
|
447
|
+
*
|
|
448
|
+
* @returns {string} The configured IANA timezone ID, e.g. "America/New_York"
|
|
449
|
+
* @public
|
|
450
|
+
* @since 1.99.0
|
|
451
|
+
*/
|
|
452
|
+
getTimezone : function () {
|
|
453
|
+
var sTimezone = oWritableConfig.get({
|
|
454
|
+
name: "sapTimezone",
|
|
455
|
+
type: BaseConfig.Type.String,
|
|
456
|
+
external: true,
|
|
457
|
+
defaultValue: oWritableConfig.get({
|
|
458
|
+
name: "sapUiTimezone",
|
|
459
|
+
type: BaseConfig.Type.String,
|
|
460
|
+
external: true
|
|
461
|
+
})
|
|
462
|
+
});
|
|
463
|
+
if (!sTimezone || !checkTimezone(sTimezone)) {
|
|
464
|
+
sTimezone = TimezoneUtils.getLocalTimezone();
|
|
465
|
+
}
|
|
466
|
+
return sTimezone;
|
|
467
|
+
},
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Sets the timezone such that all date and time based calculations use config timezone.
|
|
471
|
+
*
|
|
472
|
+
* <b>Important:</b> It is strongly recommended to only use config API at the earliest point
|
|
473
|
+
* of time while initializing a UI5 app. A later adjustment of the time zone should be
|
|
474
|
+
* avoided. It can lead to unexpected data inconsistencies in a running application,
|
|
475
|
+
* because date objects could still be related to a previously configured time zone.
|
|
476
|
+
* Instead, the app should be completely restarted with the new time zone.
|
|
477
|
+
* For more information, see
|
|
478
|
+
* {@link topic:6c9e61dc157a40c19460660ece8368bc Dates, Times, Timestamps, and Time Zones}.
|
|
479
|
+
*
|
|
480
|
+
* When the timezone has changed, the Core will fire its
|
|
481
|
+
* {@link sap.base.i18n.Localization#event:change change} event.
|
|
482
|
+
*
|
|
483
|
+
* @param {string|null} [sTimezone] IANA timezone ID, e.g. "America/New_York". Use <code>null</code> to reset the timezone to the browser's local timezone.
|
|
484
|
+
* An invalid IANA timezone ID will fall back to the browser's timezone.
|
|
485
|
+
* @public
|
|
486
|
+
* @return {this} <code>this</code> to allow method chaining
|
|
487
|
+
* @since 1.99.0
|
|
488
|
+
*/
|
|
489
|
+
setTimezone : function (sTimezone) {
|
|
490
|
+
check(sTimezone == null || typeof sTimezone === 'string',
|
|
491
|
+
"Configuration.setTimezone: sTimezone must be null or be a string");
|
|
492
|
+
|
|
493
|
+
var sCurrentTimezone = Localization.getTimezone();
|
|
494
|
+
sTimezone = sTimezone === null || !checkTimezone(sTimezone) ? undefined : sTimezone;
|
|
495
|
+
oWritableConfig.set("sapTimezone", sTimezone);
|
|
496
|
+
if (Localization.getTimezone() !== sCurrentTimezone) {
|
|
497
|
+
mChanges = {};
|
|
498
|
+
mChanges.timezone = Localization.getTimezone();
|
|
499
|
+
fireChange();
|
|
500
|
+
}
|
|
501
|
+
return this;
|
|
502
|
+
},
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Returns a LanguageTag object for the current language.
|
|
506
|
+
*
|
|
507
|
+
* The LanguageTag is derived from the {@link #getLanguage language} property.
|
|
508
|
+
*
|
|
509
|
+
* @return {sap.base.i18n.LanguageTag} The LanguageTag
|
|
510
|
+
* @public
|
|
511
|
+
*/
|
|
512
|
+
getLanguageTag : function () {
|
|
513
|
+
var oLanguageTag = new LanguageTag(Localization.getLanguage());
|
|
514
|
+
var sLanguageTag = oLanguageTag.toString();
|
|
515
|
+
var sLanguage = Localization.getModernLanguage(oLanguageTag.language);
|
|
516
|
+
var sScript = oLanguageTag.script;
|
|
517
|
+
// special case for "sr_Latn" language: "sh" should then be used
|
|
518
|
+
// config method is used to set the Accept-Language HTTP Header for ODataModel
|
|
519
|
+
// requests and .hdbtextbundle resource bundles.
|
|
520
|
+
// It has to remain backward compatible
|
|
521
|
+
if (sLanguage === "sr" && sScript === "Latn") {
|
|
522
|
+
sLanguageTag = sLanguageTag.replace("sr-Latn", "sh");
|
|
523
|
+
} else {
|
|
524
|
+
sLanguageTag = sLanguageTag.replace(oLanguageTag.language, sLanguage);
|
|
525
|
+
}
|
|
526
|
+
return new LanguageTag(sLanguageTag);
|
|
527
|
+
},
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Returns whether the page uses the RTL text direction.
|
|
531
|
+
*
|
|
532
|
+
* If no mode has been explicitly set (neither <code>true</code> nor <code>false</code>),
|
|
533
|
+
* the mode is derived from the current language setting.
|
|
534
|
+
*
|
|
535
|
+
* @return {boolean} whether the page uses the RTL text direction
|
|
536
|
+
* @public
|
|
537
|
+
*/
|
|
538
|
+
getRTL : function () {
|
|
539
|
+
// if rtl has not been set (still null), return the rtl mode derived from the language
|
|
540
|
+
return oWritableConfig.get({
|
|
541
|
+
name: "sapRtl",
|
|
542
|
+
type: BaseConfig.Type.Boolean,
|
|
543
|
+
external:true,
|
|
544
|
+
defaultValue: oWritableConfig.get({
|
|
545
|
+
name: "sapUiRtl",
|
|
546
|
+
type: BaseConfig.Type.Boolean,
|
|
547
|
+
defaultValue: impliesRTL(Localization.getLanguageTag()),
|
|
548
|
+
external:true
|
|
549
|
+
})
|
|
550
|
+
});
|
|
551
|
+
},
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Sets the character orientation mode to be used from now on.
|
|
555
|
+
*
|
|
556
|
+
* Can either be set to a concrete value (true meaning right-to-left,
|
|
557
|
+
* false meaning left-to-right) or to <code>null</code> which means that
|
|
558
|
+
* the character orientation mode should be derived from the current
|
|
559
|
+
* language (incl. region) setting.
|
|
560
|
+
*
|
|
561
|
+
* After changing the character orientation mode, the framework tries
|
|
562
|
+
* to update localization specific parts of the UI. See the documentation of
|
|
563
|
+
* {@link #setLanguage} for details and restrictions.
|
|
564
|
+
*
|
|
565
|
+
* <b>Note</b>: See documentation of {@link #setLanguage} for restrictions.
|
|
566
|
+
*
|
|
567
|
+
* @param {boolean|null} bRTL new character orientation mode or <code>null</code>
|
|
568
|
+
* @return {this} <code>this</code> to allow method chaining
|
|
569
|
+
* @public
|
|
570
|
+
*/
|
|
571
|
+
setRTL : function(bRTL) {
|
|
572
|
+
check(bRTL === null || typeof bRTL === "boolean", "bRTL must be null or a boolean");
|
|
573
|
+
bRTL = bRTL === null ? undefined : bRTL;
|
|
574
|
+
var oldRTL = Localization.getRTL();
|
|
575
|
+
oWritableConfig.set("sapRtl", bRTL);
|
|
576
|
+
var bCurrentRTL = Localization.getRTL();
|
|
577
|
+
if ( oldRTL != bCurrentRTL ) { // also take the derived RTL flag into account for the before/after comparison!
|
|
578
|
+
mChanges = {};
|
|
579
|
+
mChanges.rtl = bCurrentRTL;
|
|
580
|
+
fireChange();
|
|
581
|
+
}
|
|
582
|
+
return this;
|
|
583
|
+
},
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Best guess to get a proper SAP Logon Language for a given LanguageTag.
|
|
587
|
+
*
|
|
588
|
+
* Conversions taken into account:
|
|
589
|
+
* <ul>
|
|
590
|
+
* <li>use the language part only</li>
|
|
591
|
+
* <li>convert old ISO639 codes to newer ones (e.g. 'iw' to 'he')</li>
|
|
592
|
+
* <li>for Chinese, map 'Traditional Chinese' or region 'TW' to SAP proprietary code 'zf'</li>
|
|
593
|
+
* <li>map private extensions x-saptrc, x-sappsd and saprigi to SAP pseudo languages '1Q', '2Q' and '3Q'</li>
|
|
594
|
+
* <li>remove ext. language sub tags</li>
|
|
595
|
+
* <li>convert to uppercase</li>
|
|
596
|
+
* </ul>
|
|
597
|
+
*
|
|
598
|
+
* Note that the conversion also returns a result for languages that are not
|
|
599
|
+
* supported by the default set of SAP languages. config method has no knowledge
|
|
600
|
+
* about the concrete languages of any given backend system.
|
|
601
|
+
*
|
|
602
|
+
* @param {sap.base.i18n.LanguageTag} oLanguageTag The Locale to calculate the SAPLogonLanguage
|
|
603
|
+
* @returns {string} a language code that should
|
|
604
|
+
* @private
|
|
605
|
+
* @ui5-restricted sap.ui.core
|
|
606
|
+
**/
|
|
607
|
+
_getSAPLogonLanguage : function(oLanguageTag) {
|
|
608
|
+
var sLanguage = oLanguageTag.language || "";
|
|
609
|
+
|
|
610
|
+
// cut off any ext. language sub tags
|
|
611
|
+
if ( sLanguage.indexOf("-") >= 0 ) {
|
|
612
|
+
sLanguage = sLanguage.slice(0, sLanguage.indexOf("-"));
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
// convert to new ISO codes
|
|
616
|
+
sLanguage = Localization.getModernLanguage(sLanguage);
|
|
617
|
+
|
|
618
|
+
// handle special case for Chinese: region TW implies Traditional Chinese (ZF)
|
|
619
|
+
if ( sLanguage === "zh" && !oLanguageTag.script && oLanguageTag.region === "TW" ) {
|
|
620
|
+
return "ZF";
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
return (
|
|
624
|
+
M_LOCALE_TO_ABAP_LANGUAGE[join(sLanguage, oLanguageTag.script)]
|
|
625
|
+
|| M_LOCALE_TO_ABAP_LANGUAGE[join(sLanguage, oLanguageTag.region)]
|
|
626
|
+
|| M_LOCALE_TO_ABAP_LANGUAGE[getPseudoLanguageTag(oLanguageTag.privateUse)]
|
|
627
|
+
|| sLanguage.toUpperCase()
|
|
628
|
+
);
|
|
629
|
+
},
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Returns an SAP logon language for the current language.
|
|
633
|
+
*
|
|
634
|
+
* It will be returned in uppercase.
|
|
635
|
+
* e.g. "EN", "DE"
|
|
636
|
+
*
|
|
637
|
+
* @return {string} The SAP logon language code for the current language
|
|
638
|
+
* @public
|
|
639
|
+
*/
|
|
640
|
+
getSAPLogonLanguage : function () {
|
|
641
|
+
var oLanguageTag,
|
|
642
|
+
sLanguage = oWritableConfig.get({
|
|
643
|
+
name: "sapLanguage",
|
|
644
|
+
type: BaseConfig.Type.String,
|
|
645
|
+
external: true
|
|
646
|
+
}).toUpperCase();
|
|
647
|
+
|
|
648
|
+
try {
|
|
649
|
+
oLanguageTag = fromSAPLogonLanguage(sLanguage).languageTag;
|
|
650
|
+
} catch (exc) {
|
|
651
|
+
//do nothing
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
if (sLanguage && !oLanguageTag) {
|
|
655
|
+
Log.warning("sap-language '" + sLanguage + "' is not a valid BCP47 language tag and will only be used as SAP logon language");
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
return sLanguage || Localization._getSAPLogonLanguage(Localization.getLanguageTag());
|
|
659
|
+
},
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* @returns {sap.base.i18n.date.CalendarType} The preferred Calendar type.
|
|
663
|
+
* @private
|
|
664
|
+
* @ui5-restricted sap.ui.core
|
|
665
|
+
*/
|
|
666
|
+
getPreferredCalendarType : function() {
|
|
667
|
+
var oLocale = Localization.getLanguageTag();
|
|
668
|
+
return _mPreferredCalendar[oLocale.language + "-" + oLocale.region] ||
|
|
669
|
+
_mPreferredCalendar[oLocale.language] ||
|
|
670
|
+
_mPreferredCalendar["default"];
|
|
671
|
+
},
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* List of languages that the SAPUI5 core delivers.
|
|
675
|
+
*
|
|
676
|
+
* Might return undefined if the information is not available.
|
|
677
|
+
*
|
|
678
|
+
* @return {array|undefined} List of Languages delivered with core
|
|
679
|
+
* @experimental
|
|
680
|
+
*/
|
|
681
|
+
getLanguagesDeliveredWithCore : function() {
|
|
682
|
+
return _coreI18nLocales;
|
|
683
|
+
},
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* @return {array} List of supported languages
|
|
687
|
+
* @experimental
|
|
688
|
+
*/
|
|
689
|
+
getSupportedLanguages : function() {
|
|
690
|
+
var aLangs = BaseConfig.get({
|
|
691
|
+
name: "sapUiXxSupportedLanguages",
|
|
692
|
+
type: BaseConfig.Type.StringArray,
|
|
693
|
+
external: true
|
|
694
|
+
});
|
|
695
|
+
if ( aLangs.length === 0 || (aLangs.length === 1 && aLangs[0] === '*') ) {
|
|
696
|
+
aLangs = [];
|
|
697
|
+
} else if ( aLangs.length === 1 && aLangs[0] === 'default' ) {
|
|
698
|
+
aLangs = this.getLanguagesDeliveredWithCore() || [];
|
|
699
|
+
}
|
|
700
|
+
return aLangs;
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
function fireChange() {
|
|
705
|
+
Localization.fireEvent("change", mChanges);
|
|
706
|
+
mChanges = undefined;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
Eventing.apply(Localization);
|
|
710
|
+
return Localization;
|
|
711
|
+
});
|