I have two models of i18n:
i18n_en.properties
for Englishi18n_ar.properties
for ArabicMy goal here is to get the corresponding text for English only despite the detected language.
The following function gets the text based on the automatic language detection.
fGetText: function(sText) {
var oBundle = this.getView().getModel("i18n").getResourceBundle();
return oBundle.getText(sText);
},
Is there a way to retrieve text for specific language?
You can use ResourceBundle.create
method for creating new one with giving locale param.
ResourceBundle.create({
url : "i18n/i18n.properties",
locale : "en",
async: true,
})
Documentation of ResouceBundle
here.