Join GitHub today
[Intl] New Intl API #9206
The following description is outdated. This PR has turned into an overhaul of the Intl API to basically rebuild ICU4J/ICU4C (the official ICU APIs) under PHP. Once I'm done, I'll update the text below.
This PR contains a new, extensive integration test suite for the Intl component that check whether the methods of the resource bundles work correctly and consistently in practice. When I wrote this test suite, I discovered numerous bugs that have been fixed in this PR.
I had to do two major BC breaks:
I also did two BC breaks in our internal code, which shouldn't affect our users:
The fixed bugs had mainly to do with locale aliases. When locales get renamed in ICU, the old locale remains as an alias for (think: pointer to) the new locale. For example, the locale "mo" is an alias for "ro_MD". That locale falls back to "ro" if entries can't be found. Previously, the fallback from "mo" to "ro" did not work since aliases were ignored.
The PR also contains improvements in efficiency. When accessing the
The new test suite (see the
This was referenced
Oct 16, 2013
@stof Currently on hold due to other, more important, issues. I'd however be interested in feedback about the new API. I designed the API to reflect ICU4Js API (more or less), i.e. classes with static methods, such as:
$currencies = Currency::getCurrencies(); $names = Currency::getNames(); if (Language::exists('de_DE')) // etc.
Now we all know that static methods are boo. However, these methods are used to access "global system information", so I'm not sure whether it makes sense to always pass objects around for accessing this global information.