Skip to content

Feat[Experiment]: Add AI-Powered Content Translation - #747

Merged
dkotter merged 36 commits into
WordPress:developfrom
yogeshbhutkar:add/ai-translation
Jul 28, 2026
Merged

Feat[Experiment]: Add AI-Powered Content Translation#747
dkotter merged 36 commits into
WordPress:developfrom
yogeshbhutkar:add/ai-translation

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What, Why, and How?

Closes #187

This PR adds a new Content Translation experiment that lets users translate post content directly from the editor. It introduces a backend ability, ai/content-translation, to achieve this.

The feature is needed so editors can generate translations without leaving the post editing flow. It supports common target languages, gates access through the experiment settings, checks provider support for text generation, validates the selected language, and requires the user to have edit permissions for the post being translated.

Future explorations:

  • Add a dedicated action for translating the post title independently.
  • Add per-block translation controls through the Content Resize toolbar.
  • Extend the support to multiple content blocks.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Test suggestions and frequent AI-assisted code reviews.

Testing Instructions

  1. Enable the Content Translation experiment in Settings > AI.
  2. Confirm that an AI Connector with text generation support is configured.
  3. Create or open a post that contains translatable paragraph or heading content.
  4. In the post sidebar, click Generate Translation, choose a target language, and start the translation.
  5. Verify that the translated content is applied to the expected blocks.

Screencast

screencast.mov

Changelog Entry

Added - New Experiment: Content Translation; translates Paragraph and Heading blocks—and optionally the post title—into a selected language directly from the post editor

Open WordPress Playground Preview

@yogeshbhutkar
yogeshbhutkar marked this pull request as ready for review June 22, 2026 10:23
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.78846% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.43%. Comparing base (94d22f8) to head (7a65b29).

Files with missing lines Patch % Lines
...lities/Content_Translation/Content_Translation.php 90.90% 10 Missing ⚠️
...iments/Content_Translation/Content_Translation.php 91.30% 4 Missing ⚠️
...ilities/Content_Translation/system-instruction.php 87.50% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #747      +/-   ##
=============================================
+ Coverage      80.18%   80.43%   +0.25%     
- Complexity      2526     2565      +39     
=============================================
  Files            106      110       +4     
  Lines          10240    10448     +208     
=============================================
+ Hits            8211     8404     +193     
- Misses          2029     2044      +15     
Flag Coverage Δ
unit 80.43% <92.78%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jeffpaul jeffpaul added this to the 1.2.0 milestone Jun 26, 2026
@yogeshbhutkar
yogeshbhutkar requested a review from a team July 6, 2026 06:41
@jeffpaul

Copy link
Copy Markdown
Member

@yogeshbhutkar looks like a merge conflict to resolve to help keep this moving along

@jeffpaul jeffpaul mentioned this pull request Jul 13, 2026
28 tasks
@yogeshbhutkar
yogeshbhutkar requested a review from jeffpaul as a code owner July 14, 2026 03:42
@yogeshbhutkar

Copy link
Copy Markdown
Contributor Author

Thank you, @jeffpaul. I've resolved the merge conflicts. This PR is ready for a test.

@dkotter dkotter modified the milestones: 1.2.0, 1.3.0 Jul 14, 2026

@dkotter dkotter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in review here. Overall this looks really good and tested well. Have left a few comments but let me know if there's any questions.

Comment thread includes/Experiments/Content_Translation/Content_Translation.php Outdated
Comment thread src/experiments/content-translation/constants.ts
Comment thread includes/Experiments/Content_Translation/Languages.php
Comment thread src/experiments/content-translation/constants.ts Outdated
Comment thread includes/Experiments/Experiments.php Outdated
Comment thread src/experiments/content-translation/utils/index.ts Outdated
@yogeshbhutkar

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @dkotter. I’ve implemented the suggested changes. When you have a moment, please take another look at the PR.

@yogeshbhutkar
yogeshbhutkar requested a review from dkotter July 28, 2026 06:40
@dkotter
dkotter merged commit a1ba294 into WordPress:develop Jul 28, 2026
24 checks passed
@yogeshbhutkar
yogeshbhutkar deleted the add/ai-translation branch July 29, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multilingual rewriting and translation via AI

3 participants