Add dedicated wp i18n audit command with JSON and GitHub Actions output formats#459
Draft
Add dedicated wp i18n audit command with JSON and GitHub Actions output formats#459
wp i18n audit command with JSON and GitHub Actions output formats#459Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add dedicated i18n audit command
Add dedicated Nov 2, 2025
wp i18n audit command with JSON and GitHub Actions output formats
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This comment was marked as resolved.
This comment was marked as resolved.
…lication Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
…f text domain Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
swissspidy
reviewed
Jan 20, 2026
swissspidy
reviewed
Jan 20, 2026
swissspidy
reviewed
Jan 20, 2026
…unquoted strings Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
…eme detection Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… with parent class Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of
wp i18n auditcommand - Complete ✅Latest Updates
Fixed FileDataExtractor data access:
['value']key from FileDataExtractor data['value' => ..., 'line' => ...]Code refactoring for better readability:
array_map+array_uniqueinstead ofarray_filterwith side effectsCode cleanup:
preg_replacecall that stripped quotes from strings, as the gettext library already provides unquoted strings via$translation->getOriginal()Fixed
--ignore-domainflag handling:--ignore-domainis used, domain is now properly left unset to extract all strings regardless of text domainwp i18n make-pot --ignore-domainSuppressed informational messages in non-plaintext formats:
--format=jsonor--format=github-actions, the command now only outputs the formatted dataMajor Refactoring (addressing code review feedback)
Refactored AuditCommand to extend MakePotCommand instead of duplicating code:
FileDataExtractor::get_file_type(),FileDataExtractor::find_main_file())Key Changes
Refactored AuditCommand class (
src/AuditCommand.php):MakePotCommandto reuse string extraction logicget_main_file_data()to conditionally suppress log messages based on format--ignore-domainflag to extract all strings['value']keyfile:line: messageformat with informational messages (addressing File name BEFORE the Warning & full path #119)get_comment_text()to reduce code duplicationCommand registration (
i18n-command.php): UnchangedTest coverage (
features/audit.feature): All tests now passingAudit Checks Implemented
Backward Compatibility
✅ The existing audit functionality in
wp i18n make-potremains completely unchanged.Code Quality Improvements
--ignore-domainflag handlingOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.