Move away from OC_L10N

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2016-10-28 21:46:28 +02:00
parent f2cae3cee1
commit 740659a04c
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
22 changed files with 26 additions and 22 deletions

View File

@ -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');

View File

@ -1,6 +1,6 @@
<?php
/** @var array $_ */
/** @var OC_L10N $l */
/** @var \OCP\IL10N $l */
script('encryption', 'settings-personal');
script('core', 'multiselect');
?>

View File

@ -1,5 +1,5 @@
<?php
/** @var OC_L10N $l */
/** @var \OCP\IL10N $l */
/** @var array $_ */
script('federatedfilesharing', 'settings-admin');
?>

View File

@ -1,5 +1,5 @@
<?php
/** @var OC_L10N $l */
/** @var \OCP\IL10N $l */
/** @var array $_ */
script('federatedfilesharing', 'settings-personal');
style('federatedfilesharing', 'settings-personal');

View File

@ -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')
?>

View File

@ -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));

View File

@ -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) { ?>

View File

@ -1,4 +1,4 @@
<?php /** @var $l OC_L10N */ ?>
<?php /** @var $l \OCP\IL10N */ ?>
<div id='notification'></div>
<div id="emptycontent" class="hidden"></div>

View File

@ -1,6 +1,6 @@
<?php
/** @var $_ array */
/** @var $l OC_L10N */
/** @var $l \OCP\IL10N */
style('files_sharing', 'authenticate');
script('files_sharing', 'authenticate');
?>

View File

@ -1,4 +1,4 @@
<?php /** @var $l OC_L10N */ ?>
<?php /** @var $l \OCP\IL10N */ ?>
<div id='notification'></div>
<div id="emptycontent" class="hidden"></div>

View File

@ -1,5 +1,5 @@
<?php
/** @var $l OC_L10N */
/** @var $l \OCP\IL10N */
/** @var $_ array */
?>

View File

@ -1,4 +1,4 @@
<?php /** @var $l OC_L10N */ ?>
<?php /** @var $l \OCP\IL10N */ ?>
<div id="controls">
<div id="file_action_panel"></div>
</div>

View File

@ -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

View File

@ -1,6 +1,6 @@
<?php
/** @var array $_ */
/** @var OC_L10N $l */
/** @var \OCP\IL10N $l */
style('core', ['styles', 'header']);
?>

View File

@ -1,4 +1,4 @@
<?php /** @var $l OC_L10N */ ?>
<?php /** @var $l \OCP\IL10N */ ?>
<?php
vendor_script('jsTimezoneDetect/jstz');
script('core', [

View File

@ -1,5 +1,5 @@
<?php
/** @var $l OC_L10N */
/** @var $l \OCP\IL10N */
/** @var $_ array */
/* @var $error boolean */
$error = $_['error'];

View File

@ -533,6 +533,9 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$this->query('OC\CapabilitiesManager')->registerCapability(function() use ($serviceName) {
return $this->query($serviceName);
});
}
public function query($name) {
return parent::query($name);
}
}

View File

@ -29,12 +29,13 @@ namespace OC\Setup;
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;
@ -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;

View File

@ -127,7 +127,7 @@ class TemplateLayout extends \OC_Template {
}
// 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)) {

View File

@ -526,7 +526,7 @@ class OC_Util {
*/
public static function addTranslations($application, $languageCode = null, $prepend = false) {
if (is_null($languageCode)) {
$languageCode = \OC_L10N::findLanguage($application);
$languageCode = \OC::$server->getL10NFactory()->findLanguage($application);
}
if (!empty($application)) {
$path = "$application/l10n/$languageCode";

View File

@ -195,7 +195,7 @@ class Util {
* get l10n object
* @param string $application
* @param string|null $language
* @return \OC_L10N
* @return \OCP\IL10N
* @since 6.0.0 - parameter $language was added in 8.0.0
*/
public static function getL10N($application, $language = null) {

View File

@ -68,7 +68,7 @@ $storageInfo=OC_Helper::getStorageInfo('/');
$user = OC::$server->getUserManager()->get(OC_User::getUser());
$email = $user->getEMailAddress();
$userLang=$config->getUserValue( OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage() );
$userLang=$config->getUserValue( OC_User::getUser(), 'core', 'lang', \OC::$server->getL10NFactory()->findLanguage() );
$languageCodes = \OC::$server->getL10NFactory()->findAvailableLanguages();
// array of common languages