Skip to content
Merged
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
8 changes: 6 additions & 2 deletions src/WP_CLI/CommandWithTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,12 @@ protected function get_installed_languages( $slug = 'default' ) {
}
}

$available = ! empty( $available[ $text_domain ] ) ? array_keys( $available[ $text_domain ] ) : array();
$available[] = 'en_US';
$available = ! empty( $available[ $text_domain ] ) ? array_keys( $available[ $text_domain ] ) : array();
// en_US is always installed for core, but may not be available for plugins/themes,
// especially when custom translation sources are used.
if ( 'core' === $this->obj_type ) {
$available[] = 'en_US';
}

return $available;
}
Expand Down