Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8179071

Month value is inconsistent between CLDR and Java in some special locales

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b12
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      Steps:
      Tests Month value by type consistency between CLDR and Java, using "JANUARY" and "SHORT" as input.
      For example: on language tag pa-PK. As CLDR's definition, locale pa_PK will be replaced to pa_Arab_PK in supplementalMetadata.xml file. There is no element of monthContext [@type=format]/monthWidth[@type=abbreviated]/month[@type=1] in pa_Arab_PK.xml file, but as CLDR fallback mechanism, should fall back to pa_Arab.xml file, but still there isn't abbreviated month in pa_Arab.xml, and then fallback to root.xml as CLDR defined, then should return "wide" type instead "abbreviated", so the result should be جنوری

      The issue happens on locale pa-PK, sr-ME, uz-AF. The reason looks like Java doesn't handle languageAlias.

      To compare the output format in Java, by running below code.
      public void getMonthElement() {
              String tag= "pa-PK";

              Locale target = Locale.forLanguageTag(tag);

              Month day = Month.valueOf("JANUARY");
              TextStyle style = TextStyle.valueOf("SHORT");
              String actualResult = day.getDisplayName(style, target);
              System.out.println(actualResult);
          }

      Result:
      The output of Java is "ਜਨ", instead of جنوری.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rgoel Rachna Goel (Inactive)
                Reporter:
                yzhou Daisy Zhou
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: