如果没有TYPO3 Slack中的 manuel-selbach 的帮助,则无法获得此答案.I'm new to TYPO3 and starting out with 8.7 LTS. I have created several forms with the default "form" extension. My site requires some of these forms to be translated into up to 5 other languages. So far the only solution I've found is to copy the forms and then have a separate form for each translation, but this does not seem like the best solution, as long term it would lead to form divergence.Is it possible to add alternate translations directly in the YAML file or point to a translation file that should be used? 解决方案 Here an example, like I use on a page:For frontend translation add this to your typoscript setup:plugin.tx_form { settings { yamlConfigurations { 100 = EXT:my_site_package/Configuration/Yaml/CustomFormSetup.yaml } }}"my_site_package" has to be an existing and activated TYPO3 extensionthen make an yaml file under my_site_package/Configuration/Yaml/CustomFormSetup.yaml TYPO3: CMS: Form: prototypes: standard: formElementsDefinition: Form: renderingOptions: translation: translationFile: # default translation files for the frontend 10: 'EXT:form/Resources/Private/Language/locallang.xlf' 20: 'EXT:my_site_package/Resources/Private/Language/locallang.xlf'and have some translation files in my_site_package/Resources/Private/Languagedefault (en): my_site_package/Resources/Private/Language/locallang.xlf<?xml version="1.0" encoding="UTF-8"?><xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff"> <file source-language="en" datatype="plaintext" original="messages" product-name="tamods"> <header/> <body> <trans-unit id="ticketbestellung.element.objekt.properties.label" xml:space="preserve"> <source>Object</source> </trans-unit> </body> </file></xliff>german (de): my_site_package/Resources/Private/Language/de.locallang.xlf<?xml version="1.0" encoding="UTF-8"?><xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff"> <file source-language="en" target-language="de" datatype="plaintext" original="messages" product-name="tamods"> <header/> <body> <trans-unit id="ticketbestellung.element.objekt.properties.label" xml:space="preserve"> <target>Objekt</target> </trans-unit> </body> </file></xliff>german (fr): my_site_package/Resources/Private/Language/fr.locallang.xlf<?xml version="1.0" encoding="UTF-8"?><xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff"> <file source-language="en" target-language="fr" datatype="plaintext" original="messages" product-name="tamods"> <header/> <body> <trans-unit id="ticketbestellung.element.objekt.properties.label" xml:space="preserve"> <target>Objet</target> </trans-unit> </body> </file></xliff>this is yaml from the form I am using:renderingOptions: submitButtonLabel: Sendentype: Formidentifier: ticketbestellunglabel: TicketbestellungprototypeName: standardrenderables: - renderingOptions: previousButtonLabel: 'previous Step' nextButtonLabel: 'next Step' type: Page identifier: page-1 label: Page renderables: - defaultValue: '' type: Text identifier: objekt label: Objekt properties: fluidAdditionalAttributes: placeholder: Objekt required: required validators: - identifier: NotEmptySome translation key, which are hard to find:for Submit Buttonelement.Form.renderingOptions.submitButtonLabelelement.ticketbestellung.renderingOptions.submitButtonLabelfor Subject in E-Mail finisherfinisher.Email.subject (workaround, working also before Version 8.7.5)finisher.EmailToReceiver.subject (should be the solution was buggy till Version 8.7.5)This answer would be not possible without the help from manuel-selbach in the TYPO3 Slack. 这篇关于您如何在TYPO3 CMS 8.7 LTS中翻译EXT:Form表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-23 14:56