I do appreciate the suggestions presented to me. Let me share with you how
I solved the problem.
It was actually quite simple. I simply added the following line to my
resin.conf (I'm using resin, but the same type of solution should work for
anything) file:
<servlet-mapping url-pattern='*.js'
servlet-name='com.caucho.jsp.JspServlet'/>
That way I can still keep the ".js" extension, but it will be considered a
jsp file to the servlet container. I then placed the bean:message tags
wherever I needed internationalized text (example: confirm("<bean:message
key="title.logon"/>" )) and ... voila! It works! I think. I tested it
only a couple times and only in one instance, but I think it will work for
what I need it for.
-Dallas
Dallas_Brownin
[EMAIL PROTECTED] To: [EMAIL PROTECTED]
cc:
03/30/01 10:58 Fax to:
AM Subject: Internationalized
JavaScript?...
Please respond
to struts-user
Let's say you have an alert box that has a message. You want that message
to be internationalized. Let's also assume that you want your JavaScript
source to not be in the jsp/html page, you would rather link to it (i.e.
<script src="[location of JavaScript source file]">).
How do you get the internationalized message to show up in the alert box?
The only two solutions I can think of are these:
Bear in mind, they are only workarounds.
1- pass the message as parameters when calling the function. example:
onClick="alert(<bean:message key="international.message"/>)"
2- simply give up on the second requirement and keep the code in the jsp
page.
Any suggestions?
-Dallas