diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-01-11 12:59:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-11 12:59:07 +0100 |
commit | b23934a45ec584e398835635584461a02c9b1dde (patch) | |
tree | e5fbea2e919a4221a6f76d354bc67491945ad96b /lib | |
parent | bce7f09336f4934827076dd0854e2ef87cce3269 (diff) | |
parent | a6f0278e67287612357ed99ec423f36893871019 (diff) | |
download | nextcloud-server-b23934a45ec584e398835635584461a02c9b1dde.tar.gz nextcloud-server-b23934a45ec584e398835635584461a02c9b1dde.zip |
Merge pull request #30569 from nextcloud/fix/userlang_firstlogin
Default to language from request in L10N\Factory->getUserLanguage()
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/L10N/Factory.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index a3ff7bf70e2..426ddf6c380 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -431,6 +431,15 @@ class Factory implements IFactory { if ($language !== null) { return $language; } + + // Use language from request + if ($this->userSession->getUser() instanceof IUser && + $user->getUID() === $this->userSession->getUser()->getUID()) { + try { + return $this->getLanguageFromRequest(); + } catch (LanguageNotFoundException $e) { + } + } } return $this->config->getSystemValue('default_language', 'en'); |