File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Localize select box" Watch "Localize select box" New topic

Localize select box

Mattias Ahlin

Joined: May 31, 2006
Posts: 11

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):

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,
[ August 26, 2007: Message edited by: Mattias Ahlin ]

Best regards,<br />Mattias
Mattias Ahlin

Joined: May 31, 2006
Posts: 11
Problem solved

I used:
<%@ taglib prefix="fmt" uri="" %>

instead of:
<%@ taglib prefix="fmt" uri="" %>

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?

I agree. Here's the link:
subject: Localize select box
It's not a secret anymore!