Skip to content

Commit d02e886

Browse files
Berdirtvdijen
andauthored
Translation contracts (#1678)
* Allow symfony/translation-contracts ^3 Co-authored-by: Tim van Dijen <tvdijen@gmail.com>
1 parent 91760fd commit d02e886

3 files changed

Lines changed: 19 additions & 11 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"symfony/http-kernel": "^5.4||^6",
7373
"symfony/intl": "^5.4||^6",
7474
"symfony/routing": "^5.4||^6",
75-
"symfony/translation-contracts": "^2.5",
75+
"symfony/translation-contracts": "^2.5||^3",
7676
"symfony/twig-bridge": "^5.4||^6",
7777
"symfony/var-exporter": "^5.4||^6",
7878
"symfony/yaml": "^5.4||^6",

composer.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/SimpleSAML/Locale/TwigTranslator.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,18 @@ public function __construct(callable $translator)
3636
* @param string|null $domain
3737
* @param string|null $locale
3838
*/
39-
public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null)
39+
public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string
4040
{
4141
$this->locale = $locale;
4242

4343
return call_user_func_array($this->translator, func_get_args());
4444
}
45+
46+
/**
47+
* Returns the default locale.
48+
*/
49+
public function getLocale(): string
50+
{
51+
return Language::FALLBACKLANGUAGE;
52+
}
4553
}

0 commit comments

Comments
 (0)