Skip to content

Commit 700cd11

Browse files
committed
Target CLDR 47.0.0
1 parent 4cb6742 commit 700cd11

16 files changed

Lines changed: 376 additions & 57 deletions

File tree

CHANGELOG.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44

5-
## v5.x to v6.0
5+
## v6.0.0
66

77
### New Requirements
88

@@ -12,10 +12,14 @@
1212

1313
- `LocaleId` is generated from the CLDR. It represents an available locale ID.
1414
- `LocaleNotAvailable` is thrown when a requested locale ID is not available.
15-
- `TerritoryCode` is generated from the CLDR. It represents a territory ID.
16-
- `Currency` is generated from the CLDR. It represents a currency, including fraction information.
15+
- `TerritoryCodeData` is generated from the CLDR. It represents a territory ID.
16+
- `CurrencyData` is generated from the CLDR. It represents a currency, including fraction information.
1717
- Added the `Warmable` interface to features that can warm the CLDR cache.
1818

19+
### Deprecated Features
20+
21+
None
22+
1923
### Backward Incompatible Changes
2024

2125
- `Units::LENGTH_*` constants are replaced by the `UnitLength` enum.
@@ -33,19 +37,15 @@
3337
- Removed `Locale::localize()` and repurposed the `Localizable` interface.
3438
- Removed `__invoke` on formatters, use `$formatter->format(...)` instead.
3539

36-
### Deprecated Features
37-
38-
None
39-
4040
### Other Changes
4141

42-
- Use CLDR 45.0.0.
42+
- Targets CLDR 47.0.0.
4343
- Some code is now generated from CLDR data, such as `Units` getters and methods, or `LocaleId`.
4444
- JSON data is stored as PHP instead of JSON to leverage opcache.
4545

4646

4747

48-
## v4.x to v5.0
48+
## v5.0.0
4949

5050
### New Requirements
5151

@@ -74,6 +74,10 @@ None
7474
echo $euro_fraction->cash_rounding; // 0
7575
```
7676

77+
### Deprecated Features
78+
79+
None
80+
7781
### Backward Incompatible Changes
7882

7983
- `PathMapper` was replaced by `GitHub\UrlResolver`.
@@ -98,10 +102,6 @@ None
98102

99103
- Renamed `Units::format_combination()` as `format_compound()` to [match the language used by Unicode](http://unicode.org/reports/tr35/tr35-general.html#compound-units).
100104

101-
### Deprecated Features
102-
103-
None
104-
105105
### Other Changes
106106

107107
- Targets [CLDR v41](https://www.unicode.org/reports/tr35/tr35-72/tr35.html)
@@ -113,7 +113,7 @@ None
113113

114114

115115

116-
## v3.x to v4.0
116+
## v4.0.0
117117

118118
### New Requirements
119119

@@ -123,6 +123,16 @@ Requires PHP 7.1+
123123

124124
None
125125

126+
### Deprecated Features
127+
128+
- The localized currency formatter no longer supports a `$symbols` parameter. If you need to
129+
customize how a currency is formatted, create your own `Symbols` instance and use it with a
130+
non-localized formatter e.g. `$repository->format_currency()`.
131+
132+
- The localized list formatter no longer accepts a list pattern or a type, only a type. If you
133+
need to customize how a list is formatted, create you own `ListPattern` instance and use it with
134+
a non-localized formatter e.g. `$repository->format_list()`.
135+
126136
### Backward Incompatible Changes
127137

128138
- [Numbers symbols](https://www.unicode.org/reports/tr35/tr35-57/tr35-numbers.html#Number_Symbols) are now
@@ -198,16 +208,6 @@ None
198208
echo $units->volume_liter(12.345)->per($units->duration_hour)->as_short;
199209
```
200210

201-
### Deprecated Features
202-
203-
- The localized currency formatter no longer supports a `$symbols` parameter. If you need to
204-
customize how a currency is formatted, create your own `Symbols` instance and use it with a
205-
non-localized formatter e.g. `$repository->format_currency()`.
206-
207-
- The localized list formatter no longer accepts a list pattern or a type, only a type. If you
208-
need to customize how a list is formatted, create you own `ListPattern` instance and use it with
209-
a non-localized formatter e.g. `$repository->format_list()`.
210-
211211
### Other Changes
212212

