Plone:从灵活性xml模型中提取i18n字符串



我正在处理灵巧的xml模型,并正在寻找从我的模型中提取i18n字符串的方法。它看起来不像i18ndude或infrase.i18nextract这样做。因此,我的xml模型中的所有翻译字符串都不会显示在生成的.pot文件中。

有些模型有30多个字段,因此手动提取变得乏味。

i18ndude可以从模型文件中提取i18n消息,而不会出现任何问题;请检查您是否包含域并标记要提取的字符串。

查看我们的i18n脚本,并检查比较,例如,collection.cover的模型与您的模型:

<?xml version="1.0" ?>
<model xmlns="http://namespaces.plone.org/supermodel/schema"
       xmlns:form="http://namespaces.plone.org/supermodel/form"
       xmlns:i18n="http://xml.zope.org/namespaces/i18n"
       i18n:domain="collective.cover">
    <schema>
        <field name="template_layout" type="zope.schema.Choice"                   form:widget="collective.cover.widgets.selectpreview.SelectFieldWidget"
               form:omitted="z3c.form.interfaces.IEditForm:true">
            <description i18n:translate=""
              >Choose one of the predefined layouts</description>
            <title i18n:translate="">Layout</title>
            <vocabulary>collective.cover.AvailableLayouts</vocabulary>
            <default>Empty layout</default>
        </field>
        <field name="cover_layout" type="zope.schema.Text"
               form:omitted="z3c.form.interfaces.IForm:true
                             z3c.form.interfaces.IAddForm:true
                             z3c.form.interfaces.IEditForm:true">
            <description i18n:translate=""
              >The layout to be used to render groups and tiles</description>
            <title i18n:translate="">Cover Layout</title>
        </field>
    </schema>
</model>

最新更新