Skip to content

Commit 24545ed

Browse files
authored
Merge pull request #172 from andrewnicols/allLocales
Generate all UTF-8 locales
2 parents b68b255 + eeb33ab commit 24545ed

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

root/tmp/setup/php-extensions.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ apt-get install -y --no-install-recommends apt-transport-https \
3434
$PACKAGES_MEMCACHED \
3535
$PACKAGES_LDAP
3636

37-
# Generate the locales configuration fo rboth Australia, and the US.
37+
# Generate the locales configuration for all possible UTF-8 locales.
3838
echo 'Generating locales..'
39-
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
40-
echo 'en_AU.UTF-8 UTF-8' >> /etc/locale.gen
39+
grep UTF-8 /usr/share/i18n/SUPPORTED > /etc/locale.gen
4140
locale-gen
4241

4342
echo "Installing php extensions"

tests/fixtures/test.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,16 @@
3030
}
3131
}
3232

33-
$locale = 'en_AU.UTF-8';
34-
if (setlocale(LC_TIME, $locale) === false) {
35-
$missing[] = $locale;
33+
$locales = [
34+
'en_AU.UTF-8',
35+
'es_ES.UTF-8',
36+
];
37+
foreach ($locales as $locale) {
38+
if (setlocale(LC_TIME, $locale) === false) {
39+
$missing[] = $locale;
40+
}
3641
}
42+
setlocale(LC_TIME, 'en_AU.UTF-8');
3743

3844
if (php_sapi_name() === 'cli') {
3945
if (empty($missing)) {

0 commit comments

Comments
 (0)