Improve translation integration

Created on 8 September 2025, about 1 month ago

Problem/Motivation

Currently, this module generates AI reference suggestions on any node form. When using translations, the node form is used for the source language and the translations. The edit form's node object is rendered and used for the AI suggestions. This can lead to erroneous suggestions when on a translation. This is compounded by the fact that the most common configuration for taxonomy reference fields is to configure them as not translatable. So when suggestions are generated on the translation, it updates the term references on the source language's revision.
This module should not be updating the term fields when on a translation when the fields are not translatable.

Steps to reproduce

  • Enable the "AI Auto-reference" module
  • Enable Content Translation
  • Configure a node type with a non-translatable taxonomy term reference field.
  • Create a node in the source language, for example English.
  • Edit the new node
  • Generate AI suggestions for the node's source language translation
  • Create a translation for the node, for example Spanish.
  • Edit the translation (for example Spanish)
  • Generate AI suggestions for the translation
  • Select some suggestions and Apply them
  • BUG: The source translation has been update since the term field is not translatable.

Proposed resolution

Options:

  1. (LOE: Easiest) Only provide the ability to generate AI suggestions for the default language translation (ie $node->isDefaultTranslation(). For non-default translations, there would not be an option to generate AI suggestions to avoid any confusion.
  2. (LOE: More Complex) Only provide the ability to generate AI suggestions when there are fields available for the node's language:
    • On the default language translation, all fields would be available so the AI suggestions generation would be allowed.
    • On a non-default language translation, only translatable fields would be available for suggestions. When there are no fields available, then the AI suggestions generation is not allowed.

Remaining tasks

  1. Decide on a solution
  2. Create PR for solution
  3. Update any documentation

User interface changes

Yes, depending on the solution chosen.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States recrit

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024