我有一個代碼,用於檢查服務器的響應,並根據收到的信息顯示消息框。我有兩種語言的這些消息(用戶在登錄時選擇一種語言)。 這裏是例子: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