Skip to content

[Translation] Is there a way to specify specific domain in method references #2001

Open
@SVillette

Description

@SVillette

Description

A great feature of the plugin is to add method references for custom classes in any project.
It works very well and thank you for that.

However, I have an issue to set up completion for translation using a specific domain.
I searched in docs or existing issues (#155, #1351, #1742) but unfortunately didn't find much exlanations about how to set it up or why is it not possible.

Is there something new about it ? Is it a planned feature ?
That would be a great addition to the plugin.

Thanks.

What I tried so far

I tried to add completion for this class which will translate in the domain flashes

interface FlashHelperInterface
{
    public const SUCCESS = 'success';

    public function sendMessage(string $type, string $key, array $parameters = []): void;
}

I only managed to make it work if I define a parameter for the domain (as indicated in the docs) but that's not exactly what I want.

/**
 * @param string $key #TranslationKey
 * @param string $domain #TranslationDomain
 */
public function sendTestMessage(string $key, string $domain): void;

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions