Translate the personal calendar
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
ff3e8c2139
commit
a4f82f13f3
3 changed files with 10 additions and 3 deletions
|
@ -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*
|
||||
*
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue