简体   繁体   English

更改 Products 的 i18n_domain。五个注册页面

[英]Change i18n_domain for Products.Five registered pages

It seems that one template from Products.Five (manage_interfaces) has a bad i18n markup, making interfaces name translatable. Products.Five (manage_interfaces) 中的一个模板似乎有一个错误的 i18n 标记,使得接口名称可翻译。 i18n domain is not defined, therefore the global one is used. i18n 域未定义,因此使用全局域。

I want to change the i18n domain for that page, but I don't know how to do that from my packages.我想更改该页面的 i18n 域,但我不知道如何从我的包中执行此操作。 The page is registered using browser:page Five directive页面注册使用 browser:page 五条指令

<browser:page
    for="*"
    name="manage_interfaces"
    template="manage_interfaces.pt"
    class="Products.Five.utilities.browser.marker.EditView"
    permission="zope2.ManageProperties"
    />

I triedhttp://www.mesimian.com/zope-changing-i18n-domain-for-any-view/ but that doesn't work.我尝试了 http://www.mesimian.com/zope-changing-i18n-domain-for-any-view/但这不起作用。

First of all, file a bug report;首先,提交错误报告; the upstream developers would probably like to know about this.上游开发人员可能想知道这一点。

Use z3c.jbot to override the template in your own package. Create a templates subdirectory, register it and put a file named Products.Five.utilities.browser.manage_interfaces.pt in that subdirectory.使用z3c.jbot覆盖你自己的模板 package。创建一个templates子目录,注册它并在该子目录中放置一个名为Products.Five.utilities.browser.manage_interfaces.pt的文件。 That file will be used to replace the original template.该文件将用于替换原始模板。

Registration of the directory with z3c.jbot is simple, read the instructions on the PyPI page.使用z3c.jbot注册目录很简单,请阅读 PyPI 页面上的说明。

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

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