on 06-25-2015 10:35 AM
Hello experts,
I have extended Shopping Cart Fiori app. I would like to use a custom text in my extended app. Following the standard method, I have added this text in my i18n.properties and i18n_en.properties files of my extended app under i18n folder. I am able to access this and the custom text is displayed as well when I run the app in eclipse environment.
But the problem occurs after deploying the app to ECC. Somehow, I am unable to get the right values. I see in the network tab there are 2 property files which returns 404 error :
Could this be an issue?
It's strange how the text is visible when I run it in my eclipse environment and doesn't work after deployment.
Below is how Component.js file looks like in my extended app:
Please let me know where i'm I wrong. Help much appreciated.
Regards,
Prerana
try,
config : {
bundleName : "i18n/i18n.properties",
}
init : function() {
sap.ui.core.UIComponent.prototype.init.apply(this, arguments);
var mConfig = this.getMetadata().getConfig();
// Always use absolute paths relative to our own component
// (relative paths will fail if running in the Fiori Launchpad)
var oRootPath = jQuery.sap.getModulePath("NAMESPACE");
// Set i18n model
var i18nModel = new sap.ui.model.resource.ResourceModel({
bundleUrl : [oRootPath, mConfig.resourceBundle].join("/")
});
this.setModel(i18nModel, "i18n");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot, Santosh!
It worked. The following is what I have in my Component.js :
init : function() {
if (ui.s2p.srm.sc.approve.Component.prototype.init !== undefined)
ui.s2p.srm.sc.approve.Component.prototype.init.apply(this, arguments);
sap.ui.core.UIComponent.prototype.init.apply(this, arguments);
var mConfig = this.getMetadata().getConfig();
// Always use absolute paths relative to our own component
// (relative paths will fail if running in the Fiori Launchpad)
var oRootPath = jQuery.sap.getModulePath("ui.s2p.srm.sc.approve.SRM_SC_APVExtension");
// Set i18n model
var i18nModel = new sap.ui.model.resource.ResourceModel({
bundleUrl : [oRootPath, mConfig.resourceBundle].join("/")
});
this.setModel(i18nModel, "i18nCustom");
},
But I left the config area as the following since I want to replace the standard text with a custom:
config : {
"sap.ca.i18Nconfigs" : {
bundleName : "ui.s2p.srm.sc.approve.SRM_SC_APVExtension.i18n.i18n",
}
},
Thanks again for the answer!
Best,
Prerana
pass
jQuery.sap.getModulePath("ui.s2p.srm.sc.approve.SRM_SC_APVExtension") + "./i18n/i18n.properties"
to bundleUrl
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.