use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Database\Database;
use Friendica\Util\Strings;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Database\Database;
use Friendica\Util\Strings;
'de' => 'Deutsch',
'en-gb' => 'English (United Kingdom)',
'en-us' => 'English (United States)',
'de' => 'Deutsch',
'en-gb' => 'English (United Kingdom)',
'en-us' => 'English (United States)',
- /**
- * @var LoggerInterface
- */
- private $logger;
-
- public function __construct(IManageConfigValues $config, Database $dba, LoggerInterface $logger, IHandleSessions $session, array $server, array $get)
+ public function __construct(IManageConfigValues $config, Database $dba, IHandleSessions $session, array $server, array $get)
$this->loadTranslationTable(L10n::detectLanguage($server, $get, $config->get('system', 'language', self::DEFAULT)));
$this->setSessionVariable($session);
$this->loadTranslationTable(L10n::detectLanguage($server, $get, $config->get('system', 'language', self::DEFAULT)));
$this->setSessionVariable($session);
private function setLangFromSession(IHandleSessions $session)
{
if ($session->get('language') !== $this->lang) {
private function setLangFromSession(IHandleSessions $session)
{
if ($session->get('language') !== $this->lang) {
* Uses an App object shim since all the strings files refer to $a->strings
*
* @param string $lang language code to load
* Uses an App object shim since all the strings files refer to $a->strings
*
* @param string $lang language code to load
- public static function detectLanguage(array $server, array $get, string $sysLang = self::DEFAULT)
+ public static function detectLanguage(array $server, array $get, string $sysLang = self::DEFAULT): string
{
$ret = str_replace(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
[$this->t('Monday'), $this->t('Tuesday'), $this->t('Wednesday'), $this->t('Thursday'), $this->t('Friday'), $this->t('Saturday'), $this->t('Sunday')],
{
$ret = str_replace(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
[$this->t('Monday'), $this->t('Tuesday'), $this->t('Wednesday'), $this->t('Thursday'), $this->t('Friday'), $this->t('Saturday'), $this->t('Sunday')],
{
$ret = str_replace(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
[$this->t('Mon'), $this->t('Tue'), $this->t('Wed'), $this->t('Thu'), $this->t('Fri'), $this->t('Sat'), $this->t('Sun')],
{
$ret = str_replace(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
[$this->t('Mon'), $this->t('Tue'), $this->t('Wed'), $this->t('Thu'), $this->t('Fri'), $this->t('Sat'), $this->t('Sun')],
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @hook poke_verbs pokes array
*/
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @hook poke_verbs pokes array
*/
{
// index is present tense verb
// value is array containing past tense verb, translation of present, translation of past
{
// index is present tense verb
// value is array containing past tense verb, translation of present, translation of past