-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[intl] Add support for adding and removing likely subtags for a locale, as defined in UTS#35 #18344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Thank you very much for feature request. Seems need this. Just a moment please. |
@youkidearitai I can have a look unless you really want to do it yourself, since it is related to this feature. |
devnexen
added a commit
to devnexen/php-src
that referenced
this issue
May 3, 2025
…ort. from a minimized locale, addLikelySubtags augments it with likely subtags so no changes is the locale is already maximized e.g. `en_Latn_US`, minimizeSubtags in the other hand does the opposite operation.
devnexen
added a commit
to devnexen/php-src
that referenced
this issue
May 3, 2025
…ort. from a minimized locale, addLikelySubtags augments it with likely subtags so no changes is the locale is already maximized e.g. `en_Latn_US`, minimizeSubtags on the other hand does the opposite operation.
devnexen
added a commit
to devnexen/php-src
that referenced
this issue
May 3, 2025
…ort. from a minimized locale, addLikelySubtags augments it with likely subtags so no changes is the locale is already maximized e.g. `en_Latn_US`, minimizeSubtags on the other hand does the opposite operation.
devnexen
added a commit
to devnexen/php-src
that referenced
this issue
May 3, 2025
…ort. from a minimized locale, addLikelySubtags augments it with likely subtags so no changes is the locale is already maximized e.g. `en_Latn_US`, minimizeSubtags on the other hand does the opposite operation.
devnexen
added a commit
to devnexen/php-src
that referenced
this issue
May 3, 2025
…ort. from a minimized locale, addLikelySubtags augments it with likely subtags so no changes is the locale is already maximized e.g. `en_Latn_US`, minimizeSubtags on the other hand does the opposite operation.
devnexen
added a commit
that referenced
this issue
May 3, 2025
#18487) from a minimized locale, addLikelySubtags augments it with likely subtags so no changes is the locale is already maximized e.g. `en_Latn_US`, minimizeSubtags on the other hand does the opposite operation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
UTS#35 has algorithms to add or remove likely subtags for a locale. This is useful for instance when wanting to use
\Locale::getScript
to get the script associated with a locale, to get the likely script instead of gettingnull
when the locale string does not specify a script explicitly.ICU4X (the Rust implementation of ICU) has a
LocaleExpander
class withmaximize
andminimize
methods: https://unicode-org.github.io/icu4x/rustdoc/icu/locale/struct.LocaleExpander.html (their implementation mutates the identifier object in place and returns an info about whether it was modified or no, but the PHP implementation should likely return the new string instead as PHP does not use objects for language identifiers anyway).ICU4C has functions uloc_addLikelySubtags and uloc_minimizeSubtags
It would be great to expose this ICU capability to PHP code.
The text was updated successfully, but these errors were encountered: