define(["dialog","globalize"],function(dialog,globalize){"use strict";return function(text,title){var options="string"==typeof text?{title:title,text:text}:text,items=[];return items.push({name:options.cancelText||globalize.translate("Cancel"),id:"cancel",type:"cancel"===options.primary?"submit":"cancel"}),items.push({name:options.confirmText||globalize.translate("ButtonOk"),id:"ok",type:"cancel"===options.primary?"cancel":"submit"}),"cancel"!==options.primary&&items.reverse(),options.buttons=items,dialog(options).then(function(result){return"ok"===result?Promise.resolve():Promise.reject(result)})}});