我正在使用表单扩展,这是我yaml文件的一部分:
-
renderingOptions:
previousButtonLabel: 'Go Back'
nextButtonLabel: 'Send Message'
type: SummaryPage
identifier: summarypage-1
label: Summary
在 xlf 文件中,我可以像这样访问按钮:
<trans-unit id="BasicContactForm.element.page-1.renderingOptions.nextButtonLabel" xml:space="preserve">
<source>Send Message</source>
</trans-unit>
<trans-unit id="BasicContactForm.element.summarypage-1.renderingOptions.previousButtonLabel" xml:space="preserve">
<source>Go Back</source>
</trans-unit>
<trans-unit id="element.BasicContactForm.renderingOptions.submitButtonLabel" xml:space="preserve">
<source>Send Message</source>
</trans-unit>
但是,如何访问摘要页面的标签(标题(呢?这似乎不起作用:
<trans-unit id="element.BasicContactForm.summarypage-1.label" xml:space="preserve">
<source>Summary1</source>
</trans-unit>
既不是:
<trans-unit id="BasicContactForm.element.summarypage-1.label" xml:space="preserve">
<source>Summary1</source>
</trans-unit>
您可以像翻译表单字段标签一样翻译(摘要(页面的标签。
在您的情况下,可以使用以下转换键:
<!-- All elements of type 'SummaryPage' -->
<trans-unit id="element.SummaryPage.properties.label">
<source>Summary</source>
</trans-unit>
<!-- All elements with the identifier 'summarypage-1' -->
<trans-unit id="element.summarypage-1.properties.label">
<source>Summary</source>
</trans-unit>
<!-- The single element with the identifier 'summarypage-1' inside the form 'BasicContactForm' -->
<trans-unit id="BasicContactForm.element.summarypage-1.properties.label">
<source>Summary</source>
</trans-unit>
我写了一个关于TYPO3表单翻译的综合教程,其中包含许多解释和示例,您可以在此处找到:https://www.sebkln.de/en/tutorials/detail/translating-forms-in-the-typo3-form-framework/