This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes Accessing i18n properties from javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Accessing i18n properties from javascript" Watch "Accessing i18n properties from javascript" New topic

Accessing i18n properties from javascript

Arne Andersen

Joined: Oct 02, 2008
Posts: 8

This should be an easy question:

How can I access the i18n properties from within javascript?
I've tried to google it, but couldnt find much useful. Closest i came was:
var text = "%{getText('')}";
but that didnt work..

any ideas?
Jose Daquila

Joined: Oct 01, 2010
Posts: 3

alert("<bean:message key="msg.gral.errorKey"/>");

That is one way. It works!

I agree. Here's the link:
subject: Accessing i18n properties from javascript
Similar Threads
i18n JSPs
Struts2 - Custom implementation for i18n.
Using Resource Bundle in XML Config file
how to access i18n file in controller
s:text issue Struts 2