mirror of
https://github.com/mlocati/docker-php-extension-installer
synced 2025-05-09 00:22:40 +00:00
Fix intl on Alpine 3.16 by installing icu-data-full (#605)
This commit is contained in:
parent
0c615b3e33
commit
57009be2b8
2 changed files with 32 additions and 4 deletions
22
scripts/tests/intl
Executable file
22
scripts/tests/intl
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/_bootstrap.php';
|
||||
|
||||
$rc = 0;
|
||||
echo "Checking languages:\n";
|
||||
foreach ([
|
||||
'en' => "\xC2\xA4#,##0.00",
|
||||
'it' => "#,##0.00\xC2\xA0\xC2\xA4",
|
||||
] as $locale => $expectedCurrencyFormat) {
|
||||
echo "- {$locale}: ";
|
||||
$formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY);
|
||||
$actualCurrencyFormat = $formatter->getPattern();
|
||||
if ($actualCurrencyFormat === $expectedCurrencyFormat) {
|
||||
echo "ok\n";
|
||||
} else {
|
||||
echo "failed (expected: '{$expectedCurrencyFormat}', actual: '{$actualCurrencyFormat}')\n";
|
||||
$rc = 1;
|
||||
}
|
||||
}
|
||||
exit($rc);
|
Loading…
Add table
Add a link
Reference in a new issue