• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Localize select box

 
Mattias Ahlin
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Mattias Ahlin
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mattias, I like your idea. Would you please tell me where you placed the resource file (properties file?) in your web app structure?

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic