简体   繁体   中英

Sonata Admin local translation strategy for a list column

Is there an easy way to adjust a local translation strategy for a field added to a listMapper ? So the column header will be shown exactly how it's been written in a label attribute without any gaps.

BusinessUserAdmin.php

protected function configureListFields(ListMapper $listMapper)
{
    $listMapper
        ->add('company', null, [
            'label' => 'Company'
        ])
}

This is how it looks like now:

'label' => 'Company' 'label' => 'COmpany' 'label' => 'COMPANY'

公司 公司 公司

When you register your admin class as service and tag it with : sonata.admin , there is additional option label_translator_strategy="sonata.admin.label.strategy.underscore”

You can find more info here :

https://sonata-project.org/bundles/admin/master/doc/reference/translation.html

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