Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:3.4fromyceruto:translation_commands
Nov 23, 2017

Conversation

@yceruto
Copy link
Member

@ycerutoyceruto commentedNov 21, 2017
edited
Loading

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#25062
LicenseMIT
Doc PRsymfony/symfony-docs#8634

This should make translation commands (debug & update) work withtranslator.default_path andtwig.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, eithertranslator.paths astwig.paths, but I'm not sure about the right way and probably it should be implemented on another branch.

TODO

  • Add some tests.

apetitpa reacted with thumbs up emoji
<argumenttype="service"id="translation.reader" />
<argumenttype="service"id="translation.extractor" />
<argument>%translator.default_path%</argument>
<argumenton-invalid="null">%twig.default_path%</argument>
Copy link
MemberAuthor

@ycerutoycerutoNov 21, 2017
edited
Loading

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?

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

@nicolas-grekasnicolas-grekas added this to the3.4 milestoneNov 21, 2017
@nicolas-grekas
Copy link
Member

@yceruto do you think you'll be able to have this PR ready before 4.0.0? Would be awesome :)

@yceruto
Copy link
MemberAuthor

Sure, today! :)

nicolas-grekas, chalasr, and apetitpa reacted with thumbs up emoji

@yceruto
Copy link
MemberAuthor

yceruto commentedNov 22, 2017
edited
Loading

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:

  • %kernel.root_dir%/Resources/translations/
  • %kernel.root_dir%/Resources/views/
  • %translator.default_path%/
  • %twig.default_path%/

Bundle paths:

  • <BundlePath>/Resources/translations/
  • <BundlePath>/Resources/views/
  • %kernel.root_dir%/Resources/<Bundle>/translations/
  • %kernel.root_dir%/Resources/<Bundle>/views/
  • %translator.default_path%/<Bundle>/
  • %twig.default_path%/<Bundle>/

Ready for reviews!

Copy link
Member

@chalasrchalasr left a 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

string|null

Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

string|null

@fabpot
Copy link
Member

Thank you@yceruto.

@fabpotfabpot merged commitdc72866 intosymfony:3.4Nov 23, 2017
fabpot added a commit that referenced this pull requestNov 23, 2017
… 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
@ycerutoyceruto deleted the translation_commands branchNovember 23, 2017 15:53
This was referencedNov 24, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

5 participants

@yceruto@nicolas-grekas@fabpot@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp