8000 [Translation] TranslatableInterface has no possibility to pass the $parameters to Translator · Issue #60049 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Translation] TranslatableInterface has no possibility to pass the $parameters to Translator #60049
Open
@secit-pl

Description

@secit-pl

Currently, the TranslatableInterface implementation looks like this:

interface TranslatableInterface
{
    public function trans(TranslatorInterface $translator, ?string $locale = null): string;
}

and the TranslatorInterface declaration looks like this

interface TranslatorInterface
{
    public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string;

    public function getLocale(): string;
}

It is not possible to pass parameters to the translator if the object implements TranslatableInterface.

In my opinion, we should add $parameters and also $domain to the trans() method in TranslatableInterface to make these mechanisms consistent.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0