문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top