Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Update translation commands to work with default paths#25065
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| <argumenttype="service"id="translation.reader" /> | ||
| <argumenttype="service"id="translation.extractor" /> | ||
| <argument>%translator.default_path%</argument> | ||
| <argumenton-invalid="null">%twig.default_path%</argument> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
on-invalid="null" strategy over container parameter is not supported or (surely) I'm missing something? Should I do it intoFrameworkExtension then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
yes, it should be done in the DI extension then
3a76018 to7f292a3Comparenicolas-grekas commentedNov 22, 2017
@yceruto do you think you'll be able to have this PR ready before 4.0.0? Would be awesome :) |
yceruto commentedNov 22, 2017
Sure, today! :) |
060141b to7661cd6Compare7661cd6 todc72866Compareyceruto commentedNov 22, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Tests added and all green! Also I've tested this PR in a real project and work like a charm ;) These are all paths where translations and templates are debugged and dumped: Root paths:
Bundle paths:
Ready for reviews! |
chalasr left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
With minor comments
| * @param TranslationReaderInterface $reader | ||
| * @param ExtractorInterface $extractor | ||
| * @param string $defaultTransPath | ||
| * @param string $defaultViewsPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
string|null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I've removed the block as it does not help in any way.
| * @param ExtractorInterface $extractor | ||
| * @param string $defaultLocale | ||
| * @param string $defaultTransPath | ||
| * @param string $defaultViewsPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
string|null
fabpot commentedNov 23, 2017
Thank you@yceruto. |
… default paths (yceruto)This PR was merged into the 3.4 branch.Discussion----------[FrameworkBundle] Update translation commands to work with default paths| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#25062| License | MIT| Doc PR |symfony/symfony-docs#8634This should make translation commands (debug & update) work with `translator.default_path` and `twig.default_path` directories (introduced here in 3.4) and their overridden paths if available.Would be great to include also the custom paths mapping by the user, either `translator.paths` as `twig.paths`, but I'm not sure about the right way and probably it should be implemented on another branch.TODO- [x] Add some tests.Commits-------dc72866 Update translation commands to work with default paths
Uh oh!
There was an error while loading.Please reload this page.
This should make translation commands (debug & update) work with
translator.default_pathandtwig.default_pathdirectories (introduced here in 3.4) and their overridden paths if available.Would be great to include also the custom paths mapping by the user, either
translator.pathsastwig.paths, but I'm not sure about the right way and probably it should be implemented on another branch.TODO