Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

Users currently require a workaround (exec: 'global $locale; $locale="en_US";') to set the locale for WP-CLI. This adds a dedicated locale configuration option.

Changes

  • Configuration: Added locale option to config-spec.php supporting config file syntax only (not runtime flag to avoid conflicts with existing command-specific --locale parameters)
  • Implementation: Hooks WordPress locale filter in setup_bootstrap_hooks() to apply configured value early in bootstrap

Usage

Config file:

locale: de_DE

The locale value is passed directly to WordPress's locale filter without validation, allowing WordPress to handle any locale-specific processing.

Note: Runtime flag support (--locale=<locale>) was intentionally excluded to prevent conflicts with existing command-specific --locale parameters such as wp core download --locale=de_DE.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI and others added 3 commits January 25, 2026 17:15
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] Set WP-CLI locale to English for better usability Add locale configuration option for WP-CLI Jan 25, 2026
Copilot AI requested a review from swissspidy January 25, 2026 17:24
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>

This comment was marked as resolved.

Copilot AI requested a review from swissspidy January 25, 2026 17:28
@swissspidy swissspidy linked an issue Feb 4, 2026 that may be closed by this pull request
2 tasks
@swissspidy swissspidy linked an issue Feb 4, 2026 that may be closed by this pull request
@swissspidy

This comment was marked as resolved.

…--locale

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:cli Related to 'cli' command command:core-language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set locale for WP-CLI itself

2 participants