This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes javascript  alert message in russian language Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "javascript  alert message in russian language" Watch "javascript  alert message in russian language" New topic
Author

javascript alert message in russian language

Suresh Reddy Puli
Greenhorn

Joined: Aug 31, 2006
Posts: 2
I need help to get javascript alert message to be displayed in russian language in an html page. The code for the message in my properties files is Банки which is means "Banks" in english.
Kindly help me know the code for getting this done.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
One way to use a message from your properties file in a JavaScript alert would be to create a global JavaScript variable in your JSP like this:

<script>
var g_errorMessage = '<bean:message key="error.key" />';
</script>

When the page is rendered, the g_errorMessage field will contain the value of the message in the language of the user's current locale.

Then, when you're ready to display the message, just write:

alert(g_errorMessage);


Merrill
Consultant, Sima Solutions
Suresh Reddy Puli
Greenhorn

Joined: Aug 31, 2006
Posts: 2
I tried with this. Though i did not get required message. Its displaying unicode as it is. Please help me. Its very urjent.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Try putting the following at the beginning of your JSP:
<%@ page
language="java"
contentType="text/html; charset=windows-1251"
pageEncoding="windows-1251"
%>
 
 
subject: javascript alert message in russian language
 
Similar Threads
alert message - perl ?
Javascript code inside JSP (error in flushing)
How to display French and German Character in Javascript Alert?
Capture the back page event in java script
Capture Browser language preference using javascript