-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Unused state of some translations which are really used #29085
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
Unfortunately, that's expected. As the docs state the command is only able to find translation usages in templates. |
Thank you @xabbuh So everyone also search translations with global IDE search ? |
Until now yes. In theory it could be possible to extract more messages by analyzing the code, but someone would need to contribute the code :) |
Hum actually there is already a |
The translator config already has a I can try it.
Sounds interesting... I'll take a look. |
Thank you for your response. |
…tor paths, Twig paths and Translator aware services paths in commands (yceruto) This PR was merged into the 4.3-dev branch. Discussion ---------- [FrameworkBundle][Translation] Add support for Translator paths, Twig paths and Translator aware services paths in commands | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29085, #29633, #17739 | License | MIT | Doc PR | TODO Add custom (also common) Twig and Translation paths to the translation commands: * Custom directories configured in `twig.paths`. * Custom directories configured in `translator.paths` * The `Resources/translations/` directory of `Validation` component (if installed). * The `Resources/translations/` directory of `Form` component (if installed). * The `Resources/translations/` directory of Security Core component (if installed). Commits ------- 31d7a09 Add support for translator paths and twig paths in translation commands
I did not move the issue reference after splitting the PR so it should probably remain open waiting for #30120 |
…iles with trans() in translation commands (yceruto) This PR was merged into the 4.3-dev branch. Discussion ---------- [FrameworkBundle][Translation] Added support for PHP files with trans() in translation commands | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29085 | License | MIT | Doc PR | - This PR allows translation commands be able to debug and update translation messages from any PHP file/class defined as service, injecting or wiring the `translator` service, e.g.: ```php use Symfony\Component\Translation\TranslatorInterface; class ParallelUniverseController extends AbstractController { public function hello(Request $request, TranslatorInterface $translator) { // this id 'hello_message' will be extracted from translation:update $message = $translator->trans('hello_message'); // send message to space... } } ``` this supports all ways of wiring (auto or not): via constructor, public property, method calls, service subscriber and controller argument. Commits ------- 9f9b828 Added support for PHP files with translation in translation commands
Uh oh!
There was an error while loading. Please reload this page.
I am not sure if it is expected behaviour.
According to docs https://symfony.com/doc/current/translation/debug.html
I run command php bin/console debug:translation nl --domain=messages --only-unused
and got all unused translations, but, some of them used!
Example
But with global search I found that this translation is used
Why is shows state unused when it is used?
There area thousands of translations, because this command is not reliable I cant trust it, I have to check every translation manually if it is used...
There are a lot of cases with wrong state.
Strange but I found above unused states, that translations with unused state I removed, now has state missing, if I return them, they have both states, used and unused at the same time.
It happens not with all translations, some of them really unused, missing or used and has only one state.
Also, I am not sure if translations which used in twig counted, because found many with status used, but they are used in twig templates.
And some message when adding flash in controller is also missed, state unused.
The text was updated successfully, but these errors were encountered: