loio |
---|
4e593b44e78a431e8b21be6b3915fb55 |
view on: demo kit nightly build | demo kit latest release
Resource bundles exist to enable an app to run in multiple languages without the need to change any code. To demonstrate this feature, let's create a German version of the app – in fact, all we need to do is create a German version of the resource bundle file. In our code, we activate the German locale for the ResourceModel.
The texts are now adapted for the German locale
You can view and download all files in the Demo Kit at Data Binding - Step 7.
In the i18n
folder, duplicate the i18n.properties
file and rename its copy to i18n_de.properties
. Replace the English text with the German text provided below. The suffix de
represents the locale for the German language. Since the de
locale is already set in the supportedLocales
configuration of the manifest.json
, it will be taken into account.
# Field labels
firstName=Vorname
lastName=Nachname
enabled=Aktiviert
# Screen titles
panelHeaderText=Data Binding Grundlagen
To check the result, append the sap-language=DE
URL parameter to the URL in your browser, for example http://localhost:port/index.html?sap-language=DE
. Once you remove this parameter, your app reverts to your browser's default language.
Parent topic:Data Binding Tutorial
Previous:Step 8: Binding Paths: Accessing Properties in Hierarchically Structured Models
Related Information