aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Template
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-01-29 08:56:32 +0100
committerJulius Härtl <jus@bitgrid.net>2021-01-29 08:56:32 +0100
commit0d384dedaa42093c7181e39d580a8fcf25ebb143 (patch)
treeae0e4b3dbbf82bbf21d7e8e7cbdf77e6ed700921 /lib/private/Files/Template
parent39a4b1c4011ba9b9f5c88679baadd79c8d1cf343 (diff)
downloadnextcloud-server-0d384dedaa42093c7181e39d580a8fcf25ebb143.tar.gz
nextcloud-server-0d384dedaa42093c7181e39d580a8fcf25ebb143.zip
Obtain the user language from the passed in user id
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/Files/Template')
-rw-r--r--lib/private/Files/Template/TemplateManager.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php
index 277411279f6..d06fb68b4d9 100644
--- a/lib/private/Files/Template/TemplateManager.php
+++ b/lib/private/Files/Template/TemplateManager.php
@@ -45,6 +45,7 @@ use OCP\Files\Template\TemplateFileCreator;
use OCP\IConfig;
use OCP\IPreview;
use OCP\IServerContainer;
+use OCP\IUserManager;
use OCP\IUserSession;
use OCP\L10N\IFactory;
use Psr\Log\LoggerInterface;
@@ -59,6 +60,7 @@ class TemplateManager implements ITemplateManager {
private $serverContainer;
private $eventDispatcher;
private $rootFolder;
+ private $userManager;
private $previewManager;
private $config;
private $l10n;
@@ -74,6 +76,7 @@ class TemplateManager implements ITemplateManager {
Coordinator $coordinator,
IRootFolder $rootFolder,
IUserSession $userSession,
+ IUserManager $userManager,
IPreview $previewManager,
IConfig $config,
IFactory $l10nFactory,
@@ -83,6 +86,7 @@ class TemplateManager implements ITemplateManager {
$this->eventDispatcher = $eventDispatcher;
$this->bootstrapCoordinator = $coordinator;
$this->rootFolder = $rootFolder;
+ $this->userManager = $userManager;
$this->previewManager = $previewManager;
$this->config = $config;
$this->l10nFactory = $l10nFactory;
@@ -259,7 +263,7 @@ class TemplateManager implements ITemplateManager {
$skeletonTemplatePath = $this->config->getSystemValue('templatedirectory', $defaultTemplateDirectory);
$isDefaultSkeleton = $skeletonPath === $defaultSkeletonDirectory;
$isDefaultTemplates = $skeletonTemplatePath === $defaultTemplateDirectory;
- $userLang = $this->l10nFactory->getUserLanguage();
+ $userLang = $this->l10nFactory->getUserLanguage($this->userManager->get($this->userId));
try {
$l10n = $this->l10nFactory->get('lib', $userLang);