I try to implement i18n model in my app, but for some reason the model stays empty no matter what I tried to do.
I use WEB IDE and I have to work with a project which was created by somebody else. The structure of the project is different from the standard SAPUI5 app (there is no manifest.json, no webapp folder, the Component.js looks different etc.).
What I've already tried to do is to declare the i18n model in the component.js and bind it to the core:
var i18nModel = new sap.ui.model.resource.ResourceModel({
bundleName:"generated.app.i18n.i18n"
});
sap.ui.getCore().setModel(i18nModel, "i18n");
in the init() function of the component.js ("generated.app" is a namespace).
And than in my view:
<m:Page title="{i18n>title}">
.....
</m:Page>
The structure of the project looks like follows:
-Project_Name
|--view
|--i18n/i18n.properties
|--....
...
I also tried to declare the model in the controller, but it didn't work either.
In both cases the model is created, but it's empty.
i18n.properties
is present and has values.
What do I do wrong?
Thank you.
_oResourceBundle
property has data about locale, but no property files included. – keshetcreateContent
function inComponent.js
. Then I was setting my model likeoView.setModel(oi18nModel, "i18n")
– melomgbundleUrl:"i18n/i18n.properties"
, but the model is still empty. The component.js, where I define the model, is in the root folder. – keshet