Skip to content

Commit

Permalink
[BUGFIX] Make custom DataHandler command in select boxes work
Browse files Browse the repository at this point in the history
In commit 0d4bc00 a custom DataHandler command was introduced for DeepL translations. This bugfix updates the "Translate with DeepL" select boxes in page module and list module to create translation records of pages.
  • Loading branch information
koehnlein authored and Albrecht Köhnlein committed Feb 6, 2025
1 parent 9ed35e9 commit fad1e76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Classes/Form/TranslationDropdownGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ public function buildTranslateDropdownOptions(
$redirectUrl = DeeplBackendUtility::buildBackendRoute('record_edit', $parameters);
$params = [];
$params['redirect'] = $redirectUrl;
$params['cmd']['pages'][$id]['localize'] = $languageUid;
$params['cmd']['localization']['custom']['mode'] = 'deepl';
//$params['cmd']['pages'][$id]['localize'] = $languageUid;
//$params['cmd']['localization']['custom']['mode'] = 'deepl';
$params['cmd']['pages'][$id]['deepltranslate'] = $languageUid;
$targetUrl = DeeplBackendUtility::buildBackendRoute('tce_db', $params);
$output .= '<option value="' . htmlspecialchars($targetUrl) . '">' . htmlspecialchars($languageTitle) . '</option>';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<select class="form-select" name="createNewLanguage" data-global-event="change" data-action-navigate="$value">
<option><f:translate key="backend.label" extensionName="deepltranslate_core" /></option>
<f:for each="{deeplLanguages}" as="languageName" key="url">
<option value="{url}">{languageName}</option>
<option value="{url -> f:replace(search: '%5Blocalize%5D=', replace: '%5Bdeepltranslate%5D=')}">{languageName}</option>
</f:for>
</select>
</div>
Expand Down

0 comments on commit fad1e76

Please sign in to comment.