Skip to Content

How to add another i18n file in manifest.json and get it initialized in application?


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 in manifest.json and also call it in application based on switch state?

Below are the screenshots of various files:


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 file.

View xml:

Please advise how to work on this.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Sep 05, 2017 at 04:25 PM

    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 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 file) display static texts in German.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 11, 2017 at 06:15 AM

    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).

    Add comment
    10|10000 characters needed characters exceeded