Reputation: 808
I have used a js prompt. The message and default value shown in Arabic , but OK/Cancel button shown in English, How to change the OK/Cancel button in to Arabic
My java script is
var enter_name ='<fmt:message key="enter.name"/>';
var _name ='<fmt:message key="default.name"/>';
prompt(enter_name,_name);
Properties file Arabic
enter.name=أدخل اسم المستخدم
default.name=اسم المستخدم
English
enter.name=Enter Username
default.name=Username
I have tried with jPrompt , changed the jquery.alerts.js
Ok/Cancel button changed to Arabic and jPrompt displayed it correctly means it shown in Arabic. But the problem is when we use the jPrompt ,it execute the next line of code before clicking the Ok/Cancel button.I don't need to execute next line of code before clicking the OK/Cancel button. That s why I choose prompt , but I don't know how to change the OK/Cancel button caption into arabic.
Upvotes: 0
Views: 1588
Reputation: 3639
the javascript prompt is not in your control. IE on windows follows Operating system language for the prompt message . i.e. as it uses messagebox Win32 API call. non native browsers Google chrome and Firefox uses Browser language settings . Its like browsers might follow OS language or browser language . Refer :- set browser language.
Upvotes: 0
Reputation: 23346
You cannot. prompt
is a browser API that uses the browser chrome locale - ie, the "OK" and "CANCEL" will be in the client browser's language.
Upvotes: 3