Haehnchen / idea-php-symfony2-plugin

IntelliJ IDEA / PhpStorm Symfony Plugin
https://plugins.jetbrains.com/plugin/7219
MIT License
913 stars 137 forks source link

Add support of Twig named argument for translations #2283

Closed SVillette closed 6 months ago

SVillette commented 8 months ago

Description

In a Twig template, I can't use named arguments in |trans function because navigation and autocompletion is not supported.

{{ 'app.status.accepted'|trans(domain = 'resources') }}

In my opinion, it could be a nice addition as I think the above code is better than the following code (which is the only way to have navigation and autocompletion with translations).

{{ 'app.status.accepted'|trans({}, 'resources') }}

Do you think it could be possible to add support of Twig named arguments in the plugin ? Thank you

SVillette commented 6 months ago

Thank you @Haehnchen, it works like a charm