Skip to content

Commit 671f4a6

Browse files
authored
Merge pull request #21030 from nextcloud/backport/21003/stable18
[stable18] Remove entries from locales.json incompatible with punic
2 parents 6090c75 + 1eead35 commit 671f4a6

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

resources/locales.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -911,10 +911,6 @@
911911
"code": "en_US",
912912
"name": "English (United States)"
913913
},
914-
{
915-
"code": "en_US_POSIX",
916-
"name": "English (United States, Computer)"
917-
},
918914
{
919915
"code": "en_VC",
920916
"name": "English (St. Vincent & Grenadines)"
@@ -1399,6 +1395,10 @@
13991395
"code": "ga",
14001396
"name": "Irish"
14011397
},
1398+
{
1399+
"code": "ga_GB",
1400+
"name": "Irish (United Kingdom)"
1401+
},
14021402
{
14031403
"code": "ga_IE",
14041404
"name": "Irish (Ireland)"

resources/update-locales.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,21 @@
2929
exit(1);
3030
}
3131

32-
$locales = array_map(function (string $localeCode) {
32+
require '../3rdparty/autoload.php';
33+
34+
$locales = array_map(static function (string $localeCode) {
3335
return [
3436
'code' => $localeCode,
3537
'name' => Locale::getDisplayName($localeCode, 'en')
3638
];
3739
}, ResourceBundle::getLocales(''));
3840

41+
$locales = array_filter($locales, static function (array $locale) {
42+
return is_array(Punic\Data::explodeLocale($locale['code']));
43+
});
44+
45+
$locales = array_values($locales);
46+
3947
if (file_put_contents(__DIR__ . '/locales.json', json_encode($locales, JSON_PRETTY_PRINT)) === false) {
4048
echo 'Failed to update locales.json';
4149
exit(1);

0 commit comments

Comments
 (0)