on 09-05-2017 8:53 AM
Hi,
I am creating an app locally, where in i have provided a switch control to switch between English and German language. As of now, English language text is loaded in the application. But i want to change the language of static texts in application on change of switch control state.
I am able to capture switch control's change state.
How to define i18n_de.properties in manifest.json and also call it in application based on switch state?
Below are the screenshots of various files:
Component.js:
Manifest json part 1:
Manifest json part 2:
Project json:
View controller js:
I want to reinitialize all the static texts in application, if the switch state is changed to false to German language using i18n_de.properties file.
View xml:
Please advise how to work on this.
Thanks,
Saurabh.
The SAPUI5 framework reads the container's (browser in which the app runs) language-locale setting and then initializes and reads the relevant i18n file with fallback to the default i18n.properties file. I don't think that just by clicking on a switch at run-time the language of the app can be changed. If you are running the app from the FLP then you would have to reload the page and append the sap-language URL parameter with the value DE and then your app will automatically (assuming your project's i18n folder has a i18n_de.properties file) display static texts in German.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since i am using this app locally, i created two resource models for English and German languages. I am binding German static texts explicitly from resource bundle on change of switch state. I cannot refresh page to change language as it would remove all existing data on that page.This is the only way i found to handle different languages (2).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.