dialog buttons questions

dialog buttons questions

Dear all!

i just need to localize the button labels for a dialog.
but how to do it? as in:
  1. $dialog.dialog({
  2.     buttons: {
  3.         'Ok': function(){
  4.             // ok
  5.         },
  6.         'Cancel': function(){
  7.             // cancel
  8.         }
  9.     }
  10.     // 1000 more options
  11. });
the labels will be always literals.
so the only way i see is to have a copy of the whole options object for each locale (or at least the buttons with the callbacks, that i will have to merge every time with the rest of the options). but it would be nicer/compacter/better to be able to use a variable as button label.
any idea?

on the other hand i was just wondering how to set the order of the buttons? it seems that at least the ordering is consistent, but NOT always the given order (and how? since object properties do not have any order).
any thoughts about this one?

and the last question/feature request:
there might be several ways to close a dialog, like using the 'x' button on the title bar, or clicking on the background, programatically calling $dialog.close(), or even having a cancel button. and it is not easy at all to achieve that all these methods execute the same callback. since,for me at least, this is a very recurrent task i would love to have a better way to achieve this...
like being able to define a callback for close(), and all the other ways using just close().