Merge pull request #21029 from nextcloud/backport/21003/stable19
[stable19] Remove entries from locales.json incompatible with punic
This commit is contained in:
commit
822d3f0e8b
|
@ -911,10 +911,6 @@
|
||||||
"code": "en_US",
|
"code": "en_US",
|
||||||
"name": "English (United States)"
|
"name": "English (United States)"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"code": "en_US_POSIX",
|
|
||||||
"name": "English (United States, Computer)"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"code": "en_VC",
|
"code": "en_VC",
|
||||||
"name": "English (St. Vincent & Grenadines)"
|
"name": "English (St. Vincent & Grenadines)"
|
||||||
|
@ -1399,6 +1395,10 @@
|
||||||
"code": "ga",
|
"code": "ga",
|
||||||
"name": "Irish"
|
"name": "Irish"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"code": "ga_GB",
|
||||||
|
"name": "Irish (United Kingdom)"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"code": "ga_IE",
|
"code": "ga_IE",
|
||||||
"name": "Irish (Ireland)"
|
"name": "Irish (Ireland)"
|
||||||
|
|
|
@ -29,13 +29,21 @@ if (!extension_loaded('intl')) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$locales = array_map(function (string $localeCode) {
|
require '../3rdparty/autoload.php';
|
||||||
|
|
||||||
|
$locales = array_map(static function (string $localeCode) {
|
||||||
return [
|
return [
|
||||||
'code' => $localeCode,
|
'code' => $localeCode,
|
||||||
'name' => Locale::getDisplayName($localeCode, 'en')
|
'name' => Locale::getDisplayName($localeCode, 'en')
|
||||||
];
|
];
|
||||||
}, ResourceBundle::getLocales(''));
|
}, ResourceBundle::getLocales(''));
|
||||||
|
|
||||||
|
$locales = array_filter($locales, static function (array $locale) {
|
||||||
|
return is_array(Punic\Data::explodeLocale($locale['code']));
|
||||||
|
});
|
||||||
|
|
||||||
|
$locales = array_values($locales);
|
||||||
|
|
||||||
if (file_put_contents(__DIR__ . '/locales.json', json_encode($locales, JSON_PRETTY_PRINT)) === false) {
|
if (file_put_contents(__DIR__ . '/locales.json', json_encode($locales, JSON_PRETTY_PRINT)) === false) {
|
||||||
echo 'Failed to update locales.json';
|
echo 'Failed to update locales.json';
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Reference in New Issue