简体   繁体   中英

Override a translation on the Sonata Admin login screen

On the Sonata Admin login screen the default translation is "Authentication", but i'd like to be able to change this.

Inside \\vendor\\sonata-project\\user-bundle\\Resources\\views\\Admin\\Security\\login.html.twig there is this line:

<div class="header">{{ 'title_user_authentication'|trans({}, 'SonataUserBundle') }}</div>

The translation for this is found in \\vendor\\sonata-project\\user-bundle\\Resources\\translations\\SonataUserBundle.en.xliff , ie:

        <trans-unit id="title_user_authentication">
            <source>title_user_authentication</source>
            <target>Authentication</target>
        </trans-unit>

I am trying to work out how I can change this from within my own bundles. This scenario doesn't appear to be covered in the Sonata documentation, which is very good.

Overriding translations is not specific to Sonata, but to Symfony.

See the "Overriding any part of a bundle" section of the symfony doc : http://symfony.com/doc/current/cookbook/bundles/override.html#translations

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