Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javascript alert message in russian language

 
Suresh Reddy Puli
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
 
Suresh Reddy Puli
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try putting the following at the beginning of your JSP:
<%@ page
language="java"
contentType="text/html; charset=windows-1251"
pageEncoding="windows-1251"
%>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic