我有一個按鈕(創建應用程序),如果我點擊一個按鈕將出現一個零碎的對話框。這裏能夠顯示零碎的對話框。但是內部化(i18n)沒有出現在字段中。 (對於xml
文件能夠證明i18n
但fragment.xml
文件無法顯示i18n
/)本地化(i18n)在sapui5 for fragment.xml文件沒有出現
component.js
:
createContent : function() {
// create root view
var oView = sap.ui.view({
id : "app",
viewName : "sap.gss.program.view.App",
type : "JS",
viewData : { component : this }
});
var i18nModel = new sap.ui.model.resource.ResourceModel({
bundleUrl : "i18n/appTexts_fr.properties"
});
oView.setModel(i18nModel, "i18n");
return oView;
}
Controller.js
:
createApplication: function (oEvent) {
if (!this.oDialogFragment) {
this.oDialogFragment = sap.ui.xmlfragment("sap.gss.program.view.myFragment",
this);
}
this.oDialogFragment.open();
}
fragment.xml
:
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:app="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1">
<Dialog
title="{i18n>Title}"
class="sapUiPopupWithPadding" >
<HBox>
<Text text="{i18n>Description_TEXT}" > </Text>
</HBox>
<beginButton>
<Button text="{i18n>Ok}" press="DialogButton" />
</beginButton>
<endButton>
<Button text="{i18n>Cancel}" press="CloseButton" />
</endButton>
</Dialog>
</core:FragmentDefinition>
當您在Fiori Launchpad中工作時,不應該這樣做,因爲它與其他應用程序衝突。 – hirse 2016-05-10 13:36:02