Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/encryption/templates/settings-admin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/** @var array $_ */
/** @var OC_L10N $l */
/** @var \OCP\IL10N $l */
script('encryption', 'settings-admin');
script('core', 'multiselect');
style('encryption', 'settings-admin');
Expand Down
2 changes: 1 addition & 1 deletion apps/encryption/templates/settings-personal.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/** @var array $_ */
/** @var OC_L10N $l */
/** @var \OCP\IL10N $l */
script('encryption', 'settings-personal');
script('core', 'multiselect');
?>
Expand Down
2 changes: 1 addition & 1 deletion apps/federatedfilesharing/templates/settings-admin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/** @var OC_L10N $l */
/** @var \OCP\IL10N $l */
/** @var array $_ */
script('federatedfilesharing', 'settings-admin');
?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/** @var OC_L10N $l */
/** @var \OCP\IL10N $l */
/** @var array $_ */
script('federatedfilesharing', 'settings-personal');
style('federatedfilesharing', 'settings-personal');
Expand Down
2 changes: 1 addition & 1 deletion apps/federation/templates/settings-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @var array $_ */
use OCA\Federation\TrustedServers;

/** @var OC_L10N $l */
/** @var \OCP\IL10N $l */
script('federation', 'settings-admin');
style('federation', 'settings-admin')
?>
Expand Down
2 changes: 1 addition & 1 deletion apps/files/lib/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion apps/files/templates/index.php
Original file line number Diff line number Diff line change
@@ -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) { ?>
Expand Down
2 changes: 1 addition & 1 deletion apps/files/templates/recentlist.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php /** @var $l OC_L10N */ ?>
<?php /** @var $l \OCP\IL10N */ ?>
<div id='notification'></div>

<div id="emptycontent" class="hidden"></div>
Expand Down
14 changes: 6 additions & 8 deletions apps/files/tests/ActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
namespace OCA\Files\Tests;

use OCA\Files\Activity;
use OCP\IL10N;
use OCP\L10N\IFactory;
use Test\TestCase;

/**
Expand Down Expand Up @@ -77,12 +79,8 @@ protected function setUp() {
$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) {
Expand All @@ -92,8 +90,8 @@ protected function setUp() {
$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],
]);

Expand Down
14 changes: 7 additions & 7 deletions apps/files/tests/Controller/ViewControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function testIndexWithRegularBrowser() {
'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' => '',
],
Expand All @@ -146,7 +146,7 @@ public function testIndexWithRegularBrowser() {
'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' => '',
],
Expand All @@ -164,7 +164,7 @@ public function testIndexWithRegularBrowser() {
'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' => '',
],
Expand All @@ -173,7 +173,7 @@ public function testIndexWithRegularBrowser() {
'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' => '',
],
Expand All @@ -182,7 +182,7 @@ public function testIndexWithRegularBrowser() {
'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' => '',
],
Expand All @@ -191,7 +191,7 @@ public function testIndexWithRegularBrowser() {
'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' => '',
],
Expand All @@ -200,7 +200,7 @@ public function testIndexWithRegularBrowser() {
'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' => '',
],
Expand Down
2 changes: 1 addition & 1 deletion apps/files_external/tests/Command/ListCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private function getInstance() {
}

public function testListAuthIdentifier() {
$l10n = $this->getMock('\OC_L10N', null, [], '', false);
$l10n = $this->getMock('\OPC\IL10N', null, [], '', false);
$session = $this->createMock(ISession::class);
$crypto = $this->createMock(ICrypto::class);
$instance = $this->getInstance();
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/templates/authenticate.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/** @var $_ array */
/** @var $l OC_L10N */
/** @var $l \OCP\IL10N */
style('files_sharing', 'authenticate');
script('files_sharing', 'authenticate');
?>
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/templates/list.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php /** @var $l OC_L10N */ ?>
<?php /** @var $l \OCP\IL10N */ ?>
<div id='notification'></div>

<div id="emptycontent" class="hidden"></div>
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/templates/public.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/** @var $l OC_L10N */
/** @var $l \OCP\IL10N */
/** @var $_ array */
?>

Expand Down
2 changes: 1 addition & 1 deletion apps/files_trashbin/templates/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php /** @var $l OC_L10N */ ?>
<?php /** @var $l \OCP\IL10N */ ?>
<div id="controls">
<div id="file_action_panel"></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion core/templates/404.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/** @var $_ array */
/** @var $l OC_L10N */
/** @var $l \OCP\IL10N */
/** @var $theme OC_Theme */
// @codeCoverageIgnoreStart
if(!isset($_)) {//also provide standalone error page
Expand Down
2 changes: 1 addition & 1 deletion core/templates/exception.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/** @var array $_ */
/** @var OC_L10N $l */
/** @var \OCP\IL10N $l */

style('core', ['styles', 'header']);
?>
Expand Down
2 changes: 1 addition & 1 deletion core/templates/login.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php /** @var $l OC_L10N */ ?>
<?php /** @var $l \OCP\IL10N */ ?>
<?php
vendor_script('jsTimezoneDetect/jstz');
script('core', [
Expand Down
2 changes: 1 addition & 1 deletion core/templates/twofactorshowchallenge.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/** @var $l OC_L10N */
/** @var $l \OCP\IL10N */
/** @var $_ array */
/* @var $error boolean */
$error = $_['error'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ public function registerCapability($serviceName) {
$this->query('OC\CapabilitiesManager')->registerCapability(function() use ($serviceName) {
return $this->query($serviceName);
});
}

public function query($name) {
return parent::query($name);
}
}
5 changes: 3 additions & 2 deletions lib/private/Setup/AbstractDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
use OC\AllConfig;
use OC\DB\ConnectionFactory;
use OCP\IConfig;
use OCP\IL10N;
use OCP\ILogger;
use OCP\Security\ISecureRandom;

abstract class AbstractDatabase {

/** @var \OC_L10N */
/** @var IL10N */
protected $trans;
/** @var string */
protected $dbDefinitionFile;
Expand All @@ -57,7 +58,7 @@ abstract class AbstractDatabase {
/** @var ISecureRandom */
protected $random;

public function __construct($trans, $dbDefinitionFile, IConfig $config, ILogger $logger, ISecureRandom $random) {
public function __construct(IL10N $trans, $dbDefinitionFile, IConfig $config, ILogger $logger, ISecureRandom $random) {
$this->trans = $trans;
$this->dbDefinitionFile = $dbDefinitionFile;
$this->config = $config;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/TemplateLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function __construct( $renderAs, $appId = '' ) {

}
// Send the language to our layouts
$this->assign('language', \OC_L10N::findLanguage());
$this->assign('language', \OC::$server->getL10NFactory()->findLanguage());

if(\OC::$server->getSystemConfig()->getValue('installed', false)) {
if (empty(self::$versionHash)) {
Expand Down
Loading