Skip to content

Fix untranslated strings and restore translators-comment checks - #102

Open
miyanialkesh7 wants to merge 1 commit into
HandyPlugins:developfrom
miyanialkesh7:fix/i18n-untranslated-strings
Open

Fix untranslated strings and restore translators-comment checks#102
miyanialkesh7 wants to merge 1 commit into
HandyPlugins:developfrom
miyanialkesh7:fix/i18n-untranslated-strings

Conversation

@miyanialkesh7

@miyanialkesh7 miyanialkesh7 commented Aug 15, 2026

Copy link
Copy Markdown

Summary

  • Wraps 3 untranslated strings (placeholder/aria-label attributes) in esc_attr_e() — SMS, Spam Protection, and Tools tabs.
  • Removes a blanket // phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment from 7 files that was silently exempting any future placeholder string in those files from ever needing a translators comment.
  • Restoring the check immediately surfaced one real gap: a translators comment sitting above printf() instead of directly above the __() call the sniff checks against. Fixed by moving it down one line.

Test Plan

  • php -l on all 9 changed files — no syntax errors
  • vendor/bin/phpcs --standard=phpcs.xml on all 7 affected files — 0 errors/warnings after the fix (was 1 warning before)
  • vendor/bin/phpunit — 8/8 passing
  • wp plugin check magic-login — 0 translator-related findings
  • Rendered sms/tools/spam-protection/registration tabs via direct template include — no fatals, correct byte output

@mustafauysal

Copy link
Copy Markdown
Member

@miyanialkesh7 LGTM! Could you just undo the version bump and leave it as a comment instead? I’ll merge all the changes when I’m preparing the next release.

- Wrap 3 hardcoded strings (placeholder/aria-label attributes) in the
  SMS, Spam Protection, and Tools tabs with esc_attr_e().
- Remove the file-wide "phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment"
  from 7 files. It was silently exempting any future printf()/sprintf()
  placeholder string in these files from ever needing a translators
  comment. Restoring the check immediately surfaced one real gap in
  login.php, where the comment sat above printf() instead of directly
  above the __() call the sniff checks against; fixed by moving it down.
  Verified all other calls in these 7 files still pass with 0 new errors.
@miyanialkesh7
miyanialkesh7 force-pushed the fix/i18n-untranslated-strings branch from 8a4f45c to c8b4036 Compare August 25, 2026 06:07
@miyanialkesh7

Copy link
Copy Markdown
Author

@mustafauysal Removed the version bump and changelog entry from this PR as well (force-pushed the amended commit). It now only contains the i18n/translators-comment fixes.

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