diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-03-25 10:15:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-25 10:15:12 +0100 |
commit | 8b7fff7ef33762151a0ad7f16075e19bbf0c2553 (patch) | |
tree | 6f701682de1921b7c74d7f18485deed9de0ee82d | |
parent | 4ce191b7ccea6558c0f51f9d866f872120fea356 (diff) | |
parent | a7fb71f908f081d941981a62ed80e8bf58c15c07 (diff) | |
download | nextcloud-server-8b7fff7ef33762151a0ad7f16075e19bbf0c2553.tar.gz nextcloud-server-8b7fff7ef33762151a0ad7f16075e19bbf0c2553.zip |
Merge pull request #14801 from nextcloud/fix/14793/fetch_right_translations
Fetch proper translations
-rw-r--r-- | lib/private/Settings/Admin/Sharing.php | 5 | ||||
-rw-r--r-- | tests/lib/Settings/Admin/SharingTest.php | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/private/Settings/Admin/Sharing.php b/lib/private/Settings/Admin/Sharing.php index ee6a64c85bf..a044d314b04 100644 --- a/lib/private/Settings/Admin/Sharing.php +++ b/lib/private/Settings/Admin/Sharing.php @@ -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; } diff --git a/tests/lib/Settings/Admin/SharingTest.php b/tests/lib/Settings/Admin/SharingTest.php index c97f22e54b6..c40ff98a869 100644 --- a/tests/lib/Settings/Admin/SharingTest.php +++ b/tests/lib/Settings/Admin/SharingTest.php @@ -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 ); } |