[FrameworkBundle][Translation] Add support for Translator paths, Twig paths and Translator aware services paths in commands#29121
Conversation
nicolas-grekas
left a comment
There was a problem hiding this comment.
thanks for starting this :)
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/DependencyInjection/TranslatorPass.php
Outdated
Show resolved
Hide resolved
6077362 to
533d4d4
Compare
|
Update: Extracting translation messages from services (e.g. controllers and other PHP files) that have the translator injected into them by using the following service injection methods: (properties, bindings, construct arguments and method calls). BUT they're other methods that I can't reach (e.g. the service locator related to: services subscriber and controller service arguments) I need help to accomplish it, maybe @nicolas-grekas ? |
ceb615f to
46fc19b
Compare
…bug for --all option (yceruto) This PR was squashed before being merged into the 4.2-dev branch (closes #29128). Discussion ---------- [FrameworkBundle] Cleaning translation commands and fix a bug for --all option | Q | A | ------------- | --- | Branch? | master (4.2) | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29121 (comment) | License | MIT | Doc PR | - Commits ------- dfc7dcc Also fix a bug for --all option 3cbefd8 Cleaning translation commands
nicolas-grekas
left a comment
There was a problem hiding this comment.
we should maybe split the translator propagation in another pass.
I'd suggest to look at the HotPathPass also: we could looks at services that has the translation injected transitively. And that would give you a hint about following locators btw (HotPathPass doesn't follow them but here we would - see instanceof ArgumentInterface + its getValue method).
src/Symfony/Component/Translation/DependencyInjection/TranslatorPass.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/DependencyInjection/TranslatorPass.php
Outdated
Show resolved
Hide resolved
8004646 to
9fe9c2d
Compare
|
Status: Needs work |
5d56766 to
555a562
Compare
6a12280 to
e57b804
Compare
|
Yay! funcional tests passed! @nicolas-grekas this is ready on my side, how does it look for you? |
7b2afe6 to
b37ed12
Compare
|
Friendly ping. |
|
Maybe I should split this PR into two for an easier review? I mean, move the last point that contains a little more complexity:
|
|
@yceruto I think that could be helpful |
b37ed12 to
0383072
Compare
|
@xabbuh working on it, thanks for your reply. Status: Needs work |
598b3d4 to
31d7a09
Compare
|
Update: I've divided the complexity of this PR as I mentioned earlier, see the updated description. Status: Needs review |
|
Done #30120. |
|
Thank you @yceruto. |
…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
Add custom (also common) Twig and Translation paths to the translation commands:
twig.paths.translator.pathsResources/translations/directory ofValidationcomponent (if installed).Resources/translations/directory ofFormcomponent (if installed).Resources/translations/directory of Security Core component (if installed).