diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-10-29 09:39:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-29 09:39:22 +0200 |
commit | e48fa1c3370632b5f8a2dcdeeabda217f50b3539 (patch) | |
tree | fdc7176cffe1f6e0a306efe0ccce149584e7f896 /apps/files | |
parent | 035890aeb1b6e540396fd3c81841b60ea6d76f94 (diff) | |
parent | a78f6e95869272b2d5cf34bd3374a9208ae80870 (diff) | |
download | nextcloud-server-e48fa1c3370632b5f8a2dcdeeabda217f50b3539.tar.gz nextcloud-server-e48fa1c3370632b5f8a2dcdeeabda217f50b3539.zip |
Merge pull request #1948 from nextcloud/move_away_lagacy_oc_l10n
Move away from legacy OC_L10N
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/lib/Helper.php | 2 | ||||
-rw-r--r-- | apps/files/templates/index.php | 2 | ||||
-rw-r--r-- | apps/files/templates/recentlist.php | 2 | ||||
-rw-r--r-- | apps/files/tests/ActivityTest.php | 14 | ||||
-rw-r--r-- | apps/files/tests/Controller/ViewControllerTest.php | 14 |
5 files changed, 16 insertions, 18 deletions
diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php index 26bc020c871..b6b209dea70 100644 --- a/apps/files/lib/Helper.php +++ b/apps/files/lib/Helper.php @@ -45,7 +45,7 @@ class Helper { public static function buildFileStorageStatistics($dir) { // information about storage capacities $storageInfo = \OC_Helper::getStorageInfo($dir); - $l = new \OC_L10N('files'); + $l = \OC::$server->getL10N('files'); $maxUploadFileSize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']); $maxHumanFileSize = \OCP\Util::humanFileSize($maxUploadFileSize); $maxHumanFileSize = $l->t('Upload (max. %s)', array($maxHumanFileSize)); diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 92345d3063e..17958d330b7 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -1,4 +1,4 @@ -<?php /** @var $l OC_L10N */ ?> +<?php /** @var $l \OCP\IL10N */ ?> <?php $_['appNavigation']->printPage(); ?> <div id="app-content"> <?php foreach ($_['appContents'] as $content) { ?> diff --git a/apps/files/templates/recentlist.php b/apps/files/templates/recentlist.php index 1667eb4cc8d..6c271a07f5f 100644 --- a/apps/files/templates/recentlist.php +++ b/apps/files/templates/recentlist.php @@ -1,4 +1,4 @@ -<?php /** @var $l OC_L10N */ ?> +<?php /** @var $l \OCP\IL10N */ ?> <div id='notification'></div> <div id="emptycontent" class="hidden"></div> diff --git a/apps/files/tests/ActivityTest.php b/apps/files/tests/ActivityTest.php index e6199013e81..65e914c1a54 100644 --- a/apps/files/tests/ActivityTest.php +++ b/apps/files/tests/ActivityTest.php @@ -24,6 +24,8 @@ namespace OCA\Files\Tests; use OCA\Files\Activity; +use OCP\IL10N; +use OCP\L10N\IFactory; use Test\TestCase; /** @@ -77,12 +79,8 @@ class ActivityTest extends TestCase { $this->config ); - $this->l10nFactory = $this->getMockBuilder('OCP\L10N\IFactory') - ->disableOriginalConstructor() - ->getMock(); - $deL10n = $this->getMockBuilder('OC_L10N') - ->disableOriginalConstructor() - ->getMock(); + $this->l10nFactory = $this->createMock(IFactory::class); + $deL10n = $this->createMock(IL10N::class); $deL10n->expects($this->any()) ->method('t') ->willReturnCallback(function ($argument) { @@ -92,8 +90,8 @@ class ActivityTest extends TestCase { $this->l10nFactory->expects($this->any()) ->method('get') ->willReturnMap([ - ['files', null, new \OC_L10N('files', 'en')], - ['files', 'en', new \OC_L10N('files', 'en')], + ['files', null, \OC::$server->getL10N('files', 'en')], + ['files', 'en', \OC::$server->getL10N('files', 'en')], ['files', 'de', $deL10n], ]); diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index b4b4bfa92fc..179aaa373b3 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -137,7 +137,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files', 'script' => 'list.php', 'order' => 0, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files'), 'All files', []), + 'name' => \OC::$server->getL10N('files')->t('All files'), 'active' => false, 'icon' => '', ], @@ -146,7 +146,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files', 'script' => 'recentlist.php', 'order' => 2, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files'), 'Recent', []), + 'name' => \OC::$server->getL10N('files')->t('Recent'), 'active' => false, 'icon' => '', ], @@ -164,7 +164,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files_sharing', 'script' => 'list.php', 'order' => 10, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared with you', []), + 'name' => \OC::$server->getL10N('files_sharing')->t('Shared with you'), 'active' => false, 'icon' => '', ], @@ -173,7 +173,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files_sharing', 'script' => 'list.php', 'order' => 15, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared with others', []), + 'name' => \OC::$server->getL10N('files_sharing')->t('Shared with others'), 'active' => false, 'icon' => '', ], @@ -182,7 +182,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files_sharing', 'script' => 'list.php', 'order' => 20, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared by link', []), + 'name' => \OC::$server->getL10N('files_sharing')->t('Shared by link', []), 'active' => false, 'icon' => '', ], @@ -191,7 +191,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'systemtags', 'script' => 'list.php', 'order' => 25, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('systemtags'), 'Tags', []), + 'name' => \OC::$server->getL10N('systemtags')->t('Tags'), 'active' => false, 'icon' => '', ], @@ -200,7 +200,7 @@ class ViewControllerTest extends TestCase { 'appname' => 'files_trashbin', 'script' => 'list.php', 'order' => 50, - 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_trashbin'), 'Deleted files', []), + 'name' => \OC::$server->getL10N('files_trashbin')->t('Deleted files'), 'active' => false, 'icon' => '', ], |