我正在翻译Typo3页面。
现在,我进入了我想翻译的联系表格。从Typo3 Documentation中,我发现我需要这样的东西:
contact.element.subject.properties.fluidAdditionalAttributes.placeholder
...作为我的locallang.xlf文件中的翻译ID。我已经通过TypoeScript链接了CustomFormSettings.yaml,在那里将转换路径设置为扩展名并创建了联系表格。
我实际上能够翻译例如提交按钮和其他按钮。但是我无法在联系表单中获取占位符以进行翻译,它们都退回到了联系表单中设置的值而不是翻译中。
我猜我在错误地处理了fluidAdditionalAttributes属性,但是我测试了除上述以外的许多其他组合。
我必须在翻译ID中键入的确切行是什么?
这是我完整的联系表:
renderingOptions:
submitButtonLabel: Submit
identifier: contact
label: Contact
type: Form
prototypeName: frameform
finishers:
-
options:
subject: 'Your message: {subject}'
recipientAddress: mail@mail.com
recipientName: 'Recipient Name'
senderAddress: '{email}'
senderName: '{name}'
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: true
translation:
language: ''
identifier: EmailToReceiver
-
options:
subject: 'We have received: {subject}'
recipientAddress: '{email}'
recipientName: '{name}'
senderAddress: mail@mail.com
senderName: 'Sender Name'
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: true
identifier: EmailToSender
-
options:
pageUid: '7'
additionalParameters: ''
identifier: Redirect
renderables:
-
renderingOptions:
previousButtonLabel: 'Previous step'
nextButtonLabel: 'Next step'
identifier: mainPage
type: Page
renderables:
-
defaultValue: ''
identifier: name
label: Name
type: Text
properties:
fluidAdditionalAttributes:
placeholder: Name
required: required
validators:
-
identifier: NotEmpty
-
defaultValue: ''
identifier: subject
label: Subject
type: Text
properties:
fluidAdditionalAttributes:
placeholder: Subject
required: required
validators:
-
identifier: NotEmpty
-
defaultValue: ''
identifier: email
label: Email
type: Text
properties:
fluidAdditionalAttributes:
placeholder: 'Email address'
required: required
validators:
-
identifier: NotEmpty
-
identifier: EmailAddress
-
defaultValue: ''
identifier: message
label: Message
type: Textarea
properties:
fluidAdditionalAttributes:
placeholder: Message
required: required
minlength: '10'
maxlength: '512'
validators:
-
identifier: NotEmpty
-
options:
minimum: '10'
maximum: '512'
identifier: StringLength
-
renderingOptions:
previousButtonLabel: 'Previous step'
nextButtonLabel: 'Next step'
identifier: summarypage
label: 'Summary page'
type: SummaryPage
答案 0 :(得分:1)
您可以在locallang.xlf中覆盖占位符,如下所示:element.<field-identifier>.properties.placeholder
示例:
<trans-unit id="element.firstname.properties.placeholder">
<source>Your first name</source>
<target>Ihr Vorname</target>
</trans-unit>