Skip to content

[intl] Expose the ICU ListFormatter #18346

Closed

Description

@stof

Description

ICU4C has a ListFormatter API allowing to format lists based on the convention of each locale.

It would be great to introduce a PHP API based on it.

Other languages have such API exposed as well. For instance, JavaScript has Intl.ListFormat

Activity

  1. stof commented on Apr 17, 2025

    @stof
    ContributorAuthor

    this probably requires a RFC to figure out the proper PHP API for it.

  2. youkidearitai commented on Apr 17, 2025

    @youkidearitai
    Contributor

    Thank you very much for feature request. This is seems need it.
    Thanks again.

  3. TimWolla commented on Apr 17, 2025

    @TimWolla
    Member

    this probably requires a RFC to figure out the proper PHP API for it.

    Generally speaking, it would probably make sense to give ext/intl a more general clean-up pass (especially with regard to namespacing, both for classes and class constants). I believe it internally uses some outdated ICU APIs for the NumberFormatter as well.

    I previously considered writing a proposal for the Spoofchecker, but I would love to have https://wiki.php.net/rfc/tagged_unions for that and thus put it on hold, since there is some movement towards having tagged unions.

  4. Ayesh commented on Apr 25, 2025

    @Ayesh
    Member

    I think we could expose NumberRangeFormatter too.

  5. BogdanUngureanu commented on May 7, 2025

    @BogdanUngureanu
    Contributor

    I've opened a PR for IntlListFormatter here #18519:)

  6. devnexen commented on May 7, 2025

    @devnexen
    Member

    Hi @BogdanUngureanu ! would it be possible for you to make a case for your PR in the internal mailing list ? Cheers.

  7. ndossche commented on May 18, 2025

    @ndossche
    Member

    Implemented now

  8. changed the title [-][int] Expose the ICU ListFormatter[/-] [+][intl] Expose the ICU ListFormatter[/+] on May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions