Validation results not in default langauge

I have a german website where the (only) language is set to ‘de’. I would have expected that the form validation results are output in german as the translations are available in Packages/Framework/TYPO3.Flow/Resources/Private/Translations/de/ValidationErrors.xlf.
But this is not the case. E.g. the NotEmptyValidator still outputs “This property is required.” instead of “Diese Eigenschaft ist erforderlich”. What might be the reason?

How did you set the language?

Hi @sorenmalling, in the following the settings (reduced to the language settings):

Neos:
  Neos:
    userInterface:
      defaultLanguage: 'de'
  ContentRepository:
    contentDimensions:
      language:
        default: de
        defaultPreset: de
        presets:
          de:
            ...

Hi Thomas,

which version of Neos are you using?
Looks old from the path you describe.

Depending on how you render your forms you might need to configure the locale. One option is via the settings:

Neos:
	Flow:
		i18n:
			defaultLocale: de
			fallbackRule:
				order: ['en']

Hi Sebastian, the system was on 5.2 branch. I just updatet to 5.3. and still have the same behaviour.

The project code is derived from the demo project and changed/enhanced by the individual needs mostly looked up in the documentation or forum.

So the general form implementation is like the contact form of the demo project. That means the forms are defined in yaml in …/Resources/Private/Form. And like in the demo project there is the a field template in …/Resources/Private/Templates/ContactForm.
I had to define a new preset (Neos:From:presets) with parentPreset “default”.

The configuration you provided doesn’t work in my project. If I copy/paste it to the settings.yaml it results in the error:
**Fatal error** : Uncaught Symfony\Component\Yaml\Exception\ParseException: A YAML file cannot contain tabs as indentation at line

If I change the indentation to Spaces then it results in the error:
Fatal error: Uncaught Symfony\Component\Yaml\Exception\ParseException: A colon cannot be used in an unquoted mapping value...

If I then leave out the fallbackRule no error occurs but also no german translation.

Do you have any further hints?

Did you see Translating Forms — Flow Form Framework 5.0 documentation? Maybe that helps

Double check your syntax, YAML is whitespace sensitive. This should work:

Neos:
  Flow:
    i18n:
      defaultLocale: de
      fallbackRule:
        order: ['en']

No, I unfortunately didn’t find this doc. Thanks for that! By specifying translationPackage: ‘Neos-Flow’ the translations are used. What I find strange is that in the mentioned documentation there is also the following sentence:
The translation of validation error messages uses the Neos.Flow package by default, to avoid having to copy the validation errors message catalog to all packages used for form translation.

So why aren’t the translations of Neos.Flow used in my project without specifying the Neos.Flow package expicitely when this shall be the default behaviour? Or do I misunderstand the meaning?

That I don’t know. Would you be willing to create an issue at Issues · neos/form · GitHub ?

Ok, I will do so.

1 Like