From 1afd428a8954c85476146254dcd9aadb611c51ce Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Mon, 19 Feb 2024 15:10:11 +0545 Subject: [PATCH] Update examples for language plugin command --- src/Plugin_Language_Command.php | 51 ++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/src/Plugin_Language_Command.php b/src/Plugin_Language_Command.php index 4327bc32..1de0d9e8 100644 --- a/src/Plugin_Language_Command.php +++ b/src/Plugin_Language_Command.php @@ -5,21 +5,35 @@ * * ## EXAMPLES * - * # Install the Dutch plugin language pack. + * # Install the Dutch plugin language pack for Hello Dolly. * $ wp language plugin install hello-dolly nl_NL - * Success: Language installed. + * Downloading translation from https://downloads.wordpress.org/translation/plugin/hello-dolly/1.7.2/nl_NL.zip... + * Unpacking the update... + * Installing the latest version... + * Removing the old version of the translation... + * Translation updated successfully. + * Language 'nl_NL' installed. + * Success: Installed 1 of 1 languages. * - * # Uninstall the Dutch plugin language pack. + * # Uninstall the Dutch plugin language pack for Hello Dolly. * $ wp language plugin uninstall hello-dolly nl_NL - * Success: Language uninstalled. + * Language 'nl_NL' for 'hello-dolly' uninstalled. + * +-------------+--------+-------------+ + * | name | locale | status | + * +-------------+--------+-------------+ + * | hello-dolly | nl_NL | uninstalled | + * +-------------+--------+-------------+ + * Success: Uninstalled 1 of 1 languages. * - * # List installed plugin language packages. - * $ wp language plugin list --status=installed - * +----------+--------------+-------------+-----------+-----------+---------------------+ - * | language | english_name | native_name | status | update | updated | - * +----------+--------------+-------------+-----------+-----------+---------------------+ - * | nl_NL | Dutch | Nederlands | installed | available | 2016-05-13 08:12:50 | - * +----------+--------------+-------------+-----------+-----------+---------------------+ + * # List installed plugin language packs for Hello Dolly. + * $ wp language plugin list hello-dolly --status=installed + * +-------------+----------+--------------+-------------+-----------+--------+---------------------+ + * | plugin | language | english_name | native_name | status | update | updated | + * +-------------+----------+--------------+-------------+-----------+--------+---------------------+ + * | hello-dolly | nl_NL | Dutch | Nederlands | installed | none | 2023-11-13 12:34:15 | + * +-------------+----------+--------------+-------------+-----------+--------+---------------------+ + * + * @package wp-cli */ class Plugin_Language_Command extends WP_CLI\CommandWithTranslation { protected $obj_type = 'plugins'; @@ -78,8 +92,8 @@ class Plugin_Language_Command extends WP_CLI\CommandWithTranslation { * * ## EXAMPLES * - * # List language,english_name,status fields of available languages. - * $ wp language plugin list --fields=language,english_name,status + * # List available language packs for the plugin. + * $ wp language plugin list hello-dolly --fields=language,english_name,status * +----------------+-------------------------+-------------+ * | language | english_name | status | * +----------------+-------------------------+-------------+ @@ -223,6 +237,7 @@ public function is_installed( $args, $assoc_args = array() ) { * Downloading translation from https://downloads.wordpress.org/translation/plugin/akismet/4.0.3/ja.zip... * Unpacking the update... * Installing the latest version... + * Removing the old version of the translation... * Translation updated successfully. * Language 'ja' installed. * Success: Installed 1 of 1 languages. @@ -392,8 +407,15 @@ private function install_many( $args, $assoc_args ) { * * ## EXAMPLES * + * # Uninstall the Japanese plugin language pack for Hello Dolly. * $ wp language plugin uninstall hello-dolly ja - * Success: Language uninstalled. + * Language 'ja' for 'hello-dolly' uninstalled. + * +-------------+--------+-------------+ + * | name | locale | status | + * +-------------+--------+-------------+ + * | hello-dolly | ja | uninstalled | + * +-------------+--------+-------------+ + * Success: Uninstalled 1 of 1 languages. * * @subcommand uninstall */ @@ -553,6 +575,7 @@ public function uninstall( $args, $assoc_args ) { * * ## EXAMPLES * + * # Update all installed language packs for all plugins. * $ wp language plugin update --all * Updating 'Japanese' translation for Akismet 3.1.11... * Downloading translation from https://downloads.wordpress.org/translation/plugin/akismet/3.1.11/ja.zip...