Browse Source

Merge pull request #29195 from nextcloud/fix/calendar-invitations-default-language

Fix default language detection for calendar emails
Daniel 2 years ago
parent
commit
abc2472c5d

+ 1 - 1
apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php

@@ -104,7 +104,7 @@ abstract class AbstractProvider implements INotificationProvider {
 			return $this->fallbackLanguage;
 		}
 
-		$fallbackLanguage = $this->l10nFactory->findLanguage();
+		$fallbackLanguage = $this->l10nFactory->findGenericLanguage();
 		$this->fallbackLanguage = $fallbackLanguage;
 
 		return $fallbackLanguage;

+ 1 - 1
apps/dav/lib/CalDAV/Schedule/IMipPlugin.php

@@ -202,7 +202,7 @@ class IMipPlugin extends SabreIMipPlugin {
 		$vevent = $iTipMessage->message->VEVENT;
 
 		$attendee = $this->getCurrentAttendee($iTipMessage);
-		$defaultLang = $this->l10nFactory->findLanguage();
+		$defaultLang = $this->l10nFactory->findGenericLanguage();
 		$lang = $this->getAttendeeLangOrDefault($defaultLang, $attendee);
 		$l10n = $this->l10nFactory->get('dav', $lang);
 

+ 2 - 2
apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php

@@ -104,7 +104,7 @@ class EmailProviderTest extends AbstractNotificationProviderTest {
 			]);
 
 		$this->l10nFactory
-			->method('findLanguage')
+			->method('findGenericLanguage')
 			->willReturn('en');
 
 		$this->l10nFactory
@@ -214,7 +214,7 @@ class EmailProviderTest extends AbstractNotificationProviderTest {
 			]);
 
 		$this->l10nFactory
-			->method('findLanguage')
+			->method('findGenericLanguage')
 			->willReturn('en');
 
 		$this->l10nFactory