Add support for paragraphs in translations

Created on 24 June 2024, 8 months ago

Problem/Motivation

Add support for paragraph translations, when you now click on translate node only the node fields are translated.

Steps to reproduce

Proposed resolution

  1. Adjust the translatecontroller to build a tree of the content to translate
  2. Json encode the content en send it to chatgpt for translation
  3. Add the nested paragraphs recursive to the node

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

2.1

Component

Code

Created by

🇧🇪Belgium wouter waeytens

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

Comments & Activities

  • Issue created by @wouter waeytens
  • 🇧🇪Belgium JonJacobs

    Needed this also, I've worked a little bit more on the previous patch, with the following changes:
    - For some situations where paragraphs were translated, all existing translations were overwritten, should now be fixed
    - Changed how the calls to chatgpt are made, instead of 1 big call (which resulted in a lot of tokens being used + keys being overwritten) the values are now being loaded separately
    - Kept all existing paragraph fields instead of only the translatable ones

    Probably needs some more refining and cleaning up.

  • Status changed to Needs work 8 months ago
  • 🇧🇪Belgium wouters_f Leuven

    ideally this issue (patch) also ends up in https://www.drupal.org/project/ai/issues/3457200 ai_translate submodule Needs work

  • I tried to add a batch to it. This way you can see a progress bar.
    Probably needs some more refining and cleaning up.

  • Fixes latest patch.

    This patch supports a batch.
    Also the input field for the api key needed to be longer. This patch also handels that issue.

  • 🇧🇪Belgium wouters_f Leuven

    It works in the ai module and I think most people will (and even should) switch to that one.
    Anup can help with the maintenance there, then we dont need to maintain duplicate modules (and the AI module has more functionalities).
    For me this may be closed (outdated).

Production build 0.71.5 2024