I am considering using collators in PHP (I am no expert in PHP). Is there a way to know/list all collators available in PHP? I am looking for something similar to Java’s Collator.getAvailableLocales(). Thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think the
Collatoris using the locale information from the CLDR repository.I compiled a list from it’s current trunk (at the time of writing: 2020-02-23):
Or grouped:
You can see the base locale in the filename, e.g.
de.xml, when you go inside the file, you fined an element like this one:which lists additional Sublocales. Script and Territory is available in the file as well.
It takes some time until the CLDR data comes into Intl (C) which then is bind against PHP Intl extension. So cross check with the Intl library version / binding on your system. Just in case it differs a bit from your installation.