Supporting Multiple Languages

Properties file

SAP UI5 uses .property files for internationalization. This is common for many types of web apps. (See https://sapui5.netweaver.ondemand.com/sdk/#/topic/91f217c46f4d1014b6dd926db0e91070)


The translation for each language is held is different language specific.properties files, with each language having it’s own file with an extension of that language. For example:

File Referenced: 18n.properties

language=English

label1=English Label

label2=A Label

 

German translations: i18n_de.properties

language=German

label1=Etikette

label2=der Aufkleber

Reference Properties File in App

Set in Project Properties File URL

In the FAB Project we add a reference to the Properties file to be used.

The file can be stored anywhere that is accessible to the app.

Use {i18n>..} syntax when defining translatable content

Here for example, we do not give the Form Title property a hard-coded value, we instead use {i18n>language}

At run-time, this will display ‘English’ or ‘German’, depending on the log-on language used

You can also default the language in the App’s properties.