diff --git a/changelog/unreleased/37039 b/changelog/unreleased/37039 new file mode 100644 index 000000000000..6d559e7df104 --- /dev/null +++ b/changelog/unreleased/37039 @@ -0,0 +1,3 @@ +Change: Respect default_language when sending email notifications + +https://github.com/owncloud/core/issues/37039 diff --git a/lib/private/Share/MailNotifications.php b/lib/private/Share/MailNotifications.php index eee9f4d48c5f..cec0e6863f5d 100644 --- a/lib/private/Share/MailNotifications.php +++ b/lib/private/Share/MailNotifications.php @@ -165,7 +165,8 @@ public function sendInternalShareMail($sender, $node, $shareType, $recipientList $unescapedFilename = $filename; $link = $filter->getLink(); - $recipientLanguageCode = $this->config->getUserValue($recipient->getUID(), 'core', 'lang', 'en'); + $defaultLang = $this->config->getSystemValue('default_language', 'en'); + $recipientLanguageCode = $this->config->getUserValue($recipient->getUID(), 'core', 'lang', $defaultLang); $recipientL10N = \OC::$server->getL10N('lib'); if ($this->l->getLanguageCode() !== $recipientLanguageCode) { $recipientL10N = \OC::$server->getL10N('lib', $recipientLanguageCode);