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


Override a translation on the Sonata Admin login screen

在Sonata管理员登录屏幕上,默认翻译是"身份验证",但我希望能够更改它。

'vendor'sonata-project'user-bundle'Resources'views'Admin'Security'login.html.twig里面有这样一行:

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

其翻译见'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>

我正在尝试弄清楚如何从我自己的捆绑包中更改它。Sonata文档中似乎没有涵盖这种情况,这非常好。

覆盖翻译不是特定于奏鸣曲,而是特定于Symfony。

请参阅symfony文档的"覆盖捆绑包的任何部分"部分:http://symfony.com/doc/current/cookbook/bundles/override.html#translations