我有一个代码,用于检查服务器的响应,并根据收到的信息显示消息框。我有两种语言的这些消息(用户在登录时选择一种语言)。 这里是例子:i18n型号无法正常工作
if(sResponse == 'IDfail'){
sap.m.MessageBox.alert
("{i18nResourceModel>idnotnine}",
{icon: sap.m.MessageBox.Icon.ERROR,
title: "{i18nResourceModel>error}"}
);
}
这里是国际化模型声明(这是以前我用的模型,当然申报):
var oResourceModel = new sap.ui.model.resource.ResourceModel
({bundleUrl: "i18n/i18n.properties", bundleLocale: "en"});
sap.ui.getCore().setModel(oResourceModel, "i18nResourceModel");
我有2个.properties
文件:i18n.properties
(英文)和i18n_iw.properties
(希伯来文)。
奇怪的是,消息框的title
被正确翻译,但代替消息本身,我看到文本:“i18nResourceModel> idnotnine”。
它工作得很好,我无法弄清楚发生了什么。
什么可能导致此问题,我该如何解决?
谢谢。
你有没有idnotnine = .properties文件中的一些文本? –
@jumpifzero当然,我确实。此外,如果我把''{i18nResourceModel> idnotnine}“'作为'title'的文本,我确实看到了这个消息。 – keshet