-
Bug
-
Resolution: Won't Fix
-
P3
-
5.0, 7
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2194297 | 5.0-pool | Unassigned | P5 | Closed | Won't Fix |
I'm working on a web UI component that accepts calendar data. The
component consists of (among other things) a textfield below which is
supposed to be a localized hint representing the expected format of
the date input, e.g. dd/mm/yyyy.
The component uses a java.text.SimpleDateFormat internally, and I
would like to use the toLocalizedPattern() method (and toLowerCase())
to produce a default hint. By default I do not set the pattern to use,
as SimpleDateFormat pattern will pick one that is appropriate for the
locale.
However, when I use toLocalizedPattern() method, I only appear to get
a truly localized string for German (uuuu.MM.tt) . For other languages
I tried, including Swedish, French and Asian languages) I get the same
result as I would with toPattern(), that is, it is technically
appropriate for the locale, but the representation is made up by
strings that are only intelligible in English.
FWIW, I am Swedish and have also lived in France. In neither of those
countries do I remember having filled in a form where the suggested
date format was represented to me using English letters. Using Google
to search on Swedish pages I get twice as many hits for åååå-mm-dd as for
yyyy-mm-dd (and if the first hits are representative, many of the
yyyy-mm-dd are used in JavaScript code). For French I get more than
four times as many hits for aaaa-mm-jj as for yyyy-mm-dd.
component consists of (among other things) a textfield below which is
supposed to be a localized hint representing the expected format of
the date input, e.g. dd/mm/yyyy.
The component uses a java.text.SimpleDateFormat internally, and I
would like to use the toLocalizedPattern() method (and toLowerCase())
to produce a default hint. By default I do not set the pattern to use,
as SimpleDateFormat pattern will pick one that is appropriate for the
locale.
However, when I use toLocalizedPattern() method, I only appear to get
a truly localized string for German (uuuu.MM.tt) . For other languages
I tried, including Swedish, French and Asian languages) I get the same
result as I would with toPattern(), that is, it is technically
appropriate for the locale, but the representation is made up by
strings that are only intelligible in English.
FWIW, I am Swedish and have also lived in France. In neither of those
countries do I remember having filled in a form where the suggested
date format was represented to me using English letters. Using Google
to search on Swedish pages I get twice as many hits for åååå-mm-dd as for
yyyy-mm-dd (and if the first hits are representative, many of the
yyyy-mm-dd are used in JavaScript code). For French I get more than
four times as many hits for aaaa-mm-jj as for yyyy-mm-dd.
- backported by
-
JDK-2194297 java.text.SimpleDateFormat: toLocalizedPattern() returns inappropriate string for many locales
- Closed
- relates to
-
JDK-4994312 Incompatibility SimpleDateFormat.applyLocalizedPattern between Sun JDK versions
- Resolved
-
JDK-4225362 localized DateFormatSymbols for fr_FR is wrong
- Resolved
-
JDK-4265184 DateFormat: localPatternChars for German locale aren't obvious
- Closed
-
JDK-6336885 RFE: Locale Data Deployment Enhancements
- Closed
-
JDK-7012373 need architectural change to fix localized Date format pattern
- Closed
(1 relates to)