0

我制作了一个修改现有 RML 报告的模块。它只是修改 RML 文件(没有 Python 更改)。

我安装了模块,之后,我就可以打印我的新报告了。但是,当我想导出.pot文件进行翻译时,它是空的。我不知道为什么,但最后我不得不手动完成翻译文件。

现在这些术语被翻译得很好,除了一个。下一句:

<para style="terp_default_8">[[ (o.comment and format(o.comment)) or "Please, indicate the invoice number on the concept of income" ]]</para>

我将它添加到我的翻译文件 ( es.po ) 中,与其他正在使用的术语完全相同:

#. module: customized_reports_03
#: report:account.invoice.custom:0
msgid "Please, indicate the invoice number on the concept of income"
msgstr "Por favor, indique el número de factura en el concepto del ingreso"

我加载了翻译并更新了几次,但这句话没有被翻译。

为什么?可能是因为运营商还是

4

1 回答 1

1

最后,我意识到翻译文件无法识别您在 [[ ]] 之间编写的字符串。为了解决这个问题,您必须找到通过将字符串放在双括号之外的代码来实现相同行为的方法。

就我而言,问题是这样解决的:

<para style="terp_default_8">[[ (o.comment and format(o.comment)) or removeParentNode('para') ]]</para>
<para style="terp_default_8">Please, indicate the invoice number on the concept of income[[ not o.comment and '.' or removeParentNode('para') ]]</para>
于 2015-02-06T08:31:22.897 回答