diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-05-19 12:58:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-19 12:58:59 +0300 |
commit | 671f4a6b889dbb377907b154a60b064a85211fd6 (patch) | |
tree | ab24aa252124844f1039cb92cb6b6f354c6454e6 | |
parent | 6090c75d904d0b56595a2419bdc37af09b1208d0 (diff) | |
parent | 1eead35e8d57b985ee262e7818e1031a07e6975e (diff) |
Merge pull request #21030 from nextcloud/backport/21003/stable18
[stable18] Remove entries from locales.json incompatible with punic
-rw-r--r-- | resources/locales.json | 8 | ||||
-rwxr-xr-x | resources/update-locales.php | 10 |
2 files changed, 13 insertions, 5 deletions
diff --git a/resources/locales.json b/resources/locales.json index a65cf530514..7cf9fa9b890 100644 --- a/resources/locales.json +++ b/resources/locales.json @@ -912,10 +912,6 @@ "name": "English (United States)" }, { - "code": "en_US_POSIX", - "name": "English (United States, Computer)" - }, - { "code": "en_VC", "name": "English (St. Vincent & Grenadines)" }, @@ -1400,6 +1396,10 @@ "name": "Irish" }, { + "code": "ga_GB", + "name": "Irish (United Kingdom)" + }, + { "code": "ga_IE", "name": "Irish (Ireland)" }, diff --git a/resources/update-locales.php b/resources/update-locales.php index d5addd0a9ae..50d848c76a6 100755 --- a/resources/update-locales.php +++ b/resources/update-locales.php @@ -29,13 +29,21 @@ if (!extension_loaded('intl')) { exit(1); } -$locales = array_map(function (string $localeCode) { +require '../3rdparty/autoload.php'; + +$locales = array_map(static function (string $localeCode) { return [ 'code' => $localeCode, 'name' => Locale::getDisplayName($localeCode, 'en') ]; }, 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) { echo 'Failed to update locales.json'; exit(1); |