简体   繁体   English

在Sonata管理员登录屏幕上覆盖翻译

[英]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. 在Sonata Admin登录屏幕上,默认翻译为“身份验证”,但我希望能够更改此设置。

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

<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: 可以在\\vendor\\sonata-project\\user-bundle\\Resources\\translations\\SonataUserBundle.en.xliff找到此\\vendor\\sonata-project\\user-bundle\\Resources\\translations\\SonataUserBundle.en.xliff ,即:

        <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. Sonata文档中似乎没有涉及这种情况,这非常好。

Overriding translations is not specific to Sonata, but to Symfony. 覆盖翻译不是特定于奏鸣曲,而是Symfony。

See the "Overriding any part of a bundle" section of the symfony doc : http://symfony.com/doc/current/cookbook/bundles/override.html#translations 请参见symfony文档的“覆盖捆绑包的任何部分”部分: http : //symfony.com/doc/current/cookbook/bundles/override.html#translations

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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