changes
This commit is contained in:
@ -34,9 +34,14 @@ class LocaleSwitcher implements LocaleAwareInterface
|
||||
|
||||
public function setLocale(string $locale): void
|
||||
{
|
||||
if (class_exists(\Locale::class)) {
|
||||
\Locale::setDefault($locale);
|
||||
// Silently ignore if the intl extension is not loaded
|
||||
try {
|
||||
if (class_exists(\Locale::class, false)) {
|
||||
\Locale::setDefault($locale);
|
||||
}
|
||||
} catch (\Exception) {
|
||||
}
|
||||
|
||||
$this->locale = $locale;
|
||||
$this->requestContext?->setParameter('_locale', $locale);
|
||||
|
||||
|
Reference in New Issue
Block a user