We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bce6a5a commit 44eda81Copy full SHA for 44eda81
LocaleSwitcher.php
@@ -34,9 +34,14 @@ public function __construct(
34
35
public function setLocale(string $locale): void
36
{
37
- if (class_exists(\Locale::class)) {
38
- \Locale::setDefault($locale);
+ // Silently ignore if the intl extension is not loaded
+ try {
39
+ if (class_exists(\Locale::class, false)) {
40
+ \Locale::setDefault($locale);
41
+ }
42
+ } catch (\Exception) {
43
}
44
+
45
$this->locale = $locale;
46
$this->requestContext?->setParameter('_locale', $locale);
47
0 commit comments