Skip to content

ext/Intl: add support for determining layout character/line orientation of a locale #22097

@LamentXU123

Description

@LamentXU123

Description

Similar to #18345. The ICU4C has uloc_getCharacterOrientation and uloc_getLineOrientation to determine this.

Currently we have isrighttoleft which only returns true or false depends on whether it's RTL or LTR in a locale.

The uloc_getCharacterOrientation method comparing to isrighttoleft returns RTL LTR or UNKNOWN constants instead of true and false. And the uloc_getLineOrientation method returns TTB(Top to Bottom) or BTT(Bottom to top) constants.

Now I think the uloc_getLineOrientation method provides something unique to the intl code base and is quite useful for people to determine the line orientation of a locale. Also I'd prefer uloc_getCharacterOrientation in more complicated senecios since it:

  • returns UNKNOWN instead of false when the given locale has a undefined orientation
  • returns INTL constants instead of true/false

It would be great to expose this ICU capability to PHP code. I am happy to work on this later if we agreed on this feature.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions