Small typos & i18n updates#829
Conversation
|
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 Core SVNIf you're a Core Committer, use this list when committing to GitHub Merge commitsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
georgestephanis
left a comment
There was a problem hiding this comment.
I assume none of these would run before textdomains are loaded?
If so, I'm good to 🚀
|
@georgestephanis Based on my testing yes! Didnt receive any related messages in my log. IMO as this is a static method that only runs when explicitly called the plugin's textdomain will already be loaded. |
What?
Fix missing and broken internationalization (i18n) in the notification emails and user-facing admin notices.
Why?
Several user-facing strings were not translatable:
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.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./* translators: */comment in the email provider used$1$s/$2$sinstead of the correct%1$s/%2$sformat, causing translation extraction tools (WP-CLI, Poedit, GlotPress) to misidentify the placeholder format.How?
__( ..., 'two-factor' )with appropriate/* translators: */comments documenting each placeholder.__()call with the URL as a%splaceholder. The output is already passed throughwp_kses_post()at the render site, so the HTML anchor in the string is safe.$1$s→%1$s).Testing Instructions
Changelog Entry