Skip to content

Commit 4b4a600

Browse files
authored
Don't override URL uselang parameter (#67)
Only use the session's `lang` parameter if the query string's `uselang` parameter is not set. Bug: T357821
1 parent 5175962 commit 4b4a600

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Service/Intuition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static function serviceFactory(
3939
if ($currentRequest->hasSession()) {
4040
$session = $currentRequest->getSession();
4141
$sessionLang = $session->get('lang');
42-
if (!empty($sessionLang)) {
42+
if (!$queryLang && !empty($sessionLang)) {
4343
$useLang = $sessionLang;
4444
}
4545
// Save the language to the session.
@@ -50,7 +50,7 @@ public static function serviceFactory(
5050
}
5151

5252
// Set up Intuition, using the selected language.
53-
$intuition = new static(['domain' => $domain]);
53+
$intuition = new static(['domain' => $domain, 'param' => false]);
5454
$intuition->registerDomain($domain, $projectDir.'/i18n');
5555
$intuition->registerDomain('toolforge', dirname(__DIR__).'/Resources/i18n');
5656
$intuition->setLang(strtolower($useLang));

0 commit comments

Comments
 (0)