【问题标题】:TYPO3: Form properties.fluidAdditionalAttributes.placeholder translationTYPO3:表单 properties.fluidAdditionalAttributes.placeholder 翻译
【发布时间】:2018-12-05 15:06:16
【问题描述】:

我正在翻译我的 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

【问题讨论】:

    标签: forms typo3 yaml contact-form


    【解决方案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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多