public function list_( $args, $assoc_args ) {
		$all = \WP_CLI\Utils\get_flag_value( $assoc_args, 'all', false );

		if ( ! $all && empty( $args ) ) {
			WP_CLI::error( 'Please specify one or more plugins, or use --all.' );
		}

		if ( $all ) {
			$args = array_map( '\WP_CLI\Utils\get_plugin_name', array_keys( $this->get_all_plugins() ) );

			if ( empty( $args ) ) {
				WP_CLI::success( 'No plugins installed.' );
				return;
			}
		}

		$updates        = $this->get_translation_updates();
		$current_locale = get_locale();

		$translations = array();

		foreach ( $args as $plugin ) {
			$installed_translations = $this->get_installed_languages( $plugin );
			$available_translations = $this->get_all_languages( $plugin );

			foreach ( $available_translations as $translation ) {
				$translation['plugin'] = $plugin;
				$translation['status'] = in_array( $translation['language'], $installed_translations, true ) ? 'installed' : 'uninstalled';

				if ( $current_locale === $translation['language'] ) {
					$translation['status'] = 'active';
				}

				$filter_args = array(
					'language' => $translation['language'],
					'type'     => 'plugin',
					'slug'     => $plugin,
				);
				$update      = wp_list_filter( $updates, $filter_args );

				$translation['update'] = $update ? 'available' : 'none';

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

				$translations[] = $translation;
			}
		}

		$formatter = $this->get_formatter( $assoc_args );
		$formatter->display_items( $translations );
	}
public function list_( $args, $assoc_args ) {
		$all = \WP_CLI\Utils\get_flag_value( $assoc_args, 'all', false );

		if ( ! $all && empty( $args ) ) {
			WP_CLI::error( 'Please specify one or more plugins, or use --all.' );
		}

		if ( $all ) {
			$args = array_map( '\WP_CLI\Utils\get_plugin_name', array_keys( $this->get_all_plugins() ) );

			if ( empty( $args ) ) {
				WP_CLI::success( 'No plugins installed.' );
				return;
			}
		}

		$updates        = $this->get_translation_updates();
		$current_locale = get_locale();

		$translations = array();

		foreach ( $args as $plugin ) {
			$installed_translations = $this->get_installed_languages( $plugin );
			$available_translations = $this->get_all_languages( $plugin );

			foreach ( $available_translations as $translation ) {
				$translation['plugin'] = $plugin;
				$translation['status'] = in_array( $translation['language'], $installed_translations, true ) ? 'installed' : 'uninstalled';

				if ( $current_locale === $translation['language'] ) {
					$translation['status'] = 'active';
				}

				$filter_args = array(
					'language' => $translation['language'],
					'type'     => 'plugin',
					'slug'     => $plugin,
				);
				$update      = wp_list_filter( $updates, $filter_args );

				$translation['update'] = $update ? 'available' : 'none';

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

				$translations[] = $translation;
			}
		}

		$formatter = $this->get_formatter( $assoc_args );
		$formatter->display_items( $translations );
	}
public function list_ ( $ args , $ assoc_args ) { $ all = \ WP_CLI \ Utils \ get_flag_value ( $ assoc_args , 'all' , false ) ; if ( ! $ all && empty ( $ args ) ) { WP_CLI :: error ( 'Please specify one or more plugins, or use --all.' ) ; } if ( $ all ) { $ args = array_map ( '\WP_CLI\Utils\get_plugin_name' , array_keys ( $ this -> get_all_plugins ( ) ) ) ; if ( empty ( $ args ) ) { WP_CLI :: success ( 'No plugins installed.' ) ; return ; } } $ updates = $ this -> get_translation_updates ( ) ; $ current_locale = get_locale ( ) ; $ translations = array ( ) ; foreach ( $ args as $ plugin ) { $ installed_translations = $ this -> get_installed_languages ( $ plugin ) ; $ available_translations = $ this -> get_all_languages ( $ plugin ) ; foreach ( $ available_translations as $ translation ) { $ translation [ 'plugin' ] = $ plugin ; $ translation [ 'status' ] = in_array ( $ translation [ 'language' ] , $ installed_translations , true ) ? 'installed' : 'uninstalled' ; if ( $ current_locale === $ translation [ 'language' ] ) { $ translation [ 'status' ] = 'active' ; } $ filter_args = array ( 'language' => $ translation [ 'language' ] , 'type' => 'plugin' , 'slug' => $ plugin , ) ; $ update = wp_list_filter ( $ updates , $ filter_args ) ; $ translation [ 'update' ] = $ update ? 'available' : 'none' ; // Support features like --status=active. foreach ( array_keys ( $ translation ) as $ field ) { if ( isset ( $ assoc_args [ $ field ] ) && $ assoc_args [ $ field ] !== $ translation [ $ field ] ) { continue 2 ; } } $ translations [ ] = $ translation ; } } $ formatter = $ this -> get_formatter ( $ assoc_args ) ; $ formatter -> display_items ( $ translations ) ; }
Lists all available languages for one or more plugins.

## OPTIONS

[<plugin>...]
: One or more plugins to list languages for.

[--all]
: If set, available languages for all plugins will be listed.

[--field=<field>]
: Display the value of a single field.

[--<field>=<value>]
: Filter results by key=value pairs.

[--fields=<fields>]
: Limit the output to specific fields.

[--format=<format>]
: Render output in a particular format.
---
default: table
options:
- table
- csv
- json
---

## AVAILABLE FIELDS

These fields will be displayed by default for each translation:

* plugin
* language
* english_name
* native_name
* status
* update
* updated

## EXAMPLES

# List language,english_name,status fields of available languages.
$ wp language plugin list --fields=language,english_name,status
+----------------+-------------------------+-------------+
| language       | english_name            | status      |
+----------------+-------------------------+-------------+
| ar             | Arabic                  | uninstalled |
| ary            | Moroccan Arabic         | uninstalled |
| az             | Azerbaijani             | uninstalled |

@subcommand list
Lists all available languages for one or more plugins .