private function install_one( $args, $assoc_args ) {
		$theme          = array_shift( $args );
		$language_codes = (array) $args;
		$count          = count( $language_codes );

		$available = $this->get_installed_languages( $theme );

		$successes = 0;
		$errors    = 0;
		$skips     = 0;
		foreach ( $language_codes as $language_code ) {

			if ( in_array( $language_code, $available, true ) ) {
				\WP_CLI::log( "Language '{$language_code}' already installed." );
				$skips++;
			} else {
				$response = $this->download_language_pack( $language_code, $theme );

				if ( is_wp_error( $response ) ) {
					\WP_CLI::warning( $response );
					\WP_CLI::log( "Language '{$language_code}' not installed." );

					// Skip if translation is not yet available.
					if ( 'not_found' === $response->get_error_code() ) {
						$skips++;
					} else {
						$errors++;
					}
				} else {
					\WP_CLI::log( "Language '{$language_code}' installed." );
					$successes++;
				}
			}
		}

		\WP_CLI\Utils\report_batch_operation_results( 'language', 'install', $count, $successes, $errors, $skips );
	}
private function install_one( $args, $assoc_args ) {
		$theme          = array_shift( $args );
		$language_codes = (array) $args;
		$count          = count( $language_codes );

		$available = $this->get_installed_languages( $theme );

		$successes = 0;
		$errors    = 0;
		$skips     = 0;
		foreach ( $language_codes as $language_code ) {

			if ( in_array( $language_code, $available, true ) ) {
				\WP_CLI::log( "Language '{$language_code}' already installed." );
				$skips++;
			} else {
				$response = $this->download_language_pack( $language_code, $theme );

				if ( is_wp_error( $response ) ) {
					\WP_CLI::warning( $response );
					\WP_CLI::log( "Language '{$language_code}' not installed." );

					// Skip if translation is not yet available.
					if ( 'not_found' === $response->get_error_code() ) {
						$skips++;
					} else {
						$errors++;
					}
				} else {
					\WP_CLI::log( "Language '{$language_code}' installed." );
					$successes++;
				}
			}
		}

		\WP_CLI\Utils\report_batch_operation_results( 'language', 'install', $count, $successes, $errors, $skips );
	}
private function install_one ( $ args , $ assoc_args ) { $ theme = array_shift ( $ args ) ; $ language_codes = ( array ) $ args ; $ count = count ( $ language_codes ) ; $ available = $ this -> get_installed_languages ( $ theme ) ; $ successes = 0 ; $ errors = 0 ; $ skips = 0 ; foreach ( $ language_codes as $ language_code ) { if ( in_array ( $ language_code , $ available , true ) ) { \ WP_CLI :: log ( "Language '{$language_code}' already installed." ) ; $ skips ++ ; } else { $ response = $ this -> download_language_pack ( $ language_code , $ theme ) ; if ( is_wp_error ( $ response ) ) { \ WP_CLI :: warning ( $ response ) ; \ WP_CLI :: log ( "Language '{$language_code}' not installed." ) ; // Skip if translation is not yet available. if ( 'not_found' === $ response -> get_error_code ( ) ) { $ skips ++ ; } else { $ errors ++ ; } } else { \ WP_CLI :: log ( "Language '{$language_code}' installed." ) ; $ successes ++ ; } } } \ WP_CLI \ Utils \ report_batch_operation_results ( 'language' , 'install' , $ count , $ successes , $ errors , $ skips ) ; }
Installs translations for a theme.

@param array $args       Runtime arguments.
@param array $assoc_args Runtime arguments.
Installs translations for a theme .