简体   繁体   English

在不使用内容尺寸的情况下,在Typo3 Neos 1.2中转换表单错误消息

[英]Translate form error messages in Typo3 Neos 1.2 without using content dimensions

I am currently trying to implement a contact form in Neos 1.2.5, but the error messages don't get translated. 我目前正在尝试在Neos 1.2.5中实现联系表单,但错误消息不会得到翻译。

With activated content dimensions the translation of the error messages just worked fine. 使用激活的内容尺寸,错误消息的翻译就可以正常工作。 but we had to remove the content dimensions due to German being the only site language (and the unwanted url suffix /de, which seemed to be unremovable with activated content dimensions). 但由于德语是唯一的网站语言,因此我们不得不删除了内容尺寸(以及不必要的url后缀/ de,这对于激活的内容尺寸似乎无法删除)。

I now added the translationPackage option to my form and copied over the translation files to my site package (into /Resources/Private/Translations/de/ValidationErrors.xlf and /Resources/Private/Translations/en/ValidationErrors.xlf), but it doesn't seem to use any of my translations even when I copy the German translation into the /en folder. 现在,我在表单中添加了TranslationPackage选项,并将翻译文件复制到我的网站包中(复制到/Resources/Private/Translations/de/ValidationErrors.xlf和/Resources/Private/Translations/en/ValidationErrors.xlf),但是即使将德语翻译复制到/ en文件夹,我似乎也没有使用任何翻译。

TYPO3:
  Form:
    yamlPersistenceManager:
      savePath: 'resource://vendor.package/Private/Form/'
    presets:
      default:
        title: 'Default'
        formElementTypes:
          'TYPO3.Form:Base':
             renderingOptions:
               translationPackage: 'vendor.package'

I also added the defaultlocale to my sitewide settings.yaml: 我还将defaultlocale添加到了我的站点范围settings.yaml中:

TYPO3:
  Flow:
    i18n:
      defaultLocale: 'de'

but still no effect. 但仍然没有效果。 how do I translate my form error messages to German without using content dimensions? 如何在不使用内容尺寸的情况下将表单错误消息翻译为德语?

I would update to Neos 2.1. 我将更新为Neos 2.1。 Besides many improvements, you are able to have an uriSegment who is empty for default presets. 除了许多改进之外,您还可以拥有一个uriSegment,它对于默认预设为空。 In that way, you are able to have an german language content dimension without the 'de' in the url. 这样,您就可以拥有德语内容的维度,而url中没有'de'。 Dmitri Pisarev did a great job on this: https://github.com/neos/neos-development-collection/pull/244 Dmitri Pisarev在此方面做得很出色: https//github.com/neos/neos-development-collection/pull/244

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM