aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-01-11 12:59:07 +0100
committerGitHub <noreply@github.com>2022-01-11 12:59:07 +0100
commitb23934a45ec584e398835635584461a02c9b1dde (patch)
treee5fbea2e919a4221a6f76d354bc67491945ad96b /lib
parentbce7f09336f4934827076dd0854e2ef87cce3269 (diff)
parenta6f0278e67287612357ed99ec423f36893871019 (diff)
downloadnextcloud-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.php9
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');