Update translation cropping

Created on 9 October 2024, 2 months ago

Problem/Motivation

As per https://www.drupal.org/project/ai/issues/3479027#comment-15806901 📌 Make sure that text in AI Translate is smaller then allowed size Active comment #11 and #12, trimming the text can be a surprise/go unnoticed by the user.

Steps to reproduce

Get AI to respond with text that is longer than max length

Proposed resolution

For a follow-up should we have it immediately make a tiny follow-up attempt. Like

"The following text between the ____ seperator is longer than the character limit of ___:
-------
Text here
-------
- Keep the same tone of voice
- Keep the same meaning
- Ensure the text is maximum ___ characters
- Respond only with the shortened text without any additional words or niceties"

Then if that still fails, then fall back to truncate from this MR? Can be part of the translate settings form as a default.

Just thinking many users might miss truncated text particularly in a language they are not comfortable with. So doing this action under cover may easily go unnoticed and not get fixed.

and then when we get to the fallback if still failing:

display a message when the trimming happens so at least the user knows that the result might not be complete? Or both?

So two tasks:

  1. Retry attempt (setting to control whether to do this + control of retry prompt)
  2. Fallback to truncate use drupal messenger to send warning

Remaining tasks

MR

User interface changes

N/A

API changes

N/A

Data model changes

N/A

📌 Task
Status

Active

Version

1.0

Component

Other Submodules

Created by

🇬🇧United Kingdom scott_euser

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

Comments & Activities

Production build 0.71.5 2024