Skip to Content

SAP UI5 Application, Index.html page title from I18n

Hello Experts,

I am building a demo app in SAP UI5. I am just trying to replace hard coded text for Page Title for index.html page with I18n page attribute. This is a very simple exercise but I am facing difficulty. Can anybody explain, how i can achieve this?

Regards,

Narinder Pal Singh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on May 20, 2019 at 08:27 AM

    Hi Narinder,

    This approach isn't working because the index.html file is loaded before the SAPUI5 bootstrapping started and therefore the i18n files haven't been parse by then.

    What you can do, is setting the title manually as suggested here.

    document.title = <string from i18n file>;
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 20, 2019 at 10:54 PM

    Hi Narinder, You can use hook methods to get results.

    onAfterRendering : {
    document.title = this.getView().getModel("i18n").getResourceBundle().getText("<>");
    }
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.