Translate the personal calendar

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2016-09-20 14:09:08 +02:00
parent ff3e8c2139
commit a4f82f13f3
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
3 changed files with 10 additions and 3 deletions

View File

@ -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*
*

View File

@ -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');
}
}
/**

View File

@ -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);
}