Question

I need to translate my application to multiple languages, including Tongan and Samoan. These are not valid Locale objects, so when I try to use things like the taglib fmt:formatDate, it just shows up in English.

I have translations, but I don't know how to tell formatDate how to use them. I could make my own taglib, but I don't want the overhead and maintenance nightmare of replacing all existing tags with a new one (very large application).

Any suggestions?

Was it helpful?

Solution

I think I just found the answer:

Format date in JSP for unsupported Locale

Which states:

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://www.oracle.com/technetwork/articles/javase/i18n-enhance-137163.html

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top