Skip to content

[Override] Translations: improve "caution" block #7362

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

Closed
alexislefebvre opened this issue Jan 14, 2017 · 2 comments
Closed

[Override] Translations: improve "caution" block #7362

alexislefebvre opened this issue Jan 14, 2017 · 2 comments
Labels
hasPR A Pull Request has already been submitted for this issue. Translation

Comments

@alexislefebvre
Copy link
Contributor

Here is the content of the caution block at the end of the How to Override any Part of a Bundle page:

The last translation file always wins. That means that you need to make sure that the bundle containing your translations is loaded after any bundle whose translations you're overriding. This is done in AppKernel.

Translation files are also not aware of bundle inheritance. If you want to override translations from the parent bundle, be sure that the parent bundle is loaded before the child bundle in the AppKernel class.

The file that always wins is the one that is placed in app/Resources/translations, as those files are always loaded last.

I think that the first 2 paragraphs are redundant, and that always wins is confusing since it's used twice.

I suggest to merge the first 2 paragraphs, explain what last translation is and find a better word than win (I find it confusing in this context).

And about the last paragraph, I'm not sure to understand its goal. I can think of 2 different scenarios:

  • If I work on an app and want to override a translation, then the documentation can recommend to put it in app/Resources/translations in order to ensure that these translations will override the other ones
  • If I work on a Bundle that I want to share, app/Resources/translations is off-topic
@alexislefebvre alexislefebvre changed the title [Override] Translations: Confusion "caution" block [Override] Translations: improve "caution" block Jan 14, 2017
@xabbuh
Copy link
Member

xabbuh commented Jan 17, 2017

@alexislefebvre That's indeed something that could be rewritten a bit. Would you like to submit a pull request?

@javiereguiluz
Copy link
Member

@alexislefebvre I agree. Let's reword it!

alexislefebvre added a commit to alexislefebvre/symfony-docs that referenced this issue Jan 19, 2017
@javiereguiluz javiereguiluz added the hasPR A Pull Request has already been submitted for this issue. label Jan 20, 2017
xabbuh added a commit that referenced this issue Feb 3, 2017
…alexislefebvre)

This PR was merged into the 2.7 branch.

Discussion
----------

See #7362 bundles/override > Rewrite translations block

Fixes #7362.

Commits
-------

f0acb9e See #7362 bundles/override > Rewrite translations block
xabbuh added a commit that referenced this issue Feb 3, 2017
* 2.7:
  [#7427] fix line length
  Add apcu cache driver to doctrine config reference
  Change type of arguments min and max
  [#7383] minor rewording
  Added a note about not using the ClassLoader component
  More clear description of factory service creation
  [#7376] minor wording improvement
  Added a tip about the expanded YAML syntax
  Added a minor help note about Request::setTrustedProxies
  Fix Apache 2.4 UDS instructions
  See #7362 bundles/override > Rewrite translations block
xabbuh added a commit that referenced this issue Feb 3, 2017
* 2.8:
  [#7427] fix line length
  Add apcu cache driver to doctrine config reference
  Change type of arguments min and max
  [#7383] minor rewording
  Added a note about not using the ClassLoader component
  Update guard_authentication.rst
  More clear description of factory service creation
  [#7376] minor wording improvement
  Added a tip about the expanded YAML syntax
  Added a minor help note about Request::setTrustedProxies
  Fix Apache 2.4 UDS instructions
  See #7362 bundles/override > Rewrite translations block
xabbuh added a commit that referenced this issue Feb 3, 2017
* 3.1:
  [#7427] fix line length
  Add apcu cache driver to doctrine config reference
  Change type of arguments min and max
  [#7383] minor rewording
  Added a note about not using the ClassLoader component
  Update guard_authentication.rst
  More clear description of factory service creation
  [#7376] minor wording improvement
  Added a tip about the expanded YAML syntax
  Added a minor help note about Request::setTrustedProxies
  Fix Apache 2.4 UDS instructions
  remove unused options parameter from loadManifest
  See #7362 bundles/override > Rewrite translations block
xabbuh added a commit that referenced this issue Feb 3, 2017
* 3.2:
  [#7427] fix line length
  Add apcu cache driver to doctrine config reference
  Change type of arguments min and max
  [#7383] minor rewording
  Added a note about not using the ClassLoader component
  Update guard_authentication.rst
  More clear description of factory service creation
  [#7376] minor wording improvement
  Added a tip about the expanded YAML syntax
  Added a minor help note about Request::setTrustedProxies
  Fix Apache 2.4 UDS instructions
  Fix doc for yaml parameters constants usage
  remove unused options parameter from loadManifest
  Tweaks based on feedback!
  Covering two missing adapters introduced in 3.2
  See #7362 bundles/override > Rewrite translations block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hasPR A Pull Request has already been submitted for this issue. Translation
Projects
None yet
Development

No branches or pull requests

3 participants