mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-10-29 20:53:30 +00:00
[Web] Update composer libraries
This commit is contained in:
1297 files changed
+71585
-24460
No files matched your search
@@ -19,19 +19,20 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
class TranslatableMessage implements TranslatableInterface
|
||||
{
|
||||
private string $message;
|
||||
private array $parameters;
|
||||
private ?string $domain;
|
||||
|
||||
public function __construct(string $message, array $parameters = [], ?string $domain = null)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->parameters = $parameters;
|
||||
$this->domain = $domain;
|
||||
public function __construct(
|
||||
private string $message,
|
||||
private array $parameters = [],
|
||||
private ?string $domain = null,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since Symfony 7.4
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
trigger_deprecation('symfony/translation', '7.4', 'Method "%s()" is deprecated.', __METHOD__);
|
||||
|
||||
return $this->getMessage();
|
||||
}
|
||||
|
||||
@@ -52,9 +53,13 @@ class TranslatableMessage implements TranslatableInterface
|
||||
|
||||
public function trans(TranslatorInterface $translator, ?string $locale = null): string
|
||||
{
|
||||
return $translator->trans($this->getMessage(), array_map(
|
||||
static fn ($parameter) => $parameter instanceof TranslatableInterface ? $parameter->trans($translator, $locale) : $parameter,
|
||||
$this->getParameters()
|
||||
), $this->getDomain(), $locale);
|
||||
$parameters = $this->getParameters();
|
||||
foreach ($parameters as $k => $v) {
|
||||
if ($v instanceof TranslatableInterface) {
|
||||
$parameters[$k] = $v->trans($translator, $locale);
|
||||
}
|
||||
}
|
||||
|
||||
return $translator->trans($this->getMessage(), $parameters, $this->getDomain(), $locale);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user