0

I'm new to Symfony and Sonata. After following the instructions i installed Translatable, but i dont get any Tab in the form.

enter image description here

Composer.json

    "stof/doctrine-extensions-bundle": "1.1.x-dev",
    "a2lix/translation-form-bundle": "2.x-dev"

config.yml

    # Doctrine Configuration
doctrine:
    dbal:
        driver:   "%database_driver%"
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8
        # if using pdo_sqlite as your database driver, add the path in parameters.yml
        # e.g. database_path: "%kernel.root_dir%/data/data.db3"
        # path:     "%database_path%"

    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        auto_mapping: true

        mappings:
            gedmo_translatable:
                type: annotation
                prefix: Gedmo\Translatable\Entity
                dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity"
                alias: GedmoTranslatable # this one is optional and will default to the name set for the mapping
                is_bundle: false


    stof_doctrine_extensions:
        default_locale: "%locale%"
        orm:
          default:
              translatable: true

a2lix_translation_form:
    locales: [es, pr]       # [1]
    default_required: true      # [2]
    manager_registry: doctrine      # [3]
    templating: "A2lixTranslationFormBundle::default.html.twig"      # [4]

Sonata AdminClass

/**
 * @param FormMapper $formMapper
 */
protected function configureFormFields(FormMapper $formMapper)
{
    $formMapper
        ->add('descripcion')
        ->add('unidadMedida')
        ->add('translations', 'a2lix_translations')
    ;
}
Miguel Galante
  • 1,689
  • 1
  • 14
  • 13

1 Answers1

1

I had so much trouble trying to use those 2 bundles that I switched to using only a2lix bundles and it worked like a charm for me... This is what I am using now (sf 2.4)

    "a2lix/i18n-doctrine-bundle": "dev-master",
    "a2lix/translation-form-bundle": "2.*@dev",
Geert Wille
  • 1,656
  • 13
  • 18
  • I have exactly the same problem - cant get Tabs. I have dev-master at i18n-doctrine-bundle and 1.*@dev at translation-form-bundle but stil doesn't work. Any suggestions? – repincln Mar 10 '14 at 20:57
  • If you use "a2lix/i18n-doctrine-bundle": "dev-master", the best is to use the latest "a2lix/translation-form-bundle": "2.*@dev". About tabs, you should check if you have well load assets a2lix_translation_bootstrap.js and the dedicated one for tabs from bootstrap (http://getbootstrap.com/javascript/#tabs) – webda2l Mar 26 '14 at 11:12
  • In case we would make use of `a2lix/i18n-doctrine-bundle`, what to do with the current database values? And, in case I want just one table with all translations, then the Gedmo strategy is the only option? – Rvanlaak May 20 '14 at 09:57