[Tracker]
Update Summary: New issue, backported from https://www.drupal.org/project/ai_translate
Short Description: one-click link should show human name, not machine name
Check-in Date: 03/19/2026
Metadata is used by the AI Tracker. Docs and additional fields here.
[/Tracker]

Problem/Motivation

The AI module works off of providers. Each provider defines models with both human name, and "machine name." The machine name usually avoids spaces and other "special" characters.

The problem: the "one click" link on the translate page uses the machine name, not the human name. This can be hard to read, and leads to a bad Editor Experience (EX).

screenshot

Steps to reproduce

  1. Configure multiple languages
  2. Enable the ai_translate module
  3. Enable at least one provider (with a long machine name)
  4. Create a node
  5. Click on the "Translate" tab
  6. Observe the machine name of the model (yikes)

Proposed resolution

Simple patch to ContentTranslationControllerOverride.php: switch this:

$parts1[1]

to this:

$parts1[0]

Maybe add a fallback in case the human name doesn't exist, isn't readable, &c.

Remaining tasks

Submit MR

User interface changes

One-click translate link: Change from ugly "machine name" to beautiful "human name"

API changes

None

Data model changes

None

Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)

AI usage (if applicable)

[ ] AI Assisted Issue
This issue was generated with AI assistance, but was reviewed and refined by the creator.

[x] AI Assisted Code
This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.

[ ] AI Generated Code
This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.

[ ] Vibe Coded
This code was generated by an AI and has only been functionally tested.

Issue fork ai-3580328

Command icon 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

koppie created an issue. See original summary.

koppie’s picture

Version: 2.0.x-dev » 1.3.x-dev

I've noticed that ai_translate was removed from the 2.x branch. Switching to 1.3.x, because it still needs adjustment there (as a backport).

koppie changed the visibility of the branch 3580328-backport-one-click-link to hidden.

koppie’s picture

Status: Active » Needs review
koppie’s picture

Status: Needs review » Needs work

I've updated the patch in #3580314: one-click link should show human name, not machine name; need to update here as well (or just remove, per 2.x)

koppie’s picture

Status: Needs work » Needs review

I experimented with different methods of fetching the "human readable" name out of the array, but ultimately it strikes me as a fool's errand. The underlying here is to make the link easy to read. In my opinion it is not necessary to display the specific model here, as it has already been selected and is not changeable here. It is sufficient to offer a one-click link that says "Translate with AI". That's what this patch does.

marcus_johansson’s picture

Assigned: koppie » Unassigned
Status: Needs review » Needs work

There are currently PHPCS errors on the MR. See https://git.drupalcode.org/issue/ai-3580328/-/jobs/9003782