Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions features/language-plugin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Feature: Manage plugin translation files for a WordPress install
| language | english_name | status |
| cs_CZ | Czech | uninstalled |
| de_DE | German | uninstalled |
| en_US | English (United States) | active |
| en_GB | English (UK) | uninstalled |

When I try `wp language plugin list not-a-plugin --format=json`
Expand Down Expand Up @@ -87,15 +86,13 @@ Feature: Manage plugin translation files for a WordPress install
| language | english_name | status |
| cs_CZ | Czech | installed |
| de_DE | German | installed |
| en_US | English (United States) | active |
| en_GB | English (UK) | installed |

When I run `wp language plugin list hello-dolly --fields=language,english_name,update`
Then STDOUT should be a table containing rows:
| language | english_name | update |
| cs_CZ | Czech | none |
| de_DE | German | none |
| en_US | English (United States) | none |
| en_GB | English (UK) | none |

When I run `wp language plugin list hello-dolly --status=installed --format=count`
Expand Down
3 changes: 0 additions & 3 deletions features/language-theme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Feature: Manage theme translation files for a WordPress install
| language | english_name | status |
| cs_CZ | Czech | uninstalled |
| de_DE | German | uninstalled |
| en_US | English (United States) | active |
| en_GB | English (UK) | uninstalled |

When I try `wp language theme list not-a-theme --format=json`
Expand Down Expand Up @@ -85,7 +84,6 @@ Feature: Manage theme translation files for a WordPress install
| cs_CZ | Czech | installed |
| de_DE | German | installed |
| en_GB | English (UK) | installed |
| en_US | English (United States) | active |

When I run `wp language theme list twentyten --fields=language,english_name,update`
Then STDOUT should be a table containing rows:
Expand Down Expand Up @@ -119,7 +117,6 @@ Feature: Manage theme translation files for a WordPress install
| language | english_name | status |
| cs_CZ | Czech | installed |
| de_DE | German | installed |
| en_US | English (United States) | installed |
| en_GB | English (UK) | active |

When I run `wp language theme uninstall twentyten cs_CZ de_DE`
Expand Down
10 changes: 6 additions & 4 deletions src/WP_CLI/CommandWithTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,14 @@
* @return string[]
*/
protected function get_installed_languages( $slug = 'default' ) {
/**
/**

Check failure on line 283 in src/WP_CLI/CommandWithTranslation.php

View workflow job for this annotation

GitHub Actions / code-quality / PHPCS

Line indented incorrectly; expected at least 2 tabs, found 1

Check failure on line 283 in src/WP_CLI/CommandWithTranslation.php

View workflow job for this annotation

GitHub Actions / code-quality / PHPCS

Tabs must be used to indent lines; spaces are not allowed
* @var array<string, array<string, array<string, mixed>>> $available
*/
$available = wp_get_installed_translations( $this->obj_type );
$available = ! empty( $available[ $slug ] ) ? array_keys( $available[ $slug ] ) : array();
$available[] = 'en_US';
$available = wp_get_installed_translations( $this->obj_type );
$available = ! empty( $available[ $slug ] ) ? array_keys( $available[ $slug ] ) : array();
if ( 'core' === $this->obj_type ) {
$available[] = 'en_US';
}

return $available;
}
Expand Down
Loading