Problem/Motivation

Currently, tmgmt_laratranslate does not consistently restrict translations to fields explicitly
marked as translatable. This may lead to non-translatable fields being sent for translation,
which is unnecessary and can cause confusion or redundant processing.

The expected behaviour is that only entity fields flagged as translatable are extracted and translated.
Markup is already correctly preserved and does not require changes.

Steps to reproduce

  1. Create an entity with both translatable and non-translatable text fields.
  2. Submit the entity for translation using tmgmt_laratranslate.
  3. Observe that fields not marked as translatable may still be included in the translation job.

Proposed resolution

  • Update the extraction logic to include only fields explicitly marked as translatable.
  • Exclude non-translatable fields from the translation workflow.
  • Add tests to ensure non-translatable fields are never sent for translation.

Remaining tasks

  • Identify how translatability is currently determined for entity fields.
  • Adjust field extraction to filter out non-translatable fields.
  • Add automated tests for entities with mixed translatable/non-translatable fields.
  • Update module documentation accordingly.

User interface changes

No changes expected in the user interface.
Administrators and translators will see no difference, but non-translatable fields will no longer
appear in translation jobs.

API changes

  • No public API changes expected.
  • Internal changes limited to field extraction logic.

Data model changes

No changes to the data model.
The update affects only the translation workflow logic.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

robertoperuzzo created an issue. See original summary.

robertoperuzzo’s picture

Assigned: Unassigned » robertoperuzzo
robertoperuzzo’s picture

The filtering is ALREADY implemented at the field level! The issue description mentions "fields not marked as translatable may still be included," but the code shows proper field-level filtering.

The issue is likely NOT at the field level (which is already properly filtered), but at the property level within translatable fields. For example:

A translatable field, such as body, might have multiple properties: value, format, and summary. Only value and summary should be translated, not format. I investigate it.

robertoperuzzo’s picture

I improved the translation process, allowing the developers to choose via YAML configuration to list which kind of fields to be excluded.

robertoperuzzo’s picture

Assigned: robertoperuzzo » Unassigned
Status: Active » Needs review

  • robertoperuzzo committed d0d1b511 on 1.0.x
    [#3550137] feat: Restrict translations to translatable entity fields
    
robertoperuzzo’s picture

Status: Needs review » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.