summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/UserAddressBooks.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-09-20 14:15:23 +0200
committerJoas Schilling <coding@schilljs.com>2016-10-06 14:20:01 +0200
commitce964f0a10dc2d160a67e8b4e86c5f0c18195d57 (patch)
treebdef6db36f7ee3ef873d555b77ed75d993659aed /apps/dav/lib/CardDAV/UserAddressBooks.php
parenta4f82f13f396fc063643ab4a9dfcf17b52019332 (diff)
downloadnextcloud-server-ce964f0a10dc2d160a67e8b4e86c5f0c18195d57.tar.gz
nextcloud-server-ce964f0a10dc2d160a67e8b4e86c5f0c18195d57.zip
Translate the Contacts addressbook when it's default
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/lib/CardDAV/UserAddressBooks.php')
-rw-r--r--apps/dav/lib/CardDAV/UserAddressBooks.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/dav/lib/CardDAV/UserAddressBooks.php b/apps/dav/lib/CardDAV/UserAddressBooks.php
index 2ac89f302fd..4c7626ba42b 100644
--- a/apps/dav/lib/CardDAV/UserAddressBooks.php
+++ b/apps/dav/lib/CardDAV/UserAddressBooks.php
@@ -21,19 +21,27 @@
*/
namespace OCA\DAV\CardDAV;
+use OCP\IL10N;
+
class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
+ /** @var IL10N */
+ protected $l10n;
+
/**
* Returns a list of addressbooks
*
* @return array
*/
function getChildren() {
+ if ($this->l10n === null) {
+ $this->l10n = \OC::$server->getL10N('dav');
+ }
$addressBooks = $this->carddavBackend->getAddressBooksForUser($this->principalUri);
$objects = [];
foreach($addressBooks as $addressBook) {
- $objects[] = new AddressBook($this->carddavBackend, $addressBook);
+ $objects[] = new AddressBook($this->carddavBackend, $addressBook, $this->l10n);
}
return $objects;