File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/Symfony/Component/Translation Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Translation ;
13
13
14
+ use Symfony \Component \Translation \Exception \InvalidArgumentException ;
15
+
14
16
/**
15
17
* Derives fallback locales based on ICU parent locale information, by shortening locale
16
18
* sub tags and ultimately by going through a list of configured fallback locales.
@@ -26,6 +28,16 @@ class FallbackLocaleProvider implements FallbackLocaleProviderInterface
26
28
27
29
private array $ parentLocales ;
28
30
31
+ /**
32
+ * @param string[] $locales
33
+ *
34
+ * @throws InvalidArgumentException If a locale contains invalid characters
35
+ */
36
+ public function __construct (array $ locales = [])
37
+ {
38
+ $ this ->setFallbackLocales ($ locales );
39
+ }
40
+
29
41
public function setFallbackLocales (array $ locales ): void
30
42
{
31
43
foreach ($ locales as $ locale ) {
You can’t perform that action at this time.
0 commit comments