web-vision / wv_deepltranslate

TYPO3 Extension to translate content and TCA records with DeepL Translate
GNU General Public License v2.0
25 stars 41 forks source link

[BUG] Translation of custom TCA fields does not work #320

Open SZChimp opened 8 months ago

SZChimp commented 8 months ago

Describe the bug When setting l10n_mode to prefixLangTitle can translating a custom fluid content element in the backend, the fields are not translated correctly, but contain the values of the source language.

To Reproduce

  1. Create a custom fluid content element (here: single-keyfact) with a custom TCA field (here: subheader) using this configuration:
    'subheader' => [
                'label' => $lll . 'text',
                'l10n_mode' => 'prefixLangTitle',
                'config' => [
                    'type' => 'input',
                    'max' => 100,
                    'size' => 100
                ],
            ],
  2. Create a content element with type of the fluid content element created in step 1.
  3. Enter a value in e.g. german to the field to be translated. Save the content element.
  4. In Page module, translate the content element using the "Translate" button, choose the deepl method and translate it.
  5. The translated record contains the source language value in its original state.

Expected behavior Using the translation button in the backend for custom content elements as well as inline relation elements inside those content elements should translate the field values correctly.

Screenshots Bildschirmfoto 2024-02-29 um 14 13 09

TYPO3 Setup

Additional context I also tried setting the l10n_mode using overrides with $GLOBALS['TCA']['tt_content']['types']['single-keyfact']['columnsOverrides']['subheader']['l10n_mode'] = 'prefixLangTitle'; or $GLOBALS['TCA']['tx_typo3szassets_domain_model_keyfact']['columns']['subheader']['l10n_mode'] = 'prefixLangTitle'; or $GLOBALS['TCA']['tt_content']['types']['single-keyfact']['columns']['subheader']['l10n_mode'] = 'prefixLangTitle';

SZChimp commented 8 months ago

Related to these issues, I think:

293 #184 #115

calien666 commented 8 months ago

Thank you for reporting. What definition is set inside

$GLOBALS['TCA']['tt_content']['columns']['subheader']['l10n_mode']

I'm not sure, if TYPO3 respects this setting, if overwritten in columnsOverrides.

SZChimp commented 8 months ago

Thank you for reporting. What definition is set inside

$GLOBALS['TCA']['tt_content']['columns']['subheader']['l10n_mode']

I'm not sure, if TYPO3 respects this setting, if overwritten in columnsOverrides.

It is set to prefixLangTitle in Configuration backend module.

SZChimp commented 8 months ago

Do you have an update on this issue?

Lagerregal42 commented 2 months ago

(+ 1) Same problem on several projects and elements :/ And #115 isn't working for those nested elements...

calien666 commented 2 months ago

Hi. Could you apply your TCA setup on the fields related to config loaded in backend?

Lagerregal42 commented 2 months ago

Hi, thx for the fast reply.

New field in tt_content:

'phases' => [
    'exclude' => 1,
    'label' => 'Phases',
    'config' => [
        'type' => 'inline',
        'foreign_table' => 'tx_XXX_domain_model_phases',
        'foreign_label' => 'title',
        'foreign_field' => 'parent',
        'appearance' => [
            'useSortable' => true,
            'collapseAll' => true,
            'expandSingle' => true,
            'showPossibleLocalizationRecords' => true,
        ],
        'maxitems' => 99,
    ],
],

and in tx_XXX_domain_model_phases.php:

'description' => [
    'label' => 'Description',
    'l10n_mode' => 'prefixLangTitle', // doesn't work with or without this line
    'config' => [
        'enableRichtext' => true,
        'eval' => 'required',
        'type' => 'text',
    ],
],

Setup:

I hope that helps :) If you are missing an information, just let me know.

calien666 commented 2 months ago

After talking to @NarkNiro the bug is known and we work on a fix.