Honor --locale in wp core update and allow locale-change without --force#310
Merged
swissspidy merged 4 commits intomainfrom Feb 25, 2026
Merged
Honor --locale in wp core update and allow locale-change without --force#310swissspidy merged 4 commits intomainfrom
--locale in wp core update and allow locale-change without --force#310swissspidy merged 4 commits intomainfrom
Conversation
…ates without --force Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix WP update checksum locale issue
Honor Feb 25, 2026
--locale in wp core update and allow locale-change without --force
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Copilot <175728472+Copilot@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.
wp core updatesilently ignored--localewhen used with--minoror without--version, and required--forceto switch locale when the version was already current. This meant users couldn't switch a German WordPress install back to English withoutwp core update --version=X.Y.Z --locale=en_US --force.Changes
No-version/
--minorpath: When--localeis explicitly passed, creates a new update object overriding the transient locale and download URL with the requested locale. Previously, the locale from the WordPress.org update transient was always used.Version-specific condition: Added
|| ! empty( $assoc_args['locale'] )so that specifying--version=X.Y.Z --locale=<different>on an already-installed version no longer silently exits as "up to date" — the update object is now constructed and the locale change is applied.Execution condition: Added a locale comparison so the update proceeds whenever the requested locale differs from
wp_local_packageinversion.php, even when the version number matches:PHPDoc: Expanded the
@varannotation for the$from_apitransient object to includeresponse,download, andpackagesproperties (required for PHPStan level 9 since the new code reads those properties).Example
A Behat scenario is added to cover the same-version locale-switch case: downloads 6.5 as
de_DE, then updates toen_USon the same version without--forceand asserts the package language changes.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.