diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-10-18 03:43:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-18 03:43:26 +0200 |
commit | 1f8c21a581227d330248f7fd01240287052875a1 (patch) | |
tree | bf0343daaa02fd737ad16245fe58ce65fca7a072 /lib | |
parent | 1d9d3b691247c6c6541db5c4e0a902472d846402 (diff) | |
parent | 1bf15da86343b8213a8554fcf3cda78a9000b455 (diff) | |
download | nextcloud-server-1f8c21a581227d330248f7fd01240287052875a1.tar.gz nextcloud-server-1f8c21a581227d330248f7fd01240287052875a1.zip |
Merge pull request #40808 from c39cfbb3/patch-3
fix(L10N): Support "Accept-Language: zh-Hans-CN" and alike
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/L10N/Factory.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index f7d3fec4ff6..6de620e7ec7 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -490,10 +490,14 @@ class Factory implements IFactory { [$preferred_language] = explode(';', $preference); $preferred_language = str_replace('-', '_', $preferred_language); + $preferred_language_parts = explode('_', $preferred_language); foreach ($available as $available_language) { if ($preferred_language === strtolower($available_language)) { return $this->respectDefaultLanguage($app, $available_language); } + if ($preferred_language_parts[0].'_'.end($preferred_language_parts) === strtolower($available_language)) { + return $available_language; + } } // Fallback from de_De to de |