It is not possible to use the confirm() and alert() JavaScript functions and have reliable results. It just depends on the language of the web browser, that is, the program , and not your preferred language.
The preferred language is used to tell the web server what your language preferences are for the web page .
So, how to localize confirmation dialogs or messages, you would ask?
Well, get rid of them. Instead, please use the jQuery UI Dialog modal confirmation and follow your regular localization method for JavaScript string resources.
This is the only way to get confirmation dialog headers and buttons reliably translated into the language of your web application.
source share