8000 bug #18019 [Intl] Update ICU to version 55 (jakzal) · symfony/symfony@4f224ef · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f224ef

Browse files
committed
bug #18019 [Intl] Update ICU to version 55 (jakzal)
This PR was merged into the 2.3 branch. Discussion ---------- [Intl] Update ICU to version 55 | Q | A | ------------- | --- | Branch | 2.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14260 | License | MIT | Doc PR | - The update script needed to be fixed to work with latest data files from ICU as well. The only change I needed to do in stubs and tests is related to the way negative numbers are formatted for currencies (a change from `(£100)` to `-£100`). Form tests needed an update as well, as some date formats have changed. Commits ------- fac3de6 [Form] Update form tests after the ICU data update 6822147 [Intl] Update tests and the number formatter to match behaviour of the intl extension 37a9d8c [Intl] Update the ICU data to version 55 894ce3c [Intl] Fix the update-data.php script in preparation for ICU 5.5
2 parents 5303361 + fac3de6 commit 4f224ef

File tree

643 files changed

+2061
-4080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

643 files changed

+2061
-4080
lines changed

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ public static function assertEquals($expected, $actual, $message = '', $delta =
5151
public function dataProvider()
5252
{
5353
return array(
54-
array(\IntlDateFormatter::SHORT, null, null, '03.02.10 04:05', '2010-02-03 04:05:00 UTC'),
55-
array(\IntlDateFormatter::MEDIUM, null, null, '03.02.2010 04:05', '2010-02-03 04:05:00 UTC'),
56-
array(\IntlDateFormatter::LONG, null, null, '03. Februar 2010 04:05', '2010-02-03 04:05:00 UTC'),
57-
array(\IntlDateFormatter::FULL, null, null, 'Mittwoch, 03. Februar 2010 04:05', '2010-02-03 04:05:00 UTC'),
54+
array(\IntlDateFormatter::SHORT, null, null, '03.02.10, 04:05', '2010-02-03 04:05:00 UTC'),
55+
array(\IntlDateFormatter::MEDIUM, null, null, '03.02.2010, 04:05', '2010-02-03 04:05:00 UTC'),
56+
array(\IntlDateFormatter::LONG, null, null, '3. Februar 2010 um 04:05', '2010-02-03 04:05:00 UTC'),
57+
array(\IntlDateFormatter::FULL, null, null, 'Mittwoch, 3. Februar 2010 um 04:05', '2010-02-03 04:05:00 UTC'),
5858
array(\IntlDateFormatter::SHORT, \IntlDateFormatter::NONE, null, '03.02.10', '2010-02-03 00:00:00 UTC'),
5959
array(\IntlDateFormatter::MEDIUM, \IntlDateFormatter::NONE, null, '03.02.2010', '2010-02-03 00:00:00 UTC'),
60-
array(\IntlDateFormatter::LONG, \IntlDateFormatter::NONE, null, '03. Februar 2010', '2010-02-03 00:00:00 UTC'),
61-
array(\IntlDateFormatter::FULL, \IntlDateFormatter::NONE, null, 'Mittwoch, 03. Februar 2010', '2010-02-03 00:00:00 UTC'),
62-
array(null, \IntlDateFormatter::SHORT, null, '03.02.2010 04:05', '2010-02-03 04:05:00 UTC'),
63-
array(null, \IntlDateFormatter::MEDIUM, null, '03.02.2010 04:05:06', '2010-02-03 04:05:06 UTC'),
64-
array(null, \IntlDateFormatter::LONG, null, '03.02.2010 04:05:06 GMT', '2010-02-03 04:05:06 UTC'),
60+
array(\IntlDateFormatter::LONG, \IntlDateFormatter::NONE, null, '3. Februar 2010', '2010-02-03 00:00:00 UTC'),
61+
array(\IntlDateFormatter::FULL, \IntlDateFormatter::NONE, null, 'Mittwoch, 3. Februar 2010', '2010-02-03 00:00:00 UTC'),
62+
array(null, \IntlDateFormatter::SHORT, null, '03.02.2010, 04:05', '2010-02-03 04:05:00 UTC'),
63+
array(null, \IntlDateFormatter::MEDIUM, null, '03.02.2010, 04:05:06', '2010-02-03 04:05:06 UTC'),
64+
array(null, \IntlDateFormatter::LONG, null, '03.02.2010, 04:05:06 GMT', '2010-02-03 04:05:06 UTC'),
6565
// see below for extra test case for time format FULL
6666
array(\IntlDateFormatter::NONE, \IntlDateFormatter::SHORT, null, '04:05', '1970-01-01 04:05:00 UTC'),
6767
array(\IntlDateFormatter::NONE, \IntlDateFormatter::MEDIUM, null, '04:05:06', '1970-01-01 04:05:06 UTC'),
@@ -103,7 +103,7 @@ public function testTransformFullTime()
103103
{
104104
$transformer = new DateTimeToLocalizedStringTransformer('UTC', 'UTC', null, \IntlDateFormatter::FULL);
105105

106-
$this->assertEquals('03.02.2010 04:05:06 GMT', $transformer->transform($this->dateTime));
106+
$this->assertEquals('03.02.2010, 04:05:06 GMT', $transformer->transform($this->dateTime));
107107
}
108108

109109
public function testTransformToDifferentLocale()
@@ -131,7 +131,7 @@ public function testTransformWithDifferentTimezones()
131131
$dateTime = clone $input;
132132
$dateTime->setTimezone(new \DateTimeZone('Asia/Hong_Kong'));
133133

134-
$this->assertEquals($dateTime->format('d.m.Y H:i'), $transformer->transform($input));
134+
$this->assertEquals($dateTime->format('d.m.Y, H:i'), $transformer->transform($input));
135135
}
136136

137137
public function testTransformWithDifferentPatterns()
@@ -153,7 +153,7 @@ public function testTransformDateTimeImmutableTimezones()
153153
$dateTime = clone $input;
154154
$dateTime = $dateTime->setTimezone(new \DateTimeZone('Asia/Hong_Kong'));
155155

156-
$this->assertEquals($dateTime->format('d.m.Y H:i'), $transformer->transform($input));
156+
$this->assertEquals($dateTime->format('d.m.Y, H:i'), $transformer->transform($input));
157157
}
158158

159159
/**
@@ -201,7 +201,7 @@ public function testReverseTransformFullTime()
201201
{
202202
$transformer = new DateTimeToLocalizedStringTransformer('UTC', 'UTC', null, \IntlDateFormatter::FULL);
203203

204-
$this->assertDateTimeEquals($this->dateTime, $transformer->reverseTransform('03.02.2010 04:05:06 GMT+00:00'));
204+
$this->assertDateTimeEquals($this->dateTime, $transformer->reverseTransform('03.02.2010, 04:05:06 GMT+00:00'));
205205
}
206206

207207
public function testReverseTransformFromDifferentLocale()
@@ -220,7 +220,7 @@ public function testReverseTransformWithDifferentTimezones()
220220
$dateTime = new \DateTime('2010-02-03 04:05:00 Asia/Hong_Kong');
221221
$dateTime->setTimezone(new \DateTimeZone('America/New_York'));
222222

223-
$this->assertDateTimeEquals($dateTime, $transformer->reverseTransform('03.02.2010 04:05'));
223+
$this->assertDateTimeEquals($dateTime, $transformer->reverseTransform('03.02.2010, 04:05'));
224224
}
225225

226226
public function testReverseTransformWithDifferentPatterns()

src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ public function testMonthsOptionShortFormat()
476476
$view = $form->createView();
477477

478478
$this->assertEquals(array(
479-
new ChoiceView(1, '1', 'Jän'),
479+
new ChoiceView(1, '1', 'Jän.'),
480480
new ChoiceView(4, '4', 'Apr.'),
481481
), $view['month']->vars['choices']);
482482
}

src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class LanguageDataGenerator extends AbstractDataGenerator
4949
'fr' => 'fra',
5050
'gn' => 'grn',
5151
'hy' => 'hye',
52+
'hr' => 'hrv',
5253
'ik' => 'ipk',
5354
'is' => 'isl',
5455
'iu' => 'iku',
@@ -76,6 +77,7 @@ class LanguageDataGenerator extends AbstractDataGenerator
7677
'sc' => 'srd',
7778
'sk' => 'slk',
7879
'sq' => 'sqi',
80+
'sr' => 'srp',
7981
'sw' => 'swa',
8082
'uz' => 'uzb',
8183
'yi' => 'yid',
@@ -164,10 +166,13 @@ protected function generateDataForMeta(BundleReaderInterface $reader, $tempDir)
164166

165167
private function generateAlpha2ToAlpha3Mapping(ArrayAccessibleResourceBundle $metadataBundle)
166168
{
167-
$aliases = $metadataBundle['languageAlias'];
169+
// Data structure has changed in ICU 5.5 from "languageAlias" to "alias->language"
170+
$aliases = $metadataBundle['languageAlias'] ?: $metadataBundle['alias']['language'];
168171
$alpha2ToAlpha3 = array();
169172

170173
foreach ($aliases as $alias => $language) {
174+
// $language is a string before ICU 5.5
175+
$language = is_string($language) ? $language : $language['replacement'];
171176
if (2 === strlen($language) && 3 === strlen($alias)) {
172177
if (isset(self::$preferredAlpha2ToAlpha3Mapping[$language])) {
173178
// Validate to prevent typos
@@ -181,12 +186,13 @@ private function generateAlpha2ToAlpha3Mapping(ArrayAccessibleResourceBundle $me
181186
}
182187

183188
$alpha3 = self::$preferredAlpha2ToAlpha3Mapping[$language];
189+
$alpha2 = is_string($aliases[$alpha3]) ? $aliases[$alpha3] : $aliases[$alpha3]['replacement'];
184190

185-
if ($language !== $aliases[$alpha3]) {
191+
if ($language !== $alpha2) {
186192
throw new RuntimeException(
187193
'The statically set three-letter mapping '.$alpha3.' '.
188194
'for the language code '.$language.' seems to be '.
189-
'an alias for '.$aliases[$alpha3].'. Wrong mapping?'
195+
'an alias for '.$alpha2.'. Wrong mapping?'
190196
);
191197
}
192198

src/Symfony/Component/Intl/Intl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public static function getIcuDataVersion()
234234
*/
235235
public static function getIcuStubVersion()
236236
{
237-
return '51.2';
237+
return '55.1';
238238
}
239239

240240
/**

src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class NumberFormatter
239239

240240
private static $enTextAttributes = array(
241241
self::DECIMAL => array('', '', '-', '', '*', '', ''),
242-
self::CURRENCY => array('¤', '', '(¤', ')', '*', ''),
242+
self::CURRENCY => array('¤', '', '-¤', '', '*', ''),
243243
);
244244

245245
/**
@@ -337,7 +337,7 @@ public function formatCurrency($value, $currency)
337337

338338
$ret = $symbol.$value;
339339

340-
return $negative ? '('.$ret.')' : $ret;
340+
return $negative ? '-'.$ret : $ret;
341341
}
342342

343343
/**

src/Symfony/Component/Intl/Resources/bin/icu.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
51 = http://source.icu-project.org/repos/icu/icu/tags/release-51-2/source
1111
52 = http://source.icu-project.org/repos/icu/icu/tags/release-52-1/source
1212
53 = http://source.icu-project.org/repos/icu/icu/tags/release-53-1/source
13-
54 = http://source.icu-project.org/repos/icu/icu/tags/release-54-rc/source
13+
54 = http://source.icu-project.org/repos/icu/icu/tags/release-54-1/source
14+
55 = http://source.icu-project.org/repos/icu/icu/tags/release-55-1/source

src/Symfony/Component/Intl/Resources/data/currencies/af.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"AED": [
55
"AED",

src/Symfony/Component/Intl/Resources/data/currencies/af_NA.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.19",
2+
"Version": "2.1.11.68",
33
"Names": {
44
"NAD": [
55
"$",

src/Symfony/Component/Intl/Resources/data/currencies/am.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"AED": [
55
"AED",

src/Symfony/Component/Intl/Resources/data/currencies/ar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"ADP": [
55
"ADP",

src/Symfony/Component/Intl/Resources/data/currencies/ar_LB.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.19",
2+
"Version": "2.1.12.18",
33
"Names": {
44
"SDG": [
55
"SDG",

src/Symfony/Component/Intl/Resources/data/currencies/az.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"ADP": [
55
"ADP",
@@ -339,7 +339,7 @@
339339
],
340340
"GBP": [
341341
"£",
342-
"Britaniya Funt Sterlinqi"
342+
"Britaniya Funt"
343343
],
344344
"GEK": [
345345
"GEK",

src/Symfony/Component/Intl/Resources/data/currencies/az_Cyrl.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.6.69",
2+
"Version": "2.1.10.34",
33
"Names": {
44
"AZN": [
55
"ман.",

src/Symfony/Component/Intl/Resources/data/currencies/be.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.7.39",
2+
"Version": "2.1.10.93",
33
"Names": {
44
"AUD": [
55
"A$",

src/Symfony/Component/Intl/Resources/data/currencies/bg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"ADP": [
55
"ADP",

src/Symfony/Component/Intl/Resources/data/currencies/bm.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.6.69",
2+
"Version": "2.1.10.42",
33
"Names": {
44
"AED": [
55
"AED",
@@ -71,7 +71,7 @@
7171
],
7272
"GBP": [
7373
"£",
74-
"angilɛ Livri Siterlingi"
74+
"angilɛ Livri"
7575
],
7676
"GHC": [
7777
"GHC",

src/Symfony/Component/Intl/Resources/data/currencies/bn.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"ADP": [
55
"ADP",

src/Symfony/Component/Intl/Resources/data/currencies/br.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.7.39",
2+
"Version": "2.1.10.93",
33
"Names": {
44
"ADP": [
55
"ADP",
@@ -315,7 +315,7 @@
315315
],
316316
"GBP": [
317317
"£ RU",
318-
"lur sterling Breizh-Veur"
318+
"lur Breizh-Veur"
319319
],
320320
"GEL": [
321321
"GEL",

src/Symfony/Component/Intl/Resources/data/currencies/bs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.13.46",
33
"Names": {
44
"ADP": [
55
"ADP",
@@ -359,7 +359,7 @@
359359
],
360360
"GBP": [
361361
"GBP",
362-
"Britanska funta sterlinga"
362+
"Britanska funta"
363363
],
364364
"GEK": [
365365
"GEK",

src/Symfony/Component/Intl/Resources/data/currencies/bs_Cyrl.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"ADP": [
55
"ADP",
@@ -347,7 +347,7 @@
347347
],
348348
"GBP": [
349349
"£",
350-
"Британска фунта стерлинга"
350+
"Британска фунта"
351351
],
352352
"GEK": [
353353
"GEK",

src/Symfony/Component/Intl/Resources/data/currencies/ca.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"ADP": [
55
"ADP",
@@ -384,7 +384,7 @@
384384
],
385385
"GBP": [
386386
"£",
387-
"lliura esterlina britànica"
387+
"lliura britànica"
388388
],
389389
"GEK": [
390390
"GEK",

src/Symfony/Component/Intl/Resources/data/currencies/cs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"ADP": [
55
"ADP",

src/Symfony/Component/Intl/Resources/data/currencies/cy.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.7.80",
2+
"Version": "2.1.10.93",
33
"Names": {
44
"AED": [
55
"AED",
@@ -187,7 +187,7 @@
187187
],
188188
"GBP": [
189189
"£",
190-
"Punt Sterling Prydain"
190+
"Punt Prydain"
191191
],
192192
"GEL": [
193193
"GEL",

src/Symfony/Component/Intl/Resources/data/currencies/da.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.9.62",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"ADP": [
55
"ADP",

src/Symfony/Component/Intl/Resources/data/currencies/de.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.13.4",
33
"Names": {
44
"ADP": [
55
"ADP",
@@ -387,7 +387,7 @@
387387
],
388388
"GBP": [
389389
"£",
390-
"Britisches Pfund Sterling"
390+
"Britisches Pfund"
391391
],
392392
"GEK": [
393393
"GEK",

src/Symfony/Component/Intl/Resources/data/currencies/de_CH.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.21",
2+
"Version": "2.1.11.70",
33
"Names": {
44
"BYR": [
55
"BYR",

src/Symfony/Component/Intl/Resources/data/currencies/ee.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "2.1.8.9",
2+
"Version": "2.1.12.94",
33
"Names": {
44
"ADP": [
55
"ADP",
@@ -387,7 +387,7 @@
387387
],
388388
"GBP": [
389389
"£",
390-
"britainga pound sterling"
390+
"britainga pound"
391391
],
392392
"GEK": [
393393
"GEK",

0 commit comments

Comments
 (0)
0