JDK-4225362 : localized DateFormatSymbols for fr_FR is wrong
  • Type: Bug
  • Component: globalization
  • Sub-Component: translation
  • Affected Version: 1.1.7,1.3.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic,x86
  • Submitted: 1999-03-30
  • Updated: 2008-06-20
  • Resolved: 2008-02-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other JDK 6 JDK 7 Other
1.4.2_17-rev,OpenJDK6Fixed 1.4.2_18Fixed 6u10 b12Fixed 7Fixed OpenJDK6Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Name: chT40241			Date: 03/30/99


Run the below program. The output

GyMdkHmsSEDFwWahKz, dd MMMM yyyy
GanjkHmsSEDFwWxhKz, jj nnnn aaaa

shows that the DateFormatSymbol for month in the French
language locale is 'n'; this should be 'M' (for mois).
'n' is not at all mnemonic for mois.
'M' is not used in the localized pattern characters.

import java.text.*;
import java.util.Locale;
public class DateSymbols
{
  public static void main(String argv[])
    {
      info(Locale.US);
      info(Locale.FRENCH);
    }
  static void info(Locale locale)
    {
      DateFormatSymbols syms = new DateFormatSymbols(locale);
      String mnemonics = syms.getLocalPatternChars();
      String s = new SimpleDateFormat("dd MMMM yyyy", locale).toLocalizedPattern();
      System.out.println(mnemonics + ", " + s);
    }
}

(Review ID: 56312)

======================================================================
pat.cashman@Ireland 2000-12-20

Comments
EVALUATION j2se:src/share/classes/sun/text/resources/ ------- FormatData_fr.java ------- 132c132 < { "DateTimePatternChars", "GyMdkHmsSEDFwWahKzZ" }, --- > { "DateTimePatternChars", "GaMjkHmsSEDFwWahKzZ" }, ------- FormatData_fr_BE.java ------- 63c63 < { "DateTimePatternChars", "GanjkHmsSEDFwWxhKzZ" }, --- > { "DateTimePatternChars", "GaMjkHmsSEDFwWahKzZ" }, ------- FormatData_fr_CA.java ------- 55c55 < { "DateTimePatternChars", "GanjkHmsSEDFwWxhKzZ" }, --- > { "DateTimePatternChars", "GaMjkHmsSEDFwWahKzZ" }, ------- FormatData_fr_CH.java ------- 70c70 < { "DateTimePatternChars", "GanjkHmsSEDFwWxhKzZ" }, --- > { "DateTimePatternChars", "GaMjkHmsSEDFwWahKzZ" }, j2se:test/sun/text/resources ------- LocaleData ------- 5473a5474,5482 > > # bug 4225362 > FormatData/fr/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ > FormatData/fr_BE/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ > FormatData/fr_CA/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ > FormatData/fr_CH/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ > FormatData/fr_FR/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ > FormatData/fr_LU/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ > ------- LocaleDataTest.java ------- 10c10 < * 6414459 6455680 6498742 6533691 6547501 6531591 6531593 --- > * 6414459 6455680 6498742 6533691 6547501 6531591 6531593 4225362
14-06-2007

EVALUATION Submitters request as well as the CLDR wants YEAR_FIELD="a" MONTH_FIELD="M" DATE_FIELD="j" Fix the j2se:src/share/classes/sun/text/resources/FormatData_fr Affected are FormatData_fr.java FormatData_fr_BE.java FormatData_fr_CA.java FormatData_fr_CH.java Correct "DateTimePatternChars"="GaMjkHmsSEDFwWahKzZ"
17-10-2006

WORK AROUND Name: chT40241 Date: 03/30/99 none. ====================================================================== pat.cashman@Ireland 2000-12-21 Change the code to explicitly set the LocalPatternChars which are used in translating the date, as follows import java.util.Date; import java.text.*; import java.util.Locale; public class DateSymbols { public static void main(String argv[]) { info(Locale.US); info(Locale.FRENCH); } static void info(Locale locale) { System.out.println("\nLocale = " + locale); // Original customer code DateFormatSymbols syms = new DateFormatSymbols(locale); String s = new SimpleDateFormat("dd MMMM yyyy", locale).toLocalizedPattern (); String mnemonics = syms.getLocalPatternChars(); System.out.println("Orig -->" + mnemonics + ", " + s); // Workaround code from Sun SimpleDateFormat my_date = new SimpleDateFormat("dd MMMM yyyy",locale); DateFormatSymbols my_syms = my_date.getDateFormatSymbols(); // Change the Character Pattern String as necesssary if (locale.toString().equals("fr")) my_syms.setLocalPatternChars("GamjkHmsSEDFwWxhKz"); my_date.setDateFormatSymbols(my_syms); String my_mnemonics = my_syms.getLocalPatternChars(); String my_s = my_date.toLocalizedPattern (); System.out.println("New --->" + my_mnemonics + ", " + my_s); } }
11-09-2004

EVALUATION There's absolutely no way to tell from the javadoc what the meaning of localized pattern characters is, what constitutes a valid local pattern chars string, how these characters interact with SimpleDateFormat, and what setLocalPatternChars is supposed to do. Before any other action is taken on this bug, we need a complete specification of this, in the javadoc. norbert.lindenberg@Eng 1999-03-30 See "Serialized Form" of DateFormatSymbols for `localPatternChars' documentation. For the documentation problem, see 4312282. masayoshi.okutsu@Eng 2000-02-14
30-03-1999