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
- Create an entity with both translatable and non-translatable text fields.
- Submit the entity for translation using
tmgmt_laratranslate. - 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.
Issue fork tmgmt_laratranslate-3550137
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
Comment #2
robertoperuzzoComment #3
robertoperuzzoThe 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, andsummary. Onlyvalueand summary should be translated, notformat. I investigate it.Comment #4
robertoperuzzoI improved the translation process, allowing the developers to choose via YAML configuration to list which kind of fields to be excluded.
Comment #6
robertoperuzzoComment #8
robertoperuzzo