File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Localize select box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Localize select box" Watch "Localize select box" New topic
Author

Localize select box

Mattias Ahlin
Greenhorn

Joined: May 31, 2006
Posts: 11
Hi

I want a select box to display localized values (the values are: once, daily, weekly). I want these values to be displayed in different languages for different users. I'm already using the fmt tag to display localized messages on the site.

In the resouce file containing the translations I have this (I do of cource have the corresponding files for the other languages):
Global.Frequency.Once=Once
Global.Frequency.Daily=Daily
Global.Frequency.Weekly=Weekly

I've tried something like this (frequencies contains the values: Once, Daily, Weekly). But it failes because the fmt tag doesn't seem to accept expressions in the key. What I'm trying to do is to make the key for the fmt tag "Global.Frequency.Once", "Global.Frequency.Daily", "Global.Frequency.Weekly".



Any suggestions on how to solve something like this would be greatly apprechiated?

Best regards,
Mattias
[ August 26, 2007: Message edited by: Mattias Ahlin ]

Best regards,<br />Mattias
Mattias Ahlin
Greenhorn

Joined: May 31, 2006
Posts: 11
Problem solved

I used:
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>

instead of:
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

which is a older version where expressions weren't allowed.
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
Mattias, I like your idea. Would you please tell me where you placed the resource file (properties file?) in your web app structure?

Thanks
 
Consider Paul's rocket mass heater.
 
subject: Localize select box