8000 [Translator] Optional Intl dependency · symfony/symfony@a2eb263 · GitHub
[go: up one dir, main page]

Skip to content

Commit a2eb263

Browse files
ro0NLfabpot
authored andcommitted
[Translator] Optional Intl dependency
1 parent 50f37f0 commit a2eb263

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Translation/Translator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ public function setLocale($locale)
163163
}
164164

165165
$this->assertValidLocale($locale);
166-
$this->locale = $locale;
166+
$this->locale = $locale ?? (class_exists(\Locale::class) ? \Locale::getDefault() : 'en');
167167
}
168168

169169
/**
170170
* {@inheritdoc}
171171
*/
172172
public function getLocale()
173173
{
174-
return $this->locale ?? \Locale::getDefault();
174+
return $this->locale;
175175
}
176176

177177
/**

0 commit comments

Comments
 (0)
0