Hi,
since the J2EE runtime seems to revert to some inappropriate standard
locale when using the actual locale "ta-IN", I've written a customized
DateFormatProvider and successfully deployed it to the application
server. It looks like this:
public class TamilNaduDateFormatProvider extends
java.text.spi.DateFormatProvider{
@Override
public DateFormat getTimeInstance(int style, Locale locale) {
return DateFormat.getTimeInstance(style, Locale.UK);
}
@Override
public DateFormat getDateInstance(int style, Locale locale) {
return DateFormat.getDateInstance(style, Locale.UK);
}
@Override
public DateFormat getDateTimeInstance(int dateStyle, int timeStyle,
Locale locale) {
return DateFormat.getDateTimeInstance(dateStyle, timeStyle,
Locale.UK);
}
@Override
public Locale[] getAvailableLocales() {
return new Locale[]{new Locale("ta", "IN")};
}
}
It needs to be packed into a jar with some meta information and
deployed to the runtime's lib/ext directory.
Here is some background:
http://download.oracle.com/javase/6/docs/technotes/guides/extensions/index.html
For server code, this works fine. However, the GWT-UI in my case still
uses that inappropriate default locale (even after doing a
recompilation using the extended (by the customized
DateFormatProvider) runtime.
So my question is: How does GWT determine the proper date formatting
for the locale sent from the browser and how could I plug-in into this
system to have "ta-IN" properly supported?
Apparently, the standard Java mechanism does not work, or am I wrong?
Is it because GWT uses the SDK rather than the runtime? I tried to
create the corresponding lib/ext Folder even in the SDK and put the
jar there but this also did not help...
Regards,
panam