[FrameworkBundle] Add default translations path option and convention#24860
Merged
fabpot merged 1 commit intosymfony:3.4from Nov 11, 2017
Merged
[FrameworkBundle] Add default translations path option and convention#24860fabpot merged 1 commit intosymfony:3.4from
fabpot merged 1 commit intosymfony:3.4from
Conversation
8000
Member
Author
|
Having this in 3.4/4.0 could be awesome but I guess it doesn't qualify, right? |
Member
Author
|
Any opinion on this? I'd like to finish it :) |
Member
|
It does qualify. LGTM. |
Member
|
Wouldn't it be "better" to move them to |
dee7d07 to
01dbc55
Compare
01dbc55 to
1a8b1b4
Compare
Member
Author
|
Great! ready :) |
Member
|
Thank you @yceruto. |
fabpot
added a commit
that referenced
this pull request
Nov 11, 2017
… and convention (yceruto)
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] Add default translations path option and convention
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | ToDo
Similar to Twig default path, this proposal adds a `default_path` option under `translator` config:
```yaml
framework:
translator:
default_path: '%kernel.project_dir%/config/translations'
```
adding this default path to the discovered translations dirs. Thus, overriding bundle translations is possible by using this new convention: `config/translations/<BundleName>/messages.en.xlf`.
Also a new container parameter `%translator.default_path%` is defined by external purpose (similar to #24840)
Note: The current convention `%kernel.root_dir%/Resources/translations` path has priority over the new one.
TODO:
- [x] Add more tests about the new path
- [x] Update changelog
Commits
-------
1a8b1b4 Add default translations path option and convention
Contributor
|
Do we want to reflect this change in the existing translation recipe or create a new one for 3.4 (so we can even remove the |
Member
|
@ogizanagi Let's update the current recipe to point to the "right" directory. Can you submit a PR? |
Contributor
|
Sure. Done in symfony/recipes#249 |
This was referenced Nov 12, 2017
Merged
Merged
This was referenced Nov 13, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Similar to Twig default path, this proposal adds a
default_pathoption undertranslatorconfig:adding this default path to the discovered translations dirs. Thus, overriding bundle translations is possible by using this new convention:
config/translations/<BundleName>/messages.en.xlf.Also a new container parameter
%translator.default_path%is defined by external purpose (similar to #24840)Note: The current convention
%kernel.root_dir%/Resources/translationspath has priority over the new one.TODO: