summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-09-20 14:09:08 +0200
committerJoas Schilling <coding@schilljs.com>2016-10-06 14:19:58 +0200
commita4f82f13f396fc063643ab4a9dfcf17b52019332 (patch)
tree486f57f4ab89a0299abd37af98e38a66da20b889 /apps
parentff3e8c21397c79ac1231c4f16a8372908d79b067 (diff)
downloadnextcloud-server-a4f82f13f396fc063643ab4a9dfcf17b52019332.tar.gz
nextcloud-server-a4f82f13f396fc063643ab4a9dfcf17b52019332.zip
Translate the personal calendar
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php3
-rw-r--r--apps/dav/lib/CalDAV/Calendar.php4
-rw-r--r--apps/dav/lib/HookManager.php6
3 files changed, 10 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index d742061428b..07b61285eca 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -59,6 +59,9 @@ use Sabre\VObject\Recur\EventIterator;
*/
class CalDavBackend extends AbstractBackend implements SyncSupport, SubscriptionSupport, SchedulingSupport {
+ const PERSONAL_CALENDAR_URI = 'personal';
+ const PERSONAL_CALENDAR_NAME = 'Personal';
+
/**
* We need to specify a max date, because we need to stop *somewhere*
*
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php
index 3fbcd87acc0..fc08c9ac87a 100644
--- a/apps/dav/lib/CalDAV/Calendar.php
+++ b/apps/dav/lib/CalDAV/Calendar.php
@@ -38,6 +38,10 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) {
$this->calendarInfo['{DAV:}displayname'] = $l10n->t('Contact birthdays');
}
+ if ($this->getName() === CalDavBackend::PERSONAL_CALENDAR_URI &&
+ $this->calendarInfo['{DAV:}displayname'] === CalDavBackend::PERSONAL_CALENDAR_NAME) {
+ $this->calendarInfo['{DAV:}displayname'] = $l10n->t('Personal');
+ }
}
/**
diff --git a/apps/dav/lib/HookManager.php b/apps/dav/lib/HookManager.php
index 364db19d76a..0ea5e47dd95 100644
--- a/apps/dav/lib/HookManager.php
+++ b/apps/dav/lib/HookManager.php
@@ -21,7 +21,6 @@
*/
namespace OCA\DAV;
-use OCA\DAV\CalDAV\BirthdayService;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CardDAV\CardDavBackend;
use OCA\DAV\CardDAV\SyncService;
@@ -124,8 +123,9 @@ class HookManager {
$principal = 'principals/users/' . $user->getUID();
if ($this->calDav->getCalendarsForUserCount($principal) === 0) {
try {
- $this->calDav->createCalendar($principal, 'personal', [
- '{DAV:}displayname' => 'Personal']);
+ $this->calDav->createCalendar($principal, CalDavBackend::PERSONAL_CALENDAR_URI, [
+ '{DAV:}displayname' => CalDavBackend::PERSONAL_CALENDAR_NAME,
+ ]);
} catch (\Exception $ex) {
\OC::$server->getLogger()->logException($ex);
}