Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Translation] TranslatableInterface has no possibility to pass the $parameters to Translator #60049

Copy link
Copy link
Open
@secit-pl

Description

@secit-pl
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.