2

I'm using jquery dialog box to display Confirm & Cancel button as shown below:

  $("#delete_user").click(function(e) {
    $("#delete_user_dialog").dialog({
      buttons : {
        "Confirm" : function() {
          $(this).dialog("close");
          DeleteUser();
        },
        "Cancel" : function() {
          $(this).dialog("close");
        }
      }
    });
    $("#delete_user_dialog").dialog("open");

});

Is it possible to localize this text "Confirm" & "Cancel"??

thanks!

Mike
  • 7,606
  • 25
  • 65
  • 82

1 Answers1

1

Really it's just a matter of storing localized counterparts for each string: Localize Strings in Javascript.

And then detecting/having the user choose their language: JavaScript for detecting browser language preference

When you create the dialog box, just choose the correct version of the string using the above. You will probably want to let the user opt-in to whatever language they want as opposed to automatically detecting their language every time. That way, multilingual users won't get upset.

Community
  • 1
  • 1
Chris Laplante
  • 29,338
  • 17
  • 103
  • 134