-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Add FlexForm field support #285
Comments
As we currently use the translation hook inside the DataHandler, it's not possible at the moment to allow translations of flexforms. |
Yes, referring to the following hook you are right: $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processTranslateToClass'] At this point I don't see a way either (except XCLASS). The condition in the DataHandler However, on closer inspection I found another hook that could be used here: $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkFlexFormValue'] with method name Within the method, the following condition could be used to check if it is one of the 4 actions of EXT:wv_deepltranslate. This is necessary because the hook is also executed on when creating new elements and when editing existing elements outside the translation process. $action = $GLOBALS['TYPO3_REQUEST']->getQueryParams() ? $GLOBALS['TYPO3_REQUEST']->getQueryParams()['action'] : '';
if(in_array($action, ['localizedeepl', 'localizedeeplauto', 'localizegoogle', 'localizegoogleauto'])){
/* ... Interpretation of FlexForms and translation of FlexForm fields is performed here ... */
} Is this an approach that could be taken further or have I overlooked an essential aspect? |
@ErHaWeb Okay, this should be a possible solution. For the moment, there is no idea to add features to version 3 anymore, but we will take it as feature to version 4. |
Great, glad to read that 👍 |
@calien666 |
@peterbenke We currently HAVE a version 4, which is available for TYPO3 v11 and v12. But, as we have a lot of hours spent here, web-vision decided to release version 4 as EAP: https://www.web-vision.de/en/automatic-translations-with-typo3-wv-deepltranslate-early-access-programme-launched.html |
@calien666 |
@peterbenke The flexform feature is not included yet, as we are looking for sponsors. For more information, feel free to contact @borishinzer (b.hinzer@web-vision.de) |
@calien666 Thank you |
@calien666 |
Is your feature request related to a problem? Please describe.
Currently it is not possible to translate fields defined in FlexForms. In some cases, translation-relevant information is also located there. This case can occur in the context of grid elements that use FlexForms or plugins that expect text input in the plugin options like Powermail.
Describe the solution you'd like
I would like to have the ability to configure which FlexForm field contents should be translated. This is currently only configurable at database table field level.
Describe alternatives you've considered
I have already tried setting
$GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['l10n_mode'] = 'prefixLangTitle';
to have the FlexForm translated as a whole. However, this configuration does not seem to have any effect on the resulting texts.As a plugin developer, the workaround is to migrate the FlexForm fields to database table fields to use the translation feature there as well.
Additional context
For example, I tried to translate the following flexform from English to German with the setting
$GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['l10n_mode'] = 'prefixLangTitle';
. As a result, there was no discrepancy in the translated content at all in your extension.In contrast, if I enter the same FlexForm directly in the DeepL app, both the content and the attributes are translated. The latter would affect the functionality and is a reason that the scope would really need to be on the content of the individual FlexForm fields to meet the requirement.
The text was updated successfully, but these errors were encountered: