Add Glossary Support for Consistent Term Translation in Custom Translation Prompts

Created on 11 November 2024, 3 days ago

Problem/Motivation

I'm looking for a way to create a glossary of words to include in the prompt during page translation. Currently, I’m using this module to translate content with a custom, detailed prompt of around 1000 tokens, which yields great results. However, I’ve found the need for a consistent glossary—a custom list of words that should remain consistently translated across languages.
Right now, we’re handling this manually by adding new terms to a specific section of the translation prompt. This approach, however, has two main issues:

This method doesn’t work if the prompt needs to be used for more than one language.
Only administrators can update the prompt, which limits content editors from ensuring consistent translations of certain [technical] terms.

Proposed Resolution

I’m considering leveraging Drupal taxonomy vocabularies to address this. A custom module could list all relevant terms and add them to the prompt through a hook or a similar method. Any thoughts? Is there perhaps an existing solution that could accomplish this?

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇧🇷Brazil raprieto

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

Comments & Activities

  • Issue created by @raprieto
  • 🇬🇧United Kingdom scott_euser

    I think you can probably use this one https://www.drupal.org/project/ai_tmgmt/issues/3481001 Fallback to ai_translate configuration Active but you'll also need the patch in AI Core module. Then I guess as you CRUD your taxonomy you could programmatically update those prompts from AI Core.

    If that helps let us know and you can mark as fixed.

Production build 0.71.5 2024