aspose file tools*
The moose likes JSP and the fly likes internationalization in JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "internationalization in JSTL" Watch "internationalization in JSTL" New topic
Author

internationalization in JSTL

Vasudhaiv Naresh
Ranch Hand

Joined: May 13, 2005
Posts: 57
Hi all!
i would like to know how pages can be internationalized using PropertiesResourceBundle in JSTL.
I had tried as shown in the fragment below, but it didn't work :

-------------------------------------------------------
<fmt:bundle basename="resources.application">
locale : ${param.local}
<fmt:setLocale value="${param.local}"/>
<title> <fmt:message key="welcome.title"/></title>
<h1><fmt:message key="welcome.heading"/></h1>
<hr>
<fmt:message key="welcome.message"/>
</fmt:bundle>
-------------------------------------------------------

Here, the base resource bundle is "application.properties",
and i've created a couple of other resource bundles, say - "application_de.properties" and "application_sh.properties".
I'm not getting the desired result even upon setting the locale to "de" or "sh".
Kindly give some suggestions, as to where I might have gone wrong and how it is actually to be done.
Regards,
Naresh
Vasudhaiv Naresh
Ranch Hand

Joined: May 13, 2005
Posts: 57
Hi all!
I found that the problem occurred with the following :
---------------------------------------------------------
<B><fmt:bundle basename="resources.application"></B>
locale : ${param.local}
<B>fmt:setLocale value="${param.local}"/></B>
<title> <fmt:message key="welcome.title"/></title>
<h1><fmt:message key="welcome.heading"/></h1>
<hr>
<fmt:message key="welcome.message"/>
</fmt:bundle>
---------------------------------------------------------

The reason being :
The locale should be set prior to setting the "bundle basename".

Regards,
Naresh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: internationalization in JSTL