简体   繁体   中英

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.

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).

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.

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:

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. Besides many improvements, you are able to have an uriSegment who is empty for default presets. In that way, you are able to have an german language content dimension without the 'de' in the url. Dmitri Pisarev did a great job on this: https://github.com/neos/neos-development-collection/pull/244

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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