SAP UI5-资源包

问题描述

什么是SAP UI5中的资源包及其工作方式?我尝试使用formatter.js(自定义格式化程序),并尝试从i18n文件中读取错误信息未定义的文本。

var resourceBundle = this.getView()。getModel(“ i18n”)。getResourceBundle();

解决方法

我已经通过在component.js文件中为i18n模型创建对象解决了该错误。

var i18nModel = new ResourceModel({
bundleName: "Aggregation_binding.Aggregation_binding.i18n.i18n",supportedLocales: [""],fallbackLocale: ""
});
this.setModel(i18nModel,"i18n");