Shopware 6 App |如何翻译自定义字段



我们构建了一个应用程序,想要一个Shopware 6自定义字段的代码片段/翻译(https://developer.shopware.com/docs/guides/plugins/apps/custom-data/custom-fields)

是否可以为每个类别添加翻译文本?

<custom-fields>
<custom-field-set>
<name>minds_show_category_discount</name>
<label>Show Discount</label>
<label lang="de-DE">Rabatt anzeigen</label>
<related-entities>
<category />
</related-entities>
<fields>
<bool name="minds_scd_category_enabled">
<label>Show discount</label>
<label lang="de-DE">Rabatt anzeigen</label>
<position>1</position>
</bool>
<!-- Here I would like to input a text that is translatable -->
</fields>
</custom-field-set>
</custom-fields>

自定义字段中没有纯文本元素可使用。顾名思义,这些元素是不同输入、下拉框、复选框等的类型。如果你想在这些UI元素中添加描述性文本,你可以使用help-text属性,它也是可翻译的。

<label>Lorem</label>
<label lang="de-DE">Ipsum</label>
<help-text>Lorem</help-text>
<help-text lang="de-DE">Ipsum</help-text>

标签和帮助文本等的所有翻译在所有类别中都是相同的,如果这是你的意思,则不能在每个类别的级别上有所不同。

最新更新