Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wp-cli/language-command
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.22
Choose a base ref
...
head repository: wp-cli/language-command
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 8 commits
  • 7 files changed
  • 2 contributors

Commits on Nov 24, 2024

  1. Copy the full SHA
    421280e View commit details
  2. Copy the full SHA
    316efc6 View commit details

Commits on Jan 7, 2025

  1. Copy the full SHA
    e5fa090 View commit details
  2. Copy the full SHA
    cd74883 View commit details
  3. Copy the full SHA
    b15b0bc View commit details
  4. Copy the full SHA
    dd7e481 View commit details
  5. Copy the full SHA
    007f77d View commit details
  6. Copy the full SHA
    e3d89d9 View commit details
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
}
],
"require": {
"wp-cli/wp-cli": "^2.5"
"wp-cli/wp-cli": "^2.12"
},
"require-dev": {
"wp-cli/db-command": "^1.3 || ^2",
13 changes: 13 additions & 0 deletions features/language-core.feature
Original file line number Diff line number Diff line change
@@ -535,3 +535,16 @@ Feature: Manage translation files for a WordPress install
"""
en_US
"""

@require-wp-4.0
Scenario: List languages by multiple statuses
Given a WP install
And an empty cache
And I run `wp language core install nl_NL`

When I run `wp language core list --fields=language,status --status=active,installed`
Then STDOUT should be a table containing rows:
| language | status |
| en_US | active |
| nl_NL | installed |
And STDERR should be empty
13 changes: 13 additions & 0 deletions features/language-plugin.feature
Original file line number Diff line number Diff line change
@@ -439,3 +439,16 @@ Feature: Manage translation files for a WordPress install
jetpack,invalid_lang,"not available"
"""
And STDERR should be empty

@require-wp-4.0
Scenario: List languages by multiple statuses
Given a WP install
And an empty cache
And I run `wp language plugin install akismet nl_NL`

When I run `wp language plugin list --all --fields=plugin,language,status --status=active,installed`
Then STDOUT should be a table containing rows:
| plugin | language | status |
| akismet | en_US | active |
| akismet | nl_NL | installed |
And STDERR should be empty
14 changes: 14 additions & 0 deletions features/language-theme.feature
Original file line number Diff line number Diff line change
@@ -314,3 +314,17 @@ Feature: Manage translation files for a WordPress install
twentysixteen,de_DE,"not installed"
"""
And STDERR should be empty

@require-wp-4.0
Scenario: List languages by multiple statuses
Given a WP install
And an empty cache
And I run `wp theme install twentyten --force`
And I run `wp language theme install twentyten nl_NL`

When I run `wp language theme list twentyten --fields=language,status --status=active,installed`
Then STDOUT should be a table containing rows:
| language | status |
| en_US | active |
| nl_NL | installed |
And STDERR should be empty
2 changes: 1 addition & 1 deletion src/Core_Language_Command.php
Original file line number Diff line number Diff line change
@@ -126,7 +126,7 @@ function ( $translation ) use ( $available, $current_locale, $updates ) {

foreach ( $translations as $key => $translation ) {
foreach ( array_keys( $translation ) as $field ) {
if ( isset( $assoc_args[ $field ] ) && $assoc_args[ $field ] !== $translation[ $field ] ) {
if ( isset( $assoc_args[ $field ] ) && ! in_array( $translation[ $field ], array_map( 'trim', explode( ',', $assoc_args[ $field ] ) ), true ) ) {
unset( $translations[ $key ] );
}
}
2 changes: 1 addition & 1 deletion src/Plugin_Language_Command.php
Original file line number Diff line number Diff line change
@@ -154,7 +154,7 @@ public function list_( $args, $assoc_args ) {

// Support features like --status=active.
foreach ( array_keys( $translation ) as $field ) {
if ( isset( $assoc_args[ $field ] ) && $assoc_args[ $field ] !== $translation[ $field ] ) {
if ( isset( $assoc_args[ $field ] ) && ! in_array( $translation[ $field ], array_map( 'trim', explode( ',', $assoc_args[ $field ] ) ), true ) ) {
continue 2;
}
}
2 changes: 1 addition & 1 deletion src/Theme_Language_Command.php
Original file line number Diff line number Diff line change
@@ -160,7 +160,7 @@ function ( $file ) {

// Support features like --status=active.
foreach ( array_keys( $translation ) as $field ) {
if ( isset( $assoc_args[ $field ] ) && $assoc_args[ $field ] !== $translation[ $field ] ) {
if ( isset( $assoc_args[ $field ] ) && ! in_array( $translation[ $field ], array_map( 'trim', explode( ',', $assoc_args[ $field ] ) ), true ) ) {
continue 2;
}
}