-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] Translation Debug command doesn't work correctly with domain as constant #53356
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
Comments
Probably a typo but just to be sure, you used double backslashes instead of simple ones ' in your real code ?
|
Yes indeed it was a typo, I edited the issue. |
@welcoMattic you introduced the PhpAstExtractor in #46161
? |
I will take a look on it next week. In the mean time, if you find a way to support it with FQCN, feel free to open a PR. |
…omain (VincentLanglet) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Translation] Fix `TranslationNodeVisitor` with constant domain | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT Related to #53356 but fixing only the twig part. Commits ------- d14795d [Translation] Fix `TranslationNodeVisitor` with constant domain
…omain (VincentLanglet) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Translation] Fix `TranslationNodeVisitor` with constant domain | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT Related to symfony/symfony#53356 but fixing only the twig part. Commits ------- d14795dbb1 [Translation] Fix `TranslationNodeVisitor` with constant domain
I think I found a solution @welcoMattic ; by running the NameResolver before (I found this advice here nikic/PHP-Parser#188 (comment)) I get the full FQCN , cf #53624 |
…actor (VincentLanglet) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Translation] Fix constant domain resolution in PhpAstExtractor | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #53356 | License | MIT Similar to #53357 Closes #53356 Commits ------- c43f6c0 [Translation] Fix constant domain resolution in PhpAstExtractor
Symfony version(s) affected
all
Description
Currently both
in php and
in twig is misunderstood by translation extractor.
The first one thinks the domain is
'messages'
, the second one'_undefined'
.It would be nice to correctly support the domain.
If it's really not possible, it seems better to me to have
'_undefined'
in both case.How to reproduce
Running
with the previous code.
Possible Solution
For the AbstractVisitor, I tried doing something with
but this works only with full FQCN, and not when it's imported/aliased at the start of the file...
For twig, I tried #53357
Additional Context
No response
The text was updated successfully, but these errors were encountered: