Skip to content

Commit

Permalink
Merge pull request #313 from dotkernel/issue-311
Browse files Browse the repository at this point in the history
fixed issue 311
  • Loading branch information
arhimede authored Nov 16, 2022
2 parents 698a511 + 5a187be commit faa37f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/App/src/Middleware/TranslatorMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ public function __construct(
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$cookieKey = $this->translatorConfig['cookie']['name'];

// add language key
if (!empty($_COOKIE[$this->translatorConfig['cookie']['name']])) {
$languageKey = $_COOKIE[$this->translatorConfig['cookie']['name']];
if (isset($_COOKIE[$cookieKey]) && array_key_exists($_COOKIE[$cookieKey], $this->translatorConfig['locale'])) {
$languageKey = $_COOKIE[$cookieKey];
} else {
$languageKey = $this->translatorConfig['default'];

Expand Down

0 comments on commit faa37f1

Please sign in to comment.