I am trzing to use i18n model for my view title but it is not showing correct title. Only variable it is showing.
**
here are my xml view details :
**
<mvc:View
controllerName="sap.ui.demo.myFiori.view.Master"
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc" >
<Page
title="{i18n>MasterTitle}" >
<List
items="{/SalesOrderCollection}" >
<StandardListItem
type="Active"
press="handleListItemPress"
title="{SoId}" />
</List>
</Page>
**
- below is details from file messageBundle.Properties
**
MasterTitle=Sales Orders DetailTitle=Sales Order
**
details of Component.js file are as below :
**
jQuery.sap.declare("sap.ui.demo.myFiori.Component");
sap.ui.core.UIComponent.extend("sap.ui.demo.myFiori.Component", {
createContent : function() {
// create root view
var oView = sap.ui.view({
id : "app",
viewName : "sap.ui.demo.myFiori.view.App",
type : "JS",
viewData : { component : this }
});
// set i18n model
var i18nModel = new sap.ui.model.resource.ResourceModel({
bundleUrl : "i18n/messageBundle.properties"
});
oView.setModel(i18nModel, "i18n");
// // Using OData model to connect against a real service // var url = "/proxy/http/:/sap/opu/odata/sap/ZGWSAMPLE_SRV/"; // var oModel = new sap.ui.model.odata.ODataModel(url, true, "", ""); // oView.setModel(oModel);
// Using a local model for offline development
var oModel = new sap.ui.model.json.JSONModel("model/mock.json");
oView.setModel(oModel);
// done
return oView;
}
});
Output is as below ![enter image description here][1]
In output it is showing MasterTitle instead of Sales Oreders
I want to display Sales Orders instead of MasterTitle in the title of Xml view page