summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2020-03-24 15:12:21 +0100
committerGitHub <noreply@github.com>2020-03-24 15:12:21 +0100
commit3e338c907533dd77599b576ecfadd44b3d1a9855 (patch)
tree737853675c02dbab58be6aba6c06c578c0c76da4 /apps/dav/lib/CalDAV
parentb31c98a5498fb2ee4db00ea09506cc96c5937a19 (diff)
parent709e7447edf4414dd0762bdb640977fd4dba815b (diff)
downloadnextcloud-server-3e338c907533dd77599b576ecfadd44b3d1a9855.tar.gz
nextcloud-server-3e338c907533dd77599b576ecfadd44b3d1a9855.zip
Merge pull request #18788 from nextcloud/fix/18782/translate-busy-in-caldav
Translate 'Busy' in CalDAV
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r--apps/dav/lib/CalDAV/Calendar.php10
-rw-r--r--apps/dav/lib/CalDAV/CalendarObject.php16
-rw-r--r--apps/dav/lib/CalDAV/PublicCalendar.php6
3 files changed, 23 insertions, 9 deletions
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php
index 203c998e009..e3147062b1a 100644
--- a/apps/dav/lib/CalDAV/Calendar.php
+++ b/apps/dav/lib/CalDAV/Calendar.php
@@ -48,6 +48,9 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
/** @var IConfig */
private $config;
+ /** @var IL10N */
+ protected $l10n;
+
/**
* Calendar constructor.
*
@@ -68,6 +71,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
}
$this->config = $config;
+ $this->l10n = $l10n;
}
/**
@@ -289,7 +293,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
$obj['acl'] = $this->getChildACL();
- return new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
+ return new CalendarObject($this->caldavBackend, $this->l10n, $this->calendarInfo, $obj);
}
@@ -302,7 +306,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
continue;
}
$obj['acl'] = $this->getChildACL();
- $children[] = new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
+ $children[] = new CalendarObject($this->caldavBackend, $this->l10n, $this->calendarInfo, $obj);
}
return $children;
@@ -317,7 +321,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
continue;
}
$obj['acl'] = $this->getChildACL();
- $children[] = new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
+ $children[] = new CalendarObject($this->caldavBackend, $this->l10n, $this->calendarInfo, $obj);
}
return $children;
diff --git a/apps/dav/lib/CalDAV/CalendarObject.php b/apps/dav/lib/CalDAV/CalendarObject.php
index a5c6db6c3f1..dd2684ffa90 100644
--- a/apps/dav/lib/CalDAV/CalendarObject.php
+++ b/apps/dav/lib/CalDAV/CalendarObject.php
@@ -2,9 +2,11 @@
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
* @copyright Copyright (c) 2017, Georg Ehrke
+ * @copyright Copyright (c) 2020, Gary Kim <gary@garykim.dev>
*
* @author Georg Ehrke <oc.list@georgehrke.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author Gary Kim <gary@garykim.dev>
*
* @license AGPL-3.0
*
@@ -25,26 +27,34 @@
namespace OCA\DAV\CalDAV;
+use OCP\IL10N;
use Sabre\VObject\Component;
use Sabre\VObject\Property;
use Sabre\VObject\Reader;
class CalendarObject extends \Sabre\CalDAV\CalendarObject {
+ /** @var IL10N */
+ protected $l10n;
+
/**
* CalendarObject constructor.
*
* @param CalDavBackend $caldavBackend
+ * @param IL10N $l10n
* @param array $calendarInfo
* @param array $objectData
*/
- public function __construct(CalDavBackend $caldavBackend, array $calendarInfo,
+ public function __construct(CalDavBackend $caldavBackend, IL10N $l10n,
+ array $calendarInfo,
array $objectData) {
parent::__construct($caldavBackend, $calendarInfo, $objectData);
if ($this->isShared()) {
unset($this->objectData['size']);
}
+
+ $this->l10n = $l10n;
}
/**
@@ -84,7 +94,7 @@ class CalendarObject extends \Sabre\CalDAV\CalendarObject {
* @param Component\VCalendar $vObject
* @return void
*/
- private static function createConfidentialObject(Component\VCalendar $vObject) {
+ private function createConfidentialObject(Component\VCalendar $vObject) {
/** @var Component $vElement */
$vElement = null;
if(isset($vObject->VEVENT)) {
@@ -109,7 +119,7 @@ class CalendarObject extends \Sabre\CalDAV\CalendarObject {
case 'UID':
break;
case 'SUMMARY':
- $property->setValue('Busy');
+ $property->setValue($this->l10n->t('Busy'));
break;
default:
$vElement->__unset($property->name);
diff --git a/apps/dav/lib/CalDAV/PublicCalendar.php b/apps/dav/lib/CalDAV/PublicCalendar.php
index b7ce37760a7..62b07521ec6 100644
--- a/apps/dav/lib/CalDAV/PublicCalendar.php
+++ b/apps/dav/lib/CalDAV/PublicCalendar.php
@@ -44,7 +44,7 @@ class PublicCalendar extends Calendar {
}
$obj['acl'] = $this->getChildACL();
- return new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
+ return new PublicCalendarObject($this->caldavBackend, $this->l10n, $this->calendarInfo, $obj);
}
/**
@@ -58,7 +58,7 @@ class PublicCalendar extends Calendar {
continue;
}
$obj['acl'] = $this->getChildACL();
- $children[] = new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
+ $children[] = new PublicCalendarObject($this->caldavBackend, $this->l10n, $this->calendarInfo, $obj);
}
return $children;
}
@@ -75,7 +75,7 @@ class PublicCalendar extends Calendar {
continue;
}
$obj['acl'] = $this->getChildACL();
- $children[] = new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
+ $children[] = new PublicCalendarObject($this->caldavBackend, $this->l10n, $this->calendarInfo, $obj);
}
return $children;
}