0

I have a date and I want to output it in a JSP. Currently I use JSTL:

<fmt:formatDate pattern="dd MMMM yyyy" value="${date}" />

Which is very neat as long as the user's language is one that is supported by the JRE. However, we have a requirement to provide this user interface in Welsh. If there a nice way to get the name of the month output in Welsh?

rjsang
  • 1,757
  • 3
  • 16
  • 26

1 Answers1

3

If using Java 6, APIs have been exposed to allow you to add localization support to locales that are not supported by the JRE itself. See the "Local sensitive services" section in the following link for a brief overview: http://java.sun.com/developer/technicalArticles/javase/i18n_enhance/

An alternative option is to build your own custom tag which uses custom resource bundles to display the month in the correct language.

Kris Babic
  • 6,254
  • 1
  • 29
  • 18
  • Brilliant. I was unaware of this new feature in Java 6. – rjsang Feb 25 '11 at 11:49
  • 1
    The article is now on [the oracle site](http://www.oracle.com/technetwork/articles/javase/i18n-enhance-137163.html) (just in case anyone else is looking for it like I just was). – Gareth Jan 06 '13 at 23:26