This project is no longer maintained and no further public releases are planned.

No further support will be given.

Feel free to fork the git repository.

Interceptor_TranslateFields

This interceptor will load a given translation. You can use values of form fields to dynamically load translations.

Version added

1.0.0

TypoScript path

plugin.Tx_Formhandler.settings.saveInterceptors.x copy to clipboard

Example code

initInterceptors {
	1.class = Interceptor_TranslateFields
	1.config {
		translateFields {
			newField {
				langKey = label_salutation_|
				field = salutation
			}
		}
	}
}

This example will load the translation for the selected salutation into the field “newField”.

Properties

.translateFields

Array containing translation options.

Scheme:
[newFieldname] {
  [options]
}

Data type

Array

Version added

1.0.0

.translateFields.[fieldname].langKey

Key in the translation file.
Use the “|” character to load the content of “field” into the langKey.

Data type

String | cObj

Version added

1.0.0

.translateFields.[fieldname].field

Name of a form field. The value of this field will replace the “|” in langKey.

Data type

String | cObj

Version added

1.0.0