-
26 Sep 2012 1:03 AM #1
3.0.1 DatePicker ignores Locale
3.0.1 DatePicker ignores Locale
The GXT3(.0.1) DatePicker is always english.
To fix this, change in com.sencha.gxt.widget.core.client.DatePicker
toprivate final DefaultDateTimeFormatInfo constants = new DefaultDateTimeFormatInfo ();
private final DefaultDateTimeFormatInfo constants = GWT.create(DateTimeFormatInfoImpl.class);
thanks for fixin
-
26 Sep 2012 6:44 AM #2
Thanks - this has already been fixed in SVN, and will be available in the next release. The line currently looks like this:
Code:private DateTimeFormatInfo constants = LocaleInfo.getCurrentLocale().getDateTimeFormatInfo();
-
26 Sep 2012 9:45 PM #3
Width hardcoded in DatePickerBaseAppearance
Width hardcoded in DatePickerBaseAppearance
There is one more problem with localization of DatePicker. In render method of DatePickerBaseAppearance there is hardcoded width (line : sb.appendHtmlConstant("<div class=" + style.datePicker() + " style='width: 177px'>")
, wich is not enaugh for october in polish language ("październik"), 185px will be enaugh. On the other hand there is no good idea to put the width in this place - maybe it should be moved to the DatePickerStyle.
-
27 Sep 2012 12:53 AM #4
-
1 Nov 2012 11:09 PM #5
The workaround does not allow it to be applied via subclassing. So, is there an instruction to self-compile GXT library as of you do not provide any information on how to get a nightly build?
-
2 Nov 2012 6:09 AM #6
You can apply the workaround with JSNI, or modify the .java file and recompile it.
SVN and nightly builds (via both maven and download from the support portal) are only available to support users.
-
6 Nov 2012 12:12 AM #7
So, I tried to inject a recompiled com.sencha.gxt.widget.core.client.DatePicker.class to my project with the upmentioned changes to it. According to GWT 2.4.0 i18n implementations return firstDayOfWeek taken from .properties file and substracted 1. That means that:
DateTimeConstantsImpl_en.properties defines firstDayOfWeek = 1. Via JAVA implementation will programmatically return 0. This makes
unnecessary or at least a substraction in this code. Deleted that substraction and the code now works as it should.Code:private int getCalculatedStartDay() { return startDay != Integer.MIN_VALUE ? startDay : constants .firstDayOfTheWeek() - 1; }
Success! Looks like we've fixed this one. According to our records the fix was applied for
a bug in our system
in
a recent build.


Reply With Quote
