Translate/Internationalize your Doctrine entities with ease - Custom backend and Sonata compatible

To internationalize your Doctrine entities, you have basically 2 ways:

You can and should use both ways in the same application according to the need of the entity.

If for the first and simplest way, you don’t need a bundle, for the second way, you have differents potential. Ordered from the oldest to newest:

These 3 last solutions (and the incoming 2.4 version of GedmoDoctrineExtension) store data in database in the same way, so you can switch from one solution to another easily.

For manage edition of all locales at the same time, I published end of 2012, the A2lixTranslationFormBundle The last version is only compatible with these 3 last solutions again.

I published a simple demo on GitHub where you can test A2lixI18nDoctrineBundle or KnpDoctrineBehaviors independently with a custom backend but also with Sonata Admin, both use A2lixTranslationFormBundle. PrezentDoctrineTranslatableBundle is plan too.

You’ll note that Sonata work like a breeze with A2lixI18nDoctrineBundle, but some problems stay to fix with KnpDoctrineBehaviors about filtering the search in all locales by default and not the current locale. A basic locale switcher is include in the right top corner for Sonata.

This Demo include use a fork of SonataAdmin (PR 2262) and a fork of Sonata Exporter (PR 41), both to manage magic method __call. Hope theses PRs will be merged, otherwise, it can work but with a more verbose version of translatable entities…

Have a look at A2lixTranslationForm additional features for additional features too. I’ll see to complete the demo.

comments powered by Disqus