Skip to content

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

Closed
@alexislefebvre

Description

@alexislefebvre

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    TranslationhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions