Skip to content

Small typos & i18n updates#829

Open
masteradhoc wants to merge 3 commits intoWordPress:masterfrom
masteradhoc:small-typos-i18n-updates
Open

Small typos & i18n updates#829
masteradhoc wants to merge 3 commits intoWordPress:masterfrom
masteradhoc:small-typos-i18n-updates

Conversation

@masteradhoc
Copy link
Collaborator

What?

Fix missing and broken internationalization (i18n) in the notification emails and user-facing admin notices.

Why?

Several user-facing strings were not translatable:

  • The full email subject and body sent to users when their password is automatically reset (notify_user_password_reset) were bare English string literals — not wrapped in any translation function. Same for the admin notification email (notify_admin_user_password_reset). This means these strings are completely untranslatable regardless of the site's locale.
  • The "revalidate your session" admin notice was split across two separate esc_html__() calls flanking a hardcoded <a> tag. This is an i18n anti-pattern: translators cannot reorder the inline link within the sentence, which is required in many languages where word order differs from English.
  • A /* translators: */ comment in the email provider used $1$s/$2$s instead of the correct %1$s/%2$s format, causing translation extraction tools (WP-CLI, Poedit, GlotPress) to misidentify the placeholder format.

How?

  • Wrapped the email subjects and message bodies in __( ..., 'two-factor' ) with appropriate /* translators: */ comments documenting each placeholder.
  • Combined the split revalidate-session notice into a single __() call with the URL as a %s placeholder. The output is already passed through wp_kses_post() at the render site, so the HTML anchor in the string is safe.
  • Fixed the translators comment typo in class-two-factor-email.php ($1$s%1$s).

Testing Instructions

  1. Install and set your website language to german f.e.
  2. translate the new strings
  3. Trigger the changed emails - check if the translations work
  4. check translator comments

Changelog Entry

Fixed - Notification emails and admin notices were not fully translatable; fixed a translators comment placeholder typo ($1$s → %1$s).

@github-actions
Copy link

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: masteradhoc <masteradhoc@git.wordpress.org>

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

@masteradhoc masteradhoc self-assigned this Mar 11, 2026
@masteradhoc masteradhoc added this to the 0.16.0 milestone Mar 11, 2026
@jeffpaul jeffpaul moved this from Backlog to In review in Two Factor project board Mar 11, 2026
@masteradhoc masteradhoc requested a review from jeffpaul March 16, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

1 participant