SAP UI5 Localization - SAP UI5

What is localisation in SAP UI5?

SAP UI5 provides localization concept with the support of Java platform.
Identifying the Language Code – Here framework uses a language code of type string in identification of languages.
Resource Bundles − A resource bundle file is known a Java properties file which consists of key/value pairs where the values are language-dependent texts and the keys are language independent. These keys are used by the application to identify and access the corresponding values.
Resource bundles are a collection of *.properties files. All files are named with the same base name (prefix identifying the resource bundle), an optional suffix that identifies the language contained in each file, and the fixed .properties extension.
The language suffixes are formed according to the older JDK locale syntax. By convention, a file without a language suffix should exist and contain the raw untranslated texts in the developer's language. This file is used if no more suitable language can be found.
Resource bundle sap.ui.commons.message_bundle contains the following files −
  • sap.ui.commons.message_bundle.properties − This file carries the raw text from the developer and it determines the set of keys.
  • sap.ui.commons.message_bundle_en.properties − This file carries English text.
  • sap.ui.commons.message_bundle_en_US.properties − This file carries text in American English.
  • sap.ui.commons.message_bundle_en_UK.properties − This file carries text in British English.

Use of Localized Texts in Applications

SAPUI5 provides two options to use localized texts in applications – the jQuery.sap.resources module and data binding.
Use below mentioned code to get resource bundle for a given language –
Use below mentioned code to access the text in resource bundle –
Use below mentioned code to get URL of a resource –

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SAP UI5 Topics