-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Saraiki (skr) missing from IntlCalendar::getAvailableLocales() #18515
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
Comments
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. |
Thank you for the quick reply! I tried in 2 different systems, but the fatal happened regardless of the <?php
echo 'Current PHP version: ' . phpversion();
echo "\n";
echo 'ICU tables: ' . INTL_ICU_DATA_VERSION;
echo "\n";
$formatter = new NumberFormatter( 'skr', 14 );
$formatter->setAttribute( 6, 1 );
echo $formatter->format( '123456' ); In the first environment:
In the second:
|
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. |
If you take a look at https://www.unicode.org/cldr/charts/47/supplemental/locale_coverage.html, you can see that "skr" is not included by default in ICU. You need to install the extra data with your package manager or manually (install |
Thank you for the extra context! |
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: