Skip to content

[Translations][Bundles] bundle overrides not taken into account #14942

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
drAlberT opened this issue Jun 11, 2015 · 11 comments
Closed

[Translations][Bundles] bundle overrides not taken into account #14942

drAlberT opened this issue Jun 11, 2015 · 11 comments

Comments

@drAlberT
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass?
Fixed tickets
License MIT
Doc PR

If one wants to override (for example) error pages he can override the TwigBundle Exceptions templates.
If we want to make these templates locale-aware we could put them into app/Resources/TwigBundle/translations/ and they will work .. but the translations system seems to have no way to extract or dump them ...

I think translations:[dump|update] should be overrides-aware and search for translations in every standard place a bundle could be overridden

Hope to have been clear in my explanation :)

@aitboudad
Copy link
Contributor

The translation doesn't take into the bundle hierarchy but the order of registering bundles in the kernel.
It's already reported in #3148 and we decided to explains this in the docs symfony/symfony-docs#5193

@drAlberT
Copy link
Contributor Author

Hi @aitboudad
maybe I'm not understanding, but I'm not talking of nested bundles ..

What should be the right way to override a bundle template still having the translation system work?

I think the error pages example can be idiomatic .. how has to be handled is IMHO not clear in the issues you linked .. but I'm pretty new to symfony2 so maybe I'm totally misunderstanding the entire problem

Thank you for your patience :)

@stof
Copy link
Member

stof commented Jun 11, 2015

@drAlberT overriding bundle templates does not change anything to the translation system. These are 2 independent systems.

@drAlberT
Copy link
Contributor Author

@stof I know .. maybe I'm not be clear in my explanation of the problem .. ;(

I want to achieve the following goal:

  • use custom error pages templates
  • have them localised
  • have app/console translation:* tasks able to extract, compare and so on strings from the custom error templates

AFAICS simply overriding TwigBundles templates I can't achieve my goal .. translations does not see them

Maybe I'm wrong in something basic .. but it should be a simple task

@drAlberT
Copy link
Contributor Author

I worked around the problem moving error pages templates in a custom bundle (say CustomErrorsBundle or whatever you want call), override the Exception controller and the findTemplates() method

(even here now everything works, but following the docs it was impossible to have it working :( )

This way I have a clean solution .. but the question became: is it the right approach? .. isn't it too tricky? it's not well documented IMHO ..

Thank you guys .. hope to have been clear now :D

@xabbuh
Copy link
Member

xabbuh commented Jun 12, 2015

@drAlberT What exactly did not work before? Providing translations for the messages or extract them from your templates?

@drAlberT
Copy link
Contributor Author

@xabbuh App/console translations:* do not see the templates

So, yes, I can't extract them from templates

Il giorno 12/giu/2015, alle ore 22:05, Christian Flothmann [email protected] ha scritto:

@drAlberT What exactly did not work before? Providing translations for the messages or extract them from your templates?


Reply to this email directly or view it on GitHub.

@drAlberT
Copy link
Contributor Author

@xabbuh any news?

@aitboudad
Copy link
Contributor

@drAlberT I look into it :)

@drAlberT
Copy link
Contributor Author

👍 :)

@aitboudad
Copy link
Contributor

fixed by #15038 and #15039.

fabpot added a commit that referenced this issue Jun 21, 2015
…es path. (aitboudad)

This PR was merged into the 2.6 branch.

Discussion
----------

[Translation][debug cmd] taken account into bundle overrides path.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Fixed tickets  | #14942 (partially)
| Tests pass?   | yes
| License       | MIT

Commits
-------

c3a077a [Translation][debug cmd] taken account into bundle overrides path.
fabpot added a commit that referenced this issue Jun 21, 2015
…des path. (aitboudad)

This PR was merged into the 2.3 branch.

Discussion
----------

[Translation][update cmd] taken account into bundle overrides path.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Fixed tickets  | #14942 (partially)
| Tests pass?   | yes
| License       | MIT

Commits
-------

a8f315b [Translation][update cmd] taken account into bundle overrides path.
@fabpot fabpot closed this as completed Jun 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants