Skip to content

Fix i18n gaps in WP-CLI messages and the Quick Create button title#669

Open
miyanialkesh7 wants to merge 1 commit into
lloc:masterfrom
miyanialkesh7:i18n-fixes
Open

Fix i18n gaps in WP-CLI messages and the Quick Create button title#669
miyanialkesh7 wants to merge 1 commit into
lloc:masterfrom
miyanialkesh7:i18n-fixes

Conversation

@miyanialkesh7

Copy link
Copy Markdown

Summary

  • Wraps the wp msls blog command's success/error messages in esc_html__() so they can be translated, instead of hardcoded English.
  • Fixes the Quick Create button's title swap on translated sites: the button previously carried only its "Create..." title, and the JavaScript derived the "Edit..." title by regex-replacing the English word "Create", which silently breaks once that word is translated. Both the create and edit titles are now rendered server-side (the edit title as a new data-edit-title attribute), and the JS reads the localized edit title directly instead of doing English-text surgery on it.

Context

Split out of #668 to keep scope focused, per maintainer feedback. Unrelated to the security/PHPCS changes in that PR.

Test plan

  • Run wp msls blog <id> with a valid and an invalid locale on a site with a non-English locale active, confirm messages are translated
  • On a translated site, use Quick Create to create a translation, then reload — confirm the button now shows a localized "Edit..." title instead of falling back to English or breaking

Wrap the `wp msls blog` command's success/error messages in
esc_html__() so they can be translated, instead of hardcoded English.

Fix the Quick Create button's title swap on translated sites: the
button previously carried only its "Create..." title, and the
JavaScript derived the "Edit..." title by regex-replacing the English
word "Create", which silently breaks once that word is translated.
Render both the create and edit titles server-side (the edit title as
a new data-edit-title attribute) and have the JS read the localized
edit title directly instead of doing English-text surgery on it.

(cherry picked from commit 58cdee1)
@miyanialkesh7
miyanialkesh7 requested a review from lloc as a code owner July 23, 2026 14:33
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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.

1 participant