xxx.i18n = function (property) {
if (arguments.length > 1) {
var text = sap.ui.getCore().getModel("i18n").getProperty(arguments[0]);
if (text) {
for (index = 1; index < arguments.length; ++index) {
text = text.replace("{" + index + "}", arguments[index]);
}
}
return text;
}
else {
return sap.ui.getCore().getModel("i18n").getProperty(property);
}
};
xxx.i18n("NAME_OF_THE_PROPERTY", param1, param2);//will replace {1} with value from param1 and {2} with param2 etc