Open dankurka opened 9 years ago
Reported by t.broyer
on 2012-09-15 01:00:45
Yes, there is a patch in progress to make all of the i18n APIs usable on the server.
Unfortunately, I was unable to finish it before I left Google and things have been
very hectic getting up to speed at my new job (at Square). So, it definitely isn't
going in 2.5, but I expect I will have time to finish it up in about a month.
Until then, you can use the shared APIs to future-proof your code, but they can only
be used on the client.
The work-in-progress (definitely not ready to use right now) is at http://gwt-code-reviews.appspot.com/1775803/
Reported by jat@jaet.org
on 2012-09-15 01:12:56
Accepted
Thanks for the info. Looking forward to the final patch.
Reported by jeraymond
on 2012-09-15 01:41:28
Issue 7809 has been merged into this issue.
Reported by jat@jaet.org
on 2012-11-27 15:00:42
I am going through issues trying to decide what should go into gwt 2.5.1 any updates
on this one yet?
Reported by kurka.daniel
on 2012-12-15 18:24:40
This is too big a change for a point release anyway, but it will probably be after Christmas
before it is ready.
Reported by jat@jaet.org
on 2012-12-15 19:04:15
Started
Out for review at https://gwt-review.googlesource.com/1550
Reported by jat@jaet.org
on 2013-01-02 06:50:14
ReviewPending
Reported by jat@jaet.org
on 2013-01-09 22:51:50
Issue 8091 has been merged into this issue.
Reported by t.broyer
on 2013-07-22 11:46:54
Reported by t.broyer
on 2013-07-22 11:52:36
Work has stalled and this isn't going to make 2.6.
Reported by skybrian@google.com
on 2013-11-12 21:12:50
Started
My coworker has just lost 4 hours to find out that this is not working on the server.
A comment in JavaDoc would be helpful in order to avoid using this class on the server
side. (Because it is in "shared" package one can think this will work on server without
problems.)
Reported by marko.krajnc@cursor.si
on 2014-11-04 17:39:55
Can any project member give an update on this problem?
Reported by BreandanDalton
on 2014-11-06 13:24:02
As mentioned above, the solution to this is the full patch supporting i18n in shared
code. It was out for review earlier this year but was deemed too large a change for
2.7, but will hopefully make it into 3.0 once 2.7 is finished.
Reported by jat@jaet.org
on 2014-11-06 15:05:32
What it the status of this issue? Is there a workaround for it?
The problem still is not fixed in 2.10.
Both methods public static DateTimeFormat getFormat(String pattern)
and protected static DateTimeFormat getFormat(String pattern, DateTimeFormatInfo dtfi)
internally call LocaleInfo.getCurrentLocale().getDateTimeFormatInfo()
, which is in the client side's code and does not work on server side.
Workaround:
Use new DateTimeFormat(format, new DefaultDateTimeFormatInfo()) {};
Then there is no caching, but is also works on server side, and caching easily can be done by the caller (p. ex. define it as a constant).
Unfortunately, the in-progress patch at http://gwt-code-reviews.appspot.com/1775803/ (along with all other code and review content) is lost to us - we requested a dump of the old database back when the instance was running but python 2.7 was no longer supported, and the Googlers with access were not able to share it.
At this point, the best way forward will probably be one of the gwt-i18n forks being feature complete (remaining work: getting closure-compiler to correctly optimize out unused locales and cldr data, and generating implementations for Messages), so that all of this can run on GWT2, J2CL, or the JVM. Alternatively, the workaround described appears to behave.
For those who are using this, how are you defining the expected locale on the server, just statically creating the DefaultDateTimeFormatInfo_{locale goes here}
as needed?
EDIT: I didn't read carefully enough, the patch was correctly moved to to googlesource, see https://gwt-review.googlesource.com/c/gwt/+/1550. The tail end of the review says that not everything works properly, and the page itself reports conflicts (which might just be out of date CLDR data... unfortunately, the script that updates that is also lost within Google), but it might be the kind of thing that could be merged up to date and tested. I've pushed the branch to my github fork, see https://github.com/niloc132/gwt/tree/7668-in-progress-patch.
Originally reported on Google Code with ID 7671
Reported by
jeraymond
on 2012-09-15 00:48:43