continue with getter/setter removal

This commit is contained in:
Dennis Eichhorn 2023-05-30 04:15:37 +02:00
parent 2feb4caec5
commit 853ec600b5
3 changed files with 13 additions and 13 deletions

View File

@ -178,7 +178,7 @@ final class Application
if ($account->id > 0) { if ($account->id > 0) {
$response->header->l11n = $account->l11n; $response->header->l11n = $account->l11n;
} elseif ($this->app->sessionManager->get('language') !== null } elseif ($this->app->sessionManager->get('language') !== null
&& $response->header->l11n->getLanguage() !== $this->app->sessionManager->get('language') && $response->header->l11n->language !== $this->app->sessionManager->get('language')
) { ) {
$response->header->l11n $response->header->l11n
->loadFromLanguage( ->loadFromLanguage(
@ -189,14 +189,14 @@ final class Application
$this->app->setResponseLanguage($request, $response, $this->config); $this->app->setResponseLanguage($request, $response, $this->config);
} }
UriFactory::setQuery('/lang', $response->getLanguage()); UriFactory::setQuery('/lang', $response->header->l11n->language);
$this->loadLanguageFromPath( $this->loadLanguageFromPath(
$response->getLanguage(), $response->header->l11n->language,
__DIR__ . '/lang/' . $response->getLanguage() . '.lang.php' __DIR__ . '/lang/' . $response->header->l11n->language . '.lang.php'
); );
$response->header->set('content-language', $response->getLanguage(), true); $response->header->set('content-language', $response->header->l11n->language, true);
/* Create html head */ /* Create html head */
$this->initResponseHead($head, $request, $response); $this->initResponseHead($head, $request, $response);
@ -270,8 +270,8 @@ final class Application
$response->header->status = RequestStatusCode::R_406; $response->header->status = RequestStatusCode::R_406;
$pageView->setTemplate('/Web/Timerecording/Error/406'); $pageView->setTemplate('/Web/Timerecording/Error/406');
$this->loadLanguageFromPath( $this->loadLanguageFromPath(
$response->getLanguage(), $response->header->l11n->language,
__DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php' __DIR__ . '/Error/lang/' . $response->header->l11n->language . '.lang.php'
); );
} }
@ -290,8 +290,8 @@ final class Application
$response->header->status = RequestStatusCode::R_503; $response->header->status = RequestStatusCode::R_503;
$pageView->setTemplate('/Web/Timerecording/Error/503'); $pageView->setTemplate('/Web/Timerecording/Error/503');
$this->loadLanguageFromPath( $this->loadLanguageFromPath(
$response->getLanguage(), $response->header->l11n->language,
__DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php' __DIR__ . '/Error/lang/' . $response->header->l11n->language . '.lang.php'
); );
} }
@ -349,8 +349,8 @@ final class Application
$response->header->status = RequestStatusCode::R_403; $response->header->status = RequestStatusCode::R_403;
$pageView->setTemplate('/Web/Timerecording/Error/403'); $pageView->setTemplate('/Web/Timerecording/Error/403');
$this->loadLanguageFromPath( $this->loadLanguageFromPath(
$response->getLanguage(), $response->header->l11n->language,
__DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php' __DIR__ . '/Error/lang/' . $response->header->l11n->language . '.lang.php'
); );
} }

View File

@ -24,7 +24,7 @@ $head = $this->getData('head');
$dispatch = $this->getData('dispatch') ?? []; $dispatch = $this->getData('dispatch') ?? [];
?> ?>
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html lang="<?= $this->printHtml($this->response->getLanguage()); ?>"> <html lang="<?= $this->printHtml($this->response->header->l11n->language); ?>">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">

View File

@ -26,7 +26,7 @@ declare(strict_types=1);
$head = $this->getData('head'); $head = $this->getData('head');
?> ?>
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html lang="<?= $this->printHtml($this->response->getLanguage()); ?>"> <html lang="<?= $this->printHtml($this->response->header->l11n->language); ?>">
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"> <meta charset="utf-8">