From b6f4276c6cc2e5a53f0a4afb1536960427fa995e Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Mon, 6 Oct 2025 15:09:01 -0400 Subject: Change regional language codes (#8065) * Change regional language codes According to `ISO-639-1` and `ISO-3166-1 alpha-2` recommendations, regional languages must be written with the language code in lowercase and the region in uppercase. For instance, we should have `en-US` instead of `en-us`. Folders have been updated to reflect those recommendations and regional language codes have been updated in the translation files. * Update README files * Fix configuration for typos * Revert language order in documentation * Remove unnecessary code * Change language configuration getter * Fix phpstan error * Fix typo * Add types * escape regex * Move language logic to avoid magic or deprecated methods * Minor fix on regex --- cli/check.translation.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'cli/check.translation.php') diff --git a/cli/check.translation.php b/cli/check.translation.php index 5c0873099..dbb5d0fe4 100755 --- a/cli/check.translation.php +++ b/cli/check.translation.php @@ -124,16 +124,8 @@ if ($cliOptions->generateReadme) { $ghSearchUrl = 'https://github.com/search?q=' . urlencode("repo:FreshRSS/FreshRSS path:app/i18n/$lang /(TODO|DIRTY)$/"); - // BCP 47 / ISO 3166: Uppercase the last (region) subtag if any (e.g. pt-pt -> pt-PT) - $bcp47 = $lang; - if (str_contains($bcp47, '-')) { - $parts = explode('-', $bcp47); - $parts[count($parts) - 1] = strtoupper($parts[count($parts) - 1]); - $bcp47 = implode('-', $parts); - } - $markdownTable .= '| ' . implode(' | ', [ - _t('gen.lang.' . $lang) . " ($bcp47)", + _t('gen.lang.' . $lang) . " ($lang)", $progressBar . ' ' . $percentageInt . '%', "[__contribute__]($ghSearchUrl)", ]) . " |\n"; -- cgit v1.2.3