[FEATURE] EXT:form - support translation arguments
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / master / Feature-81363-AcceptFormElementTranslationArguments.rst
1 .. include:: ../../Includes.txt
2
3 =======================================================================
4 Feature: #81363 - EXT:form - support form element translation arguments
5 =======================================================================
6
7 See :issue:`81363`
8
9 Description
10 ===========
11
12 Passing arguments to form element property translations is now supported to enrich
13 translations with variable values:
14
15 .. code-block:: yaml
16
17 renderables:
18 fieldWithTranslationArguments:
19 identifier: field-with-translation-arguments
20 type: Checkbox
21 label: This is a %s feature
22 renderingOptions:
23 translation:
24 translationFile: path/to/locallang.xlf
25 arguments:
26 label:
27 - useful
28
29 Alternatively, translation arguments can be set via :typoscript:`formDefinitionOverrides`
30 in TypoScript:
31
32 .. code-block: typoscript
33
34 plugin.tx_form {
35 settings {
36 formDefinitionOverrides {
37 <form-id> {
38 renderables {
39 0 { # Page
40 renderables {
41 fieldWithTranslationArguments {
42 renderingOptions {
43 translation {
44 arguments {
45 label {
46 0 = TEXT
47 0.typolink {
48 parameter = 42
49 returnLast = url
50 }
51 }
52 }
53 }
54 }
55 }
56 }
57 }
58 }
59 }
60 }
61 }
62 }
63
64 .. important::
65 There must be at least one translation file with a translation for the configured form element property. Arguments are not inserted into default values defined in a form definition.
66
67 The same goes for finisher options:
68
69 .. code-block:: yaml
70
71
72 finishers:
73 finisherWithTranslationArguments:
74 identifier: EmailToReceiver
75 options:
76 subject: My %s subject
77 recipientAddress: foo@example.org
78 senderAddress: bar@example.org
79 translation:
80 translationFile: path/to/locallang.xlf
81 arguments:
82 subject:
83 - awesome
84
85
86 Impact
87 ======
88
89 Form element property translations and finisher option translations can now use placeholders
90 to output translation arguments.
91
92 .. index:: Frontend, TypoScript, NotScanned