Skip to content
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

68 lines (47 sloc) 1.77 KB


This bundle integrates the prezent/doctrine-translatable extension in Symfony2.


This bundle requires Symfony 2.2+.


Step 1: Download using Composer

Tell Composer to install the bundle:

$ php composer.phar require prezent/doctrine-translatable-bundle

Step 2: Enable the bundle

Enable this bundle in your kernel

// app/AppKernel.php

public function registerBundles()
    $bundles = array(
        // ...
        new Prezent\Doctrine\TranslatableBundle\PrezentDoctrineTranslatableBundle(),

Step 3: Configuration

You can optionlly configure the fallback locale (default: en). The current locale is automatically set from the current Request. It defaults to the fallback_locale which you can configure in your config.yml.

    fallback_locale: en


Please refer to the doctrine-translatable documentation on how to use the translatable extension.

Integration with Forms and Sonata Admin

You can use the a2lix/TranslationFormBundle to integrate the translatable extension into your own forms and into your Sonata Admin backend. For this to work, you must add the following method to your translatable entities:

public static function getTranslationEntityClass()
    return 'Your\Translation\Class';

For more information, see the A2LiX TranslationForm documentation. Follow the examples for the KnpDoctrineExtensions and other indexBy strategies.

You can’t perform that action at this time.