aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/L10N/L10N.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/L10N/L10N.php')
-rw-r--r--lib/private/L10N/L10N.php31
1 files changed, 6 insertions, 25 deletions
diff --git a/lib/private/L10N/L10N.php b/lib/private/L10N/L10N.php
index ea4aa0527bb..39d778f80d6 100644
--- a/lib/private/L10N/L10N.php
+++ b/lib/private/L10N/L10N.php
@@ -1,35 +1,16 @@
<?php
declare(strict_types=1);
-
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Georg Ehrke <oc.list@georgehrke.com>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- * @author Thomas Citharel <nextcloud@tcit.fr>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\L10N;
use OCP\IL10N;
use OCP\L10N\IFactory;
+use Psr\Log\LoggerInterface;
use Punic\Calendar;
use Symfony\Component\Translation\IdentityTranslator;
@@ -156,7 +137,7 @@ class L10N implements IL10N {
* - jsdate: Returns the short JS date format
*/
public function l(string $type, $data = null, array $options = []) {
- if (null === $this->locale) {
+ if ($this->locale === null) {
// Use the language of the instance
$this->locale = $this->getLanguageCode();
}
@@ -234,7 +215,7 @@ class L10N implements IL10N {
$json = json_decode(file_get_contents($translationFile), true);
if (!\is_array($json)) {
$jsonError = json_last_error();
- \OC::$server->getLogger()->warning("Failed to load $translationFile - json error code: $jsonError", ['app' => 'l10n']);
+ \OCP\Server::get(LoggerInterface::class)->warning("Failed to load $translationFile - json error code: $jsonError", ['app' => 'l10n']);
return false;
}