X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FL10n.php;h=aca57793ca9711d1208c5e60f5c37231784f4a64;hb=06284e60073f374c1bd411e0bba6474a13c14f10;hp=138fd8730b19efd3f5ec9860bf9be6966cd10dae;hpb=6a414b054341f09a6c1d4b9bac3d8066de344073;p=friendica.git diff --git a/src/Core/L10n.php b/src/Core/L10n.php index 138fd8730b..aca57793ca 100644 --- a/src/Core/L10n.php +++ b/src/Core/L10n.php @@ -21,8 +21,8 @@ namespace Friendica\Core; -use Friendica\Core\Config\IConfig; -use Friendica\Core\Session\ISession; +use Friendica\Core\Config\Capability\IManageConfigValues; +use Friendica\Core\Session\Capability\IHandleSessions; use Friendica\Database\Database; use Friendica\Util\Strings; use Psr\Log\LoggerInterface; @@ -62,7 +62,7 @@ class L10n */ private $logger; - public function __construct(IConfig $config, Database $dba, LoggerInterface $logger, ISession $session, array $server, array $get) + public function __construct(IManageConfigValues $config, Database $dba, LoggerInterface $logger, IHandleSessions $session, array $server, array $get) { $this->dba = $dba; $this->logger = $logger; @@ -85,7 +85,7 @@ class L10n /** * Sets the language session variable */ - private function setSessionVariable(ISession $session) + private function setSessionVariable(IHandleSessions $session) { if ($session->get('authenticated') && !$session->get('language')) { $session->set('language', $this->lang); @@ -103,7 +103,7 @@ class L10n } } - private function setLangFromSession(ISession $session) + private function setLangFromSession(IHandleSessions $session) { if ($session->get('language') !== $this->lang) { $this->loadTranslationTable($session->get('language')); @@ -304,9 +304,9 @@ class L10n } elseif (count($t) > 0) { // for some languages there is only a single array item $s = $t[0]; - } else { - $this->logger->warning('Found empty strings array.', ['singular' => $singular, 'plural' => $plural, 'array' => $t]); } + // if $t is empty, skip it, because empty strings array are indended + // to make string file smaller when there's no translation } else { $s = $t; } @@ -314,7 +314,7 @@ class L10n if (is_null($s) && $this->stringPluralSelectDefault($count)) { $s = $plural; - } else { + } elseif (is_null($s)) { $s = $singular; }