213213
- Compatible with PHP 8.1+
@@ -226,11 +226,11 @@ None
226226
227227
None
228228
229-
### Backward Incompatible Changes
229+
### Deprecated Features
230230
231231
None
232232
233-
### Deprecated Features
233+
### Backward Incompatible Changes
234234
235235
None
236236

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ and conventions established by the [Unicode Common Locale Data Repository][cldr]
99
valuable locale information such as names for territories, languages, days… as well as formatters
1010
for numbers, currencies, dates and times, units, sequences, and lists.
1111

12-
> **Note**
12+
> [!NOTE]
1313
>
14-
> The package targets [CLDR version 45](https://github.com/unicode-org/cldr-json/tree/45.0.0); [Revision 72](https://www.unicode.org/reports/tr35/tr35-72/tr35.html).
14+
> The package targets [CLDR version 47](https://github.com/unicode-org/cldr-json/tree/47.0.0); [Revision 75](https://www.unicode.org/reports/tr35/tr35-75/tr35.html).
1515
1616

1717

generator/src/Command/GenerateCurrencyData.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
2727
/**
2828
* @var string[] $codes
2929
*
30-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-numbers-full/main/en-001/currencies.json
30+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-numbers-full/main/en-001/currencies.json
3131
*/
3232
$codes = array_keys($this->repository->locale_for('en-001')['currencies']);
3333

@@ -39,7 +39,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
3939
* _cashDigits?: string
4040
* }> $fractions
4141
*
42-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-core/supplemental/currencyData.json
42+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-core/supplemental/currencyData.json
4343
*/
4444
$fractions = $this->repository->supplemental['currencyData']['fractions'];
4545

@@ -77,13 +77,13 @@ private function render(
7777
final class CurrencyData
7878
{
7979
/**
80-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-numbers-modern/main/en-001/currencies.json
80+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-numbers-modern/main/en-001/currencies.json
8181
*/
8282
public const CODES =
8383
$codes;
8484
8585
/**
86-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-core/supplemental/currencyData.json
86+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-core/supplemental/currencyData.json
8787
*/
8888
public const FRACTIONS =
8989
$fractions;

generator/src/Command/GenerateLocaleData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ public function render(
6161
final class LocaleData
6262
{
6363
/**
64-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-core/availableLocales.json
64+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-core/availableLocales.json
6565
*/
6666
public const AVAILABLE_LOCALES =
6767
$available_locales;
6868
6969
/**
70-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-core/supplemental/parentLocales.json
70+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-core/supplemental/parentLocales.json
7171
*/
7272
public const PARENT_LOCALES =
7373
$parent_locales;

generator/src/Command/GenerateTerritoryData.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
2626
/**
2727
* @var string[] $codes
2828
*
29-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-localenames-full/main/en-001/territories.json
29+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-localenames-full/main/en-001/territories.json
3030
*/
3131
$codes = array_keys($this->repository->locale_for('en-001')['territories']);
3232
$codes = array_values(array_filter($codes, fn($code) => !str_contains($code, '-alt')));
33+
$codes = array_map(fn ($v) => (string) $v, $codes);;
3334

3435
$contents = $this->render(
3536
codes: indent(VarExporter::export($codes), 2),
@@ -63,7 +64,7 @@ private function render(
6364
final class TerritoryData
6465
{
6566
/**
66-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-localenames-full/main/en-001/territories.json
67+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-localenames-full/main/en-001/territories.json
6768
*/
6869
public const CODES =
6970
$codes;

src/Core/Locale.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private function get_calendar(): Calendar
160160
/**
161161
* @TODO-20131101: use preferred data
162162
*
163-
* @see https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-core/supplemental/calendarPreferenceData.json
163+
* @see https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-core/supplemental/calendarPreferenceData.json
164164
*/
165165
return $this->calendar ??= $this->calendar_for(CalendarId::GREGORIAN);
166166
}

src/Core/LocaleData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
final class LocaleData
1616
{
1717
/**
18-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-core/availableLocales.json
18+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-core/availableLocales.json
1919
*/
2020
public const AVAILABLE_LOCALES =
2121
[
@@ -732,7 +732,7 @@ final class LocaleData
732732
];
733733

734734
/**
735-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-core/supplemental/parentLocales.json
735+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-core/supplemental/parentLocales.json
736736
*/
737737
public const PARENT_LOCALES =
738738
[

src/Core/LocaleNotAvailable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* Exception thrown when a requested locale ID is not available.
1111
*
12-
* @link https://github.com/unicode-org/cldr-json/blob/45.0.0/cldr-json/cldr-core/availableLocales.json
12+
* @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-core/availableLocales.json
1313
*/
1414
final class LocaleNotAvailable extends InvalidArgumentException implements Exception
1515
{

0 commit comments

Comments
 (0)