You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpif ( ! in_array( 'skr', IntlCalendar::getAvailableLocales(), true ) ) {
echo'locale is not available';
}
Resulted in this output:
locale is not available
I expected the locale to be available, since skr is a valid ISO 639-3 language code for the Saraiki language, spoken by 20+ million people. Should it be added to the list of supported languages?
This issue may not be new, but after recent changes to NumberFormatter in PHP 8.4, it will now return a ValueError if the locale is invalid.
Code like below can consequently generate fatal errors now:
What version of the ICU tables do you have (what is the value of INTL_ICU_DATA_VERSION?). Saraiki was added in ICU version 76. I'm guessing you have 75; icu is one of those libraries where you need to recompile the application that uses it whenever it changes version.
Well, I'm no expert on the Intl extension, but the first of the two environments is concerning since version 77.1 is recent enough (for the other one it could just be the old ICU version).
I thought maybe it was something stupid like not accepting three-letter locales, but Rajasthani ("raj") is recognised. So I'm not sure about this.
Description
The following code:
Resulted in this output:
I expected the locale to be available, since
skr
is a valid ISO 639-3 language code for the Saraiki language, spoken by 20+ million people. Should it be added to the list of supported languages?This issue may not be new, but after recent changes to
NumberFormatter
in PHP 8.4, it will now return aValueError
if the locale is invalid.Code like below can consequently generate fatal errors now:
Resulted in this output in PHP 8.4:
While in PHP 8.3:
PHP Version
Operating System
No response
The text was updated successfully, but these errors were encountered: