diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-02-21 18:36:42 -0600 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-02-22 13:26:09 -0500 |
commit | 39a00b496c57b1617fff9564dd78529b0486216a (patch) | |
tree | ebd82a6c683747073069ed6701b763c794792957 /install/ui/ipa.js | |
parent | 397da3f78192cc8eafdf6d36d0ac1f3303bfaaa4 (diff) | |
download | freeipa-39a00b496c57b1617fff9564dd78529b0486216a.tar.gz freeipa-39a00b496c57b1617fff9564dd78529b0486216a.tar.xz freeipa-39a00b496c57b1617fff9564dd78529b0486216a.zip |
I18n update for dialog box buttons.
https://fedorahosted.org/freeipa/ticket/899
Diffstat (limited to 'install/ui/ipa.js')
-rw-r--r-- | install/ui/ipa.js | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/install/ui/ipa.js b/install/ui/ipa.js index 34244b0c4..2c07d742a 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -140,15 +140,18 @@ var IPA = ( function () { html: IPA.messages.dirty }). appendTo($("#navigation")); + + var buttons = {}; + + buttons[IPA.messages.buttons.ok] = function() { + $(this).dialog("close"); + }; + message_box.dialog({ title: 'Dirty', modal:true, width: '20em', - buttons: { - Ok: function() { - $( this ).dialog( "close" ); - } - } + buttons: buttons }); return false; } @@ -351,24 +354,33 @@ IPA.cmd = function (name, args, options, win_callback, fail_callback, objname, c function dialog_open(xhr, text_status, error_thrown) { var that = this; + var buttons = {}; + + /** + * When a user initially opens the Web UI without a Kerberos + * ticket, the messages including the button labels have not + * been loaded yet, so the button labels need default values. + */ + var label = IPA.messages.buttons ? IPA.messages.buttons.retry : 'Retry'; + buttons[label] = function() { + IPA.error_dialog.dialog('close'); + IPA.cmd(name, args, options, win_callback, fail_callback, + objname, command_name); + }; + + label = IPA.messages.buttons ? IPA.messages.buttons.cancel : 'Cancel'; + buttons[label] = function() { + IPA.error_dialog.dialog('close'); + if (fail_callback) { + fail_callback.call(that, xhr, text_status, error_thrown); + } + }; + IPA.error_dialog.dialog({ modal: true, title: error_thrown.title, width: 400, - buttons: { - 'Retry': function () { - IPA.error_dialog.dialog('close'); - IPA.cmd(name, args, options, win_callback, fail_callback, - objname, command_name); - }, - 'Cancel': function () { - IPA.error_dialog.dialog('close'); - if (fail_callback) { - fail_callback.call(that, xhr, text_status, - error_thrown); - } - } - } + buttons: buttons }); } @@ -395,7 +407,7 @@ IPA.cmd = function (name, args, options, win_callback, fail_callback, objname, c } else { error_thrown.message = "Your kerberos ticket is no longer valid. "+ - "Please run kinit and then click 'retry'. "+ + "Please run kinit and then click 'Retry'. "+ "If this is your first time running the IPA Web UI "+ "<a href='/ipa/config/unauthorized.html'>"+ "follow these directions</a> to configure your browser."; |