Skip to content

Commit

Permalink
Merge pull request #140 from ernilambar/language-plugin-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Feb 19, 2024
2 parents 4551de1 + 1afd428 commit 414769d
Showing 1 changed file with 37 additions and 14 deletions.
51 changes: 37 additions & 14 deletions src/Plugin_Language_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 |
* +----------------+-------------------------+-------------+
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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...
Expand Down

0 comments on commit 414769d

Please sign in to comment.