You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem:
If extract the translation messages separately (by bundles) i end up with a duplicated person.name.empty, one at each bundle.
So, executing:
translation:extract en -b AcmeGeneralBundleBundle
translation:extract en -b AcmeCompanyBundleBundle
If i extract all the messages at one pass (not by bundle, translation:extract en --dir=./src/ --output-dir=./app/Resources/translations) it will not duplicate, but all the messages will end up in the same place, but this is a horrible mess.
It's important remember that Symfony (as of 2.1.3) resolves the hierarchy and if i delete the duplicated entry at Acme\CompanyBundle it will get the correct message from Acme\GeneralBundle.
The text was updated successfully, but these errors were encountered:
As i was using translations in other parts of my project, i stumbled in another related problem, this time on Templates.
After some reading i learned that there is no "hierarchy resolution" for the translations, it is simple a matter that the translations are read on the order of the bundle declaration on the AppKernel.php, in case of duplicates, the last string translation is used.
So, i'm thinking on a solution.
Create a new parameter on the extract (or update) action to indicate that in case of an already present key from the same domain name (considering all other bundles) it should not be "outputed" to the current bundle, it should only add a <jms:reference-file> to the current existing declaration. The parameter could be named --prevent-override...
But for this to work i think there should be a new way of extracting the translations. Currently there is a global translation and output to a single folder, or a "per-bundle" basis. The new one must specify only a root directory (where the bundles are) then translate all of them outputting them to the respective translation folder.
The action must load the AppKernel (i believe this happens on the actual "global" way) so the order is respected.
Sorry for not being able to help you guys with this, it has been some years that i'm not working with Web technologies in general, so I'm not using Symfony for some years.
Anyway, nice to see activity on this very useful bundle! Best regards for the team!
This is the scenario: I have a base class and and extending class to define an Person -> Employee using the Mapped Superclasse strategy (http://docs.doctrine-project.org/en/2.0.x/reference/inheritance-mapping.html#mapped-superclasses).
An example code:
The problem:
If extract the translation messages separately (by bundles) i end up with a duplicated
person.name.empty
, one at each bundle.So, executing:
Will generate:
If i extract all the messages at one pass (not by bundle,
translation:extract en --dir=./src/ --output-dir=./app/Resources/translations
) it will not duplicate, but all the messages will end up in the same place, but this is a horrible mess.It's important remember that Symfony (as of 2.1.3) resolves the hierarchy and if i delete the duplicated entry at
Acme\CompanyBundle
it will get the correct message fromAcme\GeneralBundle
.The text was updated successfully, but these errors were encountered: