Skip to content
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

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

Open
SZChimp opened this issue Feb 29, 2024 · 8 comments
Open

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

SZChimp opened this issue Feb 29, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@SZChimp
Copy link
Contributor

SZChimp commented Feb 29, 2024

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
                ],
            ],
  1. Create a content element with type of the fluid content element created in step 1.
  2. Enter a value in e.g. german to the field to be translated. Save the content element.
  3. In Page module, translate the content element using the "Translate" button, choose the deepl method and translate it.
  4. 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

  • TYPO3 Version=11.5.36
  • Server=Apache
  • Database type and version=MySQL 10.4.32-MariaDB-1:10.4.32+maria~ubu2004-log
  • PHP version=8.0.30
  • DeepL Pro (paid) API
  • composer 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 SZChimp added the bug Something isn't working label Feb 29, 2024
@SZChimp
Copy link
Contributor Author

SZChimp commented Feb 29, 2024

Related to these issues, I think:
#293 #184 #115

@calien666
Copy link
Member

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
Copy link
Contributor Author

SZChimp commented Feb 29, 2024

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
Copy link
Contributor Author

SZChimp commented Mar 14, 2024

Do you have an update on this issue?

@Lagerregal42
Copy link

Lagerregal42 commented Aug 26, 2024

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

@calien666
Copy link
Member

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

@Lagerregal42
Copy link

Lagerregal42 commented Aug 26, 2024

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:

  • TYPO3 Version=11.5.39
  • Server=nginx/1.26.2
  • Database=MySQL 8.0.39
  • PHP version=8.1.29
  • DeepL Free API
  • composer setup

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

@calien666
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants