Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8041488 Locale-Dependent List Patterns
  3. JDK-8313653

Release Note: Locale-Dependent List Patterns

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      A new class, `ListFormat`, which processes the locale-dependent list patterns has been introduced, based on [Unicode Consortium's LDML specification](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, a list of three `String`s: "Foo", "Bar", "Baz" is typically formatted as "Foo, Bar, and Baz" in US English, while in French it is "Foo, Bar et Baz." The following code snippet does such formatting:
      ```
      ListFormat.getInstance().format(List.of("Foo", "Bar", "Baz"))
      ```
      Besides the default concatenation type `STANDARD` (= and), the class provides two additional types, `OR` for "or" concatenation, and `UNIT` for concatenation suitable for units for the locale.

      Attachments

        Activity

          People

            naoto Naoto Sato
            naoto Naoto Sato
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: