Here an example, like I use on a page:
For frontend translation add this to your typoscript setup:
plugin.tx_form {
settings {
yamlConfigurations {
100 = EXT:my_site_package/Configuration/Yaml/CustomFormSetup.yaml
}
}
}
"my_site_package" has to be an existing and activated TYPO3 extension
then make an yaml file under my_site_package/Configuration/Yaml/CustomFormSetup.yaml
TYPO3:
CMS:
Form:
prototypes:
standard:
formElementsDefinition:
Form:
renderingOptions:
translation:
translationFile:
# default translation files for the frontend
10: 'EXT:form/Resources/Private/Language/locallang.xlf'
20: 'EXT:my_site_package/Resources/Private/Language/locallang.xlf'
and have some translation files in my_site_package/Resources/Private/Language
default (en): my_site_package/Resources/Private/Language/locallang.xlf
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file source-language="en" datatype="plaintext" original="messages" product-name="tamods">
<header/>
<body>
<trans-unit id="ticketbestellung.element.objekt.properties.label" xml:space="preserve">
<source>Object</source>
</trans-unit>
</body>
</file>
</xliff>
german (de): my_site_package/Resources/Private/Language/de.locallang.xlf
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file source-language="en" target-language="de" datatype="plaintext" original="messages" product-name="tamods">
<header/>
<body>
<trans-unit id="ticketbestellung.element.objekt.properties.label" xml:space="preserve">
<target>Objekt</target>
</trans-unit>
</body>
</file>
</xliff>
german (fr): my_site_package/Resources/Private/Language/fr.locallang.xlf
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file source-language="en" target-language="fr" datatype="plaintext" original="messages" product-name="tamods">
<header/>
<body>
<trans-unit id="ticketbestellung.element.objekt.properties.label" xml:space="preserve">
<target>Objet</target>
</trans-unit>
</body>
</file>
</xliff>
this is yaml from the form I am using:
renderingOptions:
submitButtonLabel: Senden
type: Form
identifier: ticketbestellung
label: Ticketbestellung
prototypeName: standard
renderables:
-
renderingOptions:
previousButtonLabel: 'previous Step'
nextButtonLabel: 'next Step'
type: Page
identifier: page-1
label: Page
renderables:
-
defaultValue: ''
type: Text
identifier: objekt
label: Objekt
properties:
fluidAdditionalAttributes:
placeholder: Objekt
required: required
validators:
-
identifier: NotEmpty
Some translation key, which are hard to find:
for Submit Button
element.Form.renderingOptions.submitButtonLabel
element.ticketbestellung.renderingOptions.submitButtonLabel
for Subject in E-Mail finisher
finisher.Email.subject
(workaround, working also before Version 8.7.5)
finisher.EmailToReceiver.subject
(should be the solution was buggy till Version 8.7.5)
This answer would be not possible without the help from manuel-selbach in the TYPO3 Slack.