Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of Twig named argument for translations #2283

Closed
SVillette opened this issue Feb 24, 2024 · 1 comment
Closed

Add support of Twig named argument for translations #2283

SVillette opened this issue Feb 24, 2024 · 1 comment
Labels

Comments

@SVillette
Copy link

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

@Haehnchen Haehnchen added the todo label Apr 6, 2024
Haehnchen added a commit that referenced this issue Apr 6, 2024
…nschoice"
Haehnchen added a commit that referenced this issue Apr 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
#2283 allowing resolving named "domain" argument for "trans" and "transchoice"
Haehnchen added a commit that referenced this issue Apr 6, 2024
…g first PhpStorm 2024.x workaround
Haehnchen added a commit that referenced this issue Apr 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
#2283 navigation / goto for Twig named argument translations including first PhpStorm 2024.x workaround
@Haehnchen Haehnchen added fixed and removed todo labels Apr 6, 2024
@SVillette
Copy link
Author

Thank you @Haehnchen, it works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants