Lis*_*ann 6 translation bundle admin symfony sonata-admin
我试图翻译Sonata Admin Bundle Breadcrumbs和Tablename List标题.到目前为止没有任何作用:-(
我将自己的翻译文件放在/ app/Resources/translations和我自己的bundle的翻译文件夹中.我试着把它们放在SonataAdminBundle.de.yml和messages.de.yml中.我还在Admin类中设置了翻译域.但我仍然看不到自己的翻译.唯一使用的翻译文件是SonataAdminBundle中的文件.
谁能告诉我如何正确处理SonataAdminBundle的翻译?哪些文件必须放在这些文件的内容和内容中?
提前致谢.
丽莎
小智 4
嗯,我就是这样做的:
在我的 XYBundle 中,我在 XYBundle/Ressources/translations 中创建了一个 XYBundle.fr.xliff 文件(确保它是翻译而不是翻译。对我来说,T 不起作用)至少有一个翻译:
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="" >
<body>
<trans-unit id="breadcrumb.link_article_list">
<source>breadcrumb.link_article_list</source>
<target>Liste des articles</target>
</trans-unit>
</body>
</file>
</xliff>
Run Code Online (Sandbox Code Playgroud)
在您的服务声明中:
<call method="setTranslationDomain">
<argument>"XYBundle"</argument>
</call>
Run Code Online (Sandbox Code Playgroud)
并且不要忘记清除缓存 php app/console 缓存:clear
| 归档时间: |
|
| 查看次数: |
6249 次 |
| 最近记录: |