Project

General

Profile

Bug #87675

Updated by Björn Jacob over 2 years ago

I've got an installation with german and english localization. My forms are translated and presented in the correct language. Everything is fine except one point: The EmailToSender finisher. finischer. 

 It seems like  
 <pre><code class="php">{formvh:translateElementProperty(element: formValue.element, property: 'label')}</code></pre> which is used in the template file I specified in the templatePathAndFilename for the EmailToSender finisher is buggy.  

 The same line for EmailToReceiver finisher returns the correct translated label. But in EmailToSender finisher I get the english label no matter with which language I fill the form. 

 the typoscript settings 
 <pre> 
 config { 
     // Language Settings 
     linkVars := addToList(L(0-2)) 
     sys_language_uid = 0 
     sys_language_overlay = 1 
     sys_language_mode = content_fallback 
     language = de 
     locale_all = de_DE.UTF-8 
     htmlTag_langKey = de-DE 
     # for real url 
     defaultGetVars { 
         L = 0 
     } 

     sys_language_softMergeIfNotBlank = tt_content:image, pages:media 
 } 
 [globalVar = GP:L = 1] 
     config { 
         sys_language_uid = 1 
         language = en 
         locale_all = en_EN.UTF-8 
         htmlTag_langKey = en-GB 
     } 
 [global] 

 [globalVar = GP:L = 2] 
     config { 
         sys_language_uid = 4 
         language = fr 
         locale_all = fr_FR.UTF-8 
         htmlTag_langKey = fr-FR 
     } 
 [global] 
 </pre> 

 The localization files: 
 Forms.xlf 
 <pre><code class="xml"> 
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?> 
 <xliff version="1.0"> 
	 <file source-language="en" datatype="plaintext" original="messages" date="2018-12-03T20:38:10Z"> 
		 <header> 
			 <description>Formular Labels.</description> 
			 <generator>LFEditor</generator> 
		 </header> 
		 <body> 
			 <trans-unit id="element.f_firstName.properties.label"> 
				 <source><![CDATA[First name]]></source> 
			 </trans-unit> 
		 </body> 
	 </file> 
 </xliff> 
 </code></pre> 

 de.Forms.xlf 
 <pre><code class="xml"> 
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?> 
 <xliff version="1.0"> 
	 <file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2018-12-03T20:38:10Z"> 
		 <header> 
			 <description>Formular Labels.</description> 
			 <generator>LFEditor</generator> 
		 </header> 
		 <body> 
			 <trans-unit id="element.f_firstName.properties.label" approved="yes"> 
				 <source><![CDATA[First name]]></source> 
				 <target><![CDATA[Vorname]]></target> 
			 </trans-unit> 
		 </body> 
	 </file> 
 </xliff> 
 </code></pre> 


 The form definition: 
 <pre><code class="yaml"> 

 renderingOptions: 
   submitButtonLabel: 'Anfrage absenden ...' 
 type: Form 
 identifier: ...Konfigurator 
 label: '...Konfigurator' 
 prototypeName: ...KonfiguratorBase 
 finishers: 
   - 
     options: 
       ... 
       templatePathAndFilename: '.../Customer.html' 
     identifier: EmailToSender 
   - 
     options: 
       ... 
       templatePathAndFilename: '.../Company.html' 
     identifier: EmailToReceiver 
   - 
 renderables: 
   - 
     renderingOptions: 
       previousButtonLabel: 'Previous step' 
       nextButtonLabel: 'Neue Seite' 
     type: Page 
     identifier: page-1 
     label: '' 
     renderables: 
       - 
         defaultValue: '' 
         type: Text 
         identifier: f_firstName 
         label: Vornamen!!!123 
         properties: 
           fluidAdditionalAttributes: 
             required: required 
           elementDescription: given-name 
         validators: 
           - 
             identifier: NotEmpty 

 </code></pre> 

 the Template file: company.html and customer.html are identical: 
 <pre><code class="html"> 
 {namespace formvh=TYPO3\CMS\Form\ViewHelpers} 
 {namespace v=FluidTYPO3\Vhs\ViewHelpers} 
 <html xmlns:f="https://xsd.helhum.io/ns/typo3/cms-fluid/master/ViewHelpers" 
	   xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" 
	   xmlns:formvh="http://typo3.org/ns/TYPO3/CMS/Form/ViewHelpers" data-namespace-typo3-fluid="true"> 
 <head> 
	 <title></title> 
	 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
	 <meta name="format-detection" content="telephone=no"> 
 </head> 
 <body> 
	 <table width="600" cellpadding="0" cellspacing="0" border="0"> 
		 <tr> 
			 <td colspan="2" width="1200" align="left"> 
				 <f:render section="replacePlaceholders" arguments="{form:form, uid:'EmailIntro'}"/> <br/> 
			 </td> 
		 </tr> 
		 <formvh:renderAllFormValues renderable="{form.formDefinition}" as="formValue"> 
			 <tr> 
				 <td width="600" valign="top" align="left">{formvh:translateElementProperty(element: formValue.element, property: 'label')}</td> 
				 <td width="600" valign="top" align="left"> 
					 <f:if condition="{formValue.value}"> 
						 <f:then> 
							 <f:if condition="{formValue.isMultiValue}"> 
								 <f:then> 
									 <table cellspacing="0" border="0"> 
										 <f:for each="{formValue.processedValue}" as="value"> 
											 <tr> 
												 <td>{value}</td> 
											 </tr> 
										 </f:for> 
									 </table> 
								 </f:then> 
								 <f:else> 
									 <table cellspacing="0" border="0"> 
										 <tr> 
											 <td><f:format.nl2br>{formValue.processedValue}</f:format.nl2br></td> 
										 </tr> 
									 </table> 
								 </f:else> 
							 </f:if> 
						 </f:then> 
						 <f:else> 
							 - 
						 </f:else> 
					 </f:if> 
				 </td> 
			 </tr> 
		 </formvh:renderAllFormValues> 
		 <tr> 
			 <td colspan="2" width="1200" align="left"> <br/> 
				 <f:render section="replacePlaceholders" arguments="{form:form, uid:'EmailOutro'}"/> 
			 </td> 
		 </tr> 
	 </table> 
 </body> 

 <f:section name="replacePlaceholders"> 
	 <v:variable.set name="messageUid" value="{v:variable.typoscript(path: 'plugin.tx_form.settings.UIDs.{form.identifier}.{uid}')}"/> 
	 <v:variable.set name="message" value="{v:content.render(contentUids:{0:messageUid})}"/> 

	 <formvh:renderAllFormValues renderable="{form.formDefinition}" as="formValue"> 
		 <v:variable.set name="message"> 
			 <v:format.replace content="{message}" 
							   substring="[{formValue.element.identifier}]" 
							   replacement="{formValue.processedValue}"/> 
		 </v:variable.set> 
	 </formvh:renderAllFormValues> 
	 <f:format.raw>{message}</f:format.raw> 
 </f:section> 
 </html> 
 </code></pre> 

 *Summary:* 

 All contents and translation in EmailToReceiver is correct in both languages. EmailToSender form labels are always english. Everything else is correct. 

 Is there a configuration error?

Back