Skip to content

Commit

Permalink
pkp#7512 Fixed call to PKPRequest::getPreferredLanguage()
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasraoni committed Nov 14, 2024
1 parent f0ced92 commit f910b19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/i18n/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ public function getLocale(): string
return $this->locale;
}
$request = $this->_getRequest();
$supportedLocales = array_values($this->_getSupportedLocales());
$locale = $request->getUserVar('setLocale')
?: $request->getSession()->get('currentLocale')
?: $request->getCookieVar('currentLocale')
?: $request->getPreferredLanguage($this->_getSupportedLocales());
?: $request->getPreferredLanguage(count($supportedLocales) ? $supportedLocales : [LocaleInterface::DEFAULT_LOCALE]);
$this->setLocale($locale);
return $this->locale;
}
Expand Down

0 comments on commit f910b19

Please sign in to comment.