This commit is contained in:
Sampanna Rimal
2024-09-04 12:22:04 +05:45
parent 53c0140f58
commit 82fab174dc
203 changed files with 4255 additions and 1343 deletions

View File

@ -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);