]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fetch proper translations 14801/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Fri, 22 Mar 2019 08:46:41 +0000 (09:46 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Mon, 25 Mar 2019 08:10:54 +0000 (09:10 +0100)
Fixes #14793

This is caused by the mess we have with OC\Settings mapping to settings
and lib/private/Settings.

Anyway this is the quick fix. Moving stuff around for 17 seems better.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
lib/private/Settings/Admin/Sharing.php
tests/lib/Settings/Admin/SharingTest.php

index ee6a64c85bfbc00bb54e2b052a23660779628d9f..a044d314b047691c2c348f7180f9eb7f6083dffd 100644 (file)
@@ -31,6 +31,7 @@ use OCP\AppFramework\Http\TemplateResponse;
 use OCP\Constants;
 use OCP\IConfig;
 use OCP\IL10N;
+use OCP\L10N\IFactory;
 use OCP\Settings\ISettings;
 use OCP\Share\IManager;
 use OCP\Util;
@@ -48,9 +49,9 @@ class Sharing implements ISettings {
        /**
         * @param IConfig $config
         */
-       public function __construct(IConfig $config, IL10N $l, IManager $shareManager) {
+       public function __construct(IConfig $config, IFactory $l, IManager $shareManager) {
                $this->config = $config;
-               $this->l = $l;
+               $this->l = $l->get('lib');
                $this->shareManager = $shareManager;
        }
 
index c97f22e54b6a115d8685c610207429db842446d7..c40ff98a8691ba3f2022b9f26998dd877334c0b4 100644 (file)
@@ -28,6 +28,7 @@ use OCP\AppFramework\Http\TemplateResponse;
 use OCP\Constants;
 use OCP\IConfig;
 use OCP\IL10N;
+use OCP\L10N\IFactory;
 use OCP\Share\IManager;
 use Test\TestCase;
 
@@ -45,11 +46,16 @@ class SharingTest extends TestCase {
                parent::setUp();
                $this->config = $this->getMockBuilder(IConfig::class)->getMock();
                $this->l10n = $this->getMockBuilder(IL10N::class)->getMock();
+
+               $l10Factory = $this->createMock(IFactory::class);
+               $l10Factory->method('get')
+                       ->willReturn($this->l10n);
+
                $this->shareManager = $this->getMockBuilder(IManager::class)->getMock();
 
                $this->admin = new Sharing(
                        $this->config,
-                       $this->l10n,
+                       $l10Factory,
                        $this->shareManager
                );
        }