I need to provide localization for the button text of a JQuery dialog, however JQuery dialog’s usually make use of the key for the button text:
$(DialogDiv).dialog({
bgiframe: true,
resizable: false,
buttons: { Save : saveCallback, Cancel : cancelCallback}
});
Is there a way to separately specify the text without using the key as the text value? Currently I am using this, however I am not a fan of using the localized values as the keys:
var buttonCallbacks = {};
buttonCallbacks[com.i18n.getText("Save")] = function() {};
buttonCallbacks[com.i18n.getText("Cancel")] = function() {};
$(DialogDiv).dialog({
bgiframe: true,
resizable: false,
buttons: buttonCallbacks
});
Thanks.
If you take a look at the button options for Dialog, you’ll notice the second format listed accepts an array of objects: