Issue Bug Closed

#83387sysExt:form does not fully support arguments

Simon Kerber 12/19/17, 12:07 updated 03/16/18, 00:41

Description

$this->processTranslationChain($translationKeyChain, $language) should always take arguments.

Reproduce the bug:

Programmatically change the translation of an element (e.g. a label)

$page->setRenderingOption('translation', [
  'translationFile'=>'LLL:EXT:my_extension/Resources/Private/Language/forms.xlf',
  'arguments'=>['label'=>['LOREM']]
  ]);

Add translation in forms.xlf with %s
Example:

<trans-unit id="element.page-1.properties.label" approved="yes">
   <source>My Argument : %s</source>
</trans-unit>

Expected Result:
“My Argument : LOREM”

Actual result:
“My Argument : %s”

How to make the argument appear:

public function translateFormElementValue(RootRenderableInterface $element, array $propertyParts, FormRuntime $formRuntime) {
...
$this->processTranslationChain($translationKeyChain, $language, ['my Arguments Here'])
...
}

And the documentation is very misleading.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.