简体   繁体   中英

A2LiX Translation Form labels options

I'm using KnpLabs/DoctrineBehaviors/Translatable and A2LiX Translation Form to translate my entities in a Symfony application. It works very well. However, when the form is rendered there is a "translations" title that I would like to delete and a "EN [Default]" text on a tab that I would like to change.

In the examples of the doc, there's a "medias" example so I imagine that we can change this text. Moreover, the tabs don't have this [Default] text. So I imagine that's possible to change them.

在此处输入图片说明

And this is mine:

在此处输入图片说明

Does anybody know how to do it? If we take a look on the form type options we don't see anything concerning the "Translations" label. For the "Default", I can't see where I should search for it.

Default template file is located at vendor/a2lix/translation-form-bundle/A2lix/TranslationFormBundle/Resources/views/default.html.twig . If you want you can specify your own template and set it in config.yml file, like this:

a2lix_translation_form:
    ....
    templating: "@SLCore/includes/translation.html.twig"

More information can be found here .

For the "translations" title, I was able to override it adding a label to the form type just like a normal field. However, it is not possible to use a blank value. I had to use ' ' in order to override the text.

->add('translations', 'a2lix_translations', array(
            'label' => ' ', --> this overrides the translations title
            'fields'    => array(
                'name'   => array(
                    'field_type' => 'text',
                    'label' => 'blabla'
                ),
                'description'   => array(
                    'field_type' => 'textarea',
                    'label' => 'bleble',
                )
            )
        ))

For the "Default" label, I still have no solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM