Skip to content

Content Translation: Disable title translation when the post title is too short - #967

Merged
dkotter merged 2 commits into
WordPress:developfrom
yogeshbhutkar:content-translation/gate-title-translation
Aug 24, 2026
Merged

dkotter merged 2 commits into
WordPress:developfrom
yogeshbhutkar:content-translation/gate-title-translation

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

What, Why, and How?

Previously, users could enable title translation even when the post title was empty or shorter than the required minimum length. The title would then be skipped during translation, with the reason shown only after the operation completed. This made the outcome feel delayed/unexpected.

This PR validates the title before translation begins. When the title does not meet the minimum-length requirement (or is empty), the modal displays an informational notice and disables the Also translate the title toggle beforehand. This sets expectations upfront while still allowing eligible post content to be translated. This should help improve the user-experience while using the content translation feature.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.6 Sol
Used for: Code review of the implementation.

Testing Instructions

  1. Enable the Content Translation experiment.
  2. Create or edit a post with sufficient content and an empty or short title.
  3. Open the translation modal and verify that an informational notice appears.
  4. Verify that Also translate the title is disabled.
  5. Close the modal and lengthen the title to meet the minimum requirement.
  6. Reopen the modal and verify that the notice is absent and Also translate the title is enabled.
  7. Start the translation and verify that both the title and eligible post content are translated.

Screenshot

image

Changelog Entry

Changed - Show a notice and disable title translation when the post title is too short.

Open WordPress Playground Preview

@codecov

codecov Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.42%. Comparing base (48f831a) to head (289468f).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #967   +/-   ##
==========================================
  Coverage      74.42%   74.42%           
  Complexity      3116     3116           
==========================================
  Files            132      132           
  Lines          12179    12179           
==========================================
  Hits            9064     9064           
  Misses          3115     3115           
Flag Coverage Δ
unit 74.42% <ø> (ø)

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.

@yogeshbhutkar yogeshbhutkar changed the title Content Translation: Show a notice and disable title translation when the post title is too short Content Translation: Disable title translation when the post title is too short Aug 24, 2026
@yogeshbhutkar
yogeshbhutkar marked this pull request as ready for review August 24, 2026 07:13
@yogeshbhutkar
yogeshbhutkar requested a review from a team August 24, 2026 07:13
@github-actions

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>

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

@dkotter dkotter added this to the 1.4.0 milestone Aug 24, 2026
@dkotter
dkotter merged commit 441dcbb into WordPress:develop Aug 24, 2026
31 of 32 checks passed
@yogeshbhutkar
yogeshbhutkar deleted the content-translation/gate-title-translation branch August 24, 2026 16:20
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.

2 participants