---
title: "Feature: #97637 - Translate default value of form elements"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-97637-1772528713"
source: "Changelog/14.2/Feature-97637-TranslateDefaultValueOfFormElements.rst"
typo3-version: "14.2"
typo3-major: 14
type: "feature"
issue: 97637
forge: "https://forge.typo3.org/issues/97637"
tags: ["Frontend", "ext:form"]
rendered: "2026-09-23T15:30:34+00:00"
---

# Feature: #97637 - Translate default value of form elements {#feature-97637-1772528713}

See [forge#97637](https://forge.typo3.org/issues/97637)

## Description {#description}

The TYPO3 form framework now supports translating the
`defaultValue` property of form elements via XLF translation files.

Previously only properties such as `label`, `placeholder`, and
rendering options could be translated through the form framework's translation
mechanism. The `defaultValue` property was always rendered as-is from the
form definition, regardless of the current frontend language.

Now, `defaultValue` is translated before rendering using the
same XLF key conventions already established for other form element
properties. The translation is resolved in the following order, with the first
match winning:

1.  `<form-definition-identifier>.element.<element-identifier>.properties.defaultValue`
1.  `element.<element-identifier>.properties.defaultValue`
1.  `element.<element-type>.properties.defaultValue`

## Example {#example}

Given a form element defined as follows:

**fileadmin/form_definitions/contact.form.yaml**

```yaml
identifier: contact-form
type: Form
prototypeName: standard
renderables:
  - type: Page
    identifier: page-1
    renderables:
      - type: Text
        identifier: bestDish
        label: 'Best dish?'
        defaultValue: 'Hamburger'
        renderingOptions:
          translation:
            translationFiles:
              - 'EXT:my_extension/Resources/Private/Language/Form/locallang.xlf'
```

The translation file can now provide a translated default value:

**EXT:my_extension/Resources/Private/Language/Form/de.locallang.xlf**

```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
    <file source-language="en" target-language="de" datatype="plaintext" original="messages">
        <body>
            <trans-unit id="contact-form.element.bestDish.properties.defaultValue">
                <source>Hamburger</source>
                <target>Kartoffel</target>
            </trans-unit>
        </body>
    </file>
</xliff>
```

Or, to apply the translation to all `Text` elements across all forms:

**EXT:my_extension/Resources/Private/Language/Form/de.locallang.xlf**

```xml
<trans-unit id="element.Text.properties.defaultValue">
    <source>Hamburger</source>
    <target>Kartoffel</target>
</trans-unit>
```

## Impact {#impact}

Form integrators can now provide language-specific default values for form
elements. The translation is applied automatically before rendering using the
existing translation file configuration in
`renderingOptions.translation.translationFiles`.

Array-based `defaultValue` properties are intentionally excluded from
translation. These occur in multi-value elements such as
`MultiCheckbox` or `MultiSelect`, where the values are option keys
that must match the configured `properties.options` exactly.
Translating them would break the value-to-option mapping. The option labels
themselves can be translated via the existing
`properties.options.[*]` translation mechanism.
