cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 Application, Index.html page title from I18n

narinderpal
Explorer

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

Accepted Solutions (1)

Accepted Solutions (1)

mariusobert
Developer Advocate
Developer Advocate

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>;

Answers (1)

Answers (1)

karthikarjun
Active Contributor

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

onAfterRendering : {
document.title = this.getView().getModel("i18n").getResourceBundle().getText("<>");
}