Skip to content

Commit 414769d

Browse files
authored
Merge pull request #140 from ernilambar/language-plugin-examples
2 parents 4551de1 + 1afd428 commit 414769d

File tree

1 file changed

+37
-14
lines changed

1 file changed

+37
-14
lines changed

src/Plugin_Language_Command.php

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,35 @@
55
*
66
* ## EXAMPLES
77
*
8-
* # Install the Dutch plugin language pack.
8+
* # Install the Dutch plugin language pack for Hello Dolly.
99
* $ wp language plugin install hello-dolly nl_NL
10-
* Success: Language installed.
10+
* Downloading translation from https://downloads.wordpress.org/translation/plugin/hello-dolly/1.7.2/nl_NL.zip...
11+
* Unpacking the update...
12+
* Installing the latest version...
13+
* Removing the old version of the translation...
14+
* Translation updated successfully.
15+
* Language 'nl_NL' installed.
16+
* Success: Installed 1 of 1 languages.
1117
*
12-
* # Uninstall the Dutch plugin language pack.
18+
* # Uninstall the Dutch plugin language pack for Hello Dolly.
1319
* $ wp language plugin uninstall hello-dolly nl_NL
14-
* Success: Language uninstalled.
20+
* Language 'nl_NL' for 'hello-dolly' uninstalled.
21+
* +-------------+--------+-------------+
22+
* | name | locale | status |
23+
* +-------------+--------+-------------+
24+
* | hello-dolly | nl_NL | uninstalled |
25+
* +-------------+--------+-------------+
26+
* Success: Uninstalled 1 of 1 languages.
1527
*
16-
* # List installed plugin language packages.
17-
* $ wp language plugin list --status=installed
18-
* +----------+--------------+-------------+-----------+-----------+---------------------+
19-
* | language | english_name | native_name | status | update | updated |
20-
* +----------+--------------+-------------+-----------+-----------+---------------------+
21-
* | nl_NL | Dutch | Nederlands | installed | available | 2016-05-13 08:12:50 |
22-
* +----------+--------------+-------------+-----------+-----------+---------------------+
28+
* # List installed plugin language packs for Hello Dolly.
29+
* $ wp language plugin list hello-dolly --status=installed
30+
* +-------------+----------+--------------+-------------+-----------+--------+---------------------+
31+
* | plugin | language | english_name | native_name | status | update | updated |
32+
* +-------------+----------+--------------+-------------+-----------+--------+---------------------+
33+
* | hello-dolly | nl_NL | Dutch | Nederlands | installed | none | 2023-11-13 12:34:15 |
34+
* +-------------+----------+--------------+-------------+-----------+--------+---------------------+
35+
*
36+
* @package wp-cli
2337
*/
2438
class Plugin_Language_Command extends WP_CLI\CommandWithTranslation {
2539
protected $obj_type = 'plugins';
@@ -78,8 +92,8 @@ class Plugin_Language_Command extends WP_CLI\CommandWithTranslation {
7892
*
7993
* ## EXAMPLES
8094
*
81-
* # List language,english_name,status fields of available languages.
82-
* $ wp language plugin list --fields=language,english_name,status
95+
* # List available language packs for the plugin.
96+
* $ wp language plugin list hello-dolly --fields=language,english_name,status
8397
* +----------------+-------------------------+-------------+
8498
* | language | english_name | status |
8599
* +----------------+-------------------------+-------------+
@@ -223,6 +237,7 @@ public function is_installed( $args, $assoc_args = array() ) {
223237
* Downloading translation from https://downloads.wordpress.org/translation/plugin/akismet/4.0.3/ja.zip...
224238
* Unpacking the update...
225239
* Installing the latest version...
240+
* Removing the old version of the translation...
226241
* Translation updated successfully.
227242
* Language 'ja' installed.
228243
* Success: Installed 1 of 1 languages.
@@ -392,8 +407,15 @@ private function install_many( $args, $assoc_args ) {
392407
*
393408
* ## EXAMPLES
394409
*
410+
* # Uninstall the Japanese plugin language pack for Hello Dolly.
395411
* $ wp language plugin uninstall hello-dolly ja
396-
* Success: Language uninstalled.
412+
* Language 'ja' for 'hello-dolly' uninstalled.
413+
* +-------------+--------+-------------+
414+
* | name | locale | status |
415+
* +-------------+--------+-------------+
416+
* | hello-dolly | ja | uninstalled |
417+
* +-------------+--------+-------------+
418+
* Success: Uninstalled 1 of 1 languages.
397419
*
398420
* @subcommand uninstall
399421
*/
@@ -553,6 +575,7 @@ public function uninstall( $args, $assoc_args ) {
553575
*
554576
* ## EXAMPLES
555577
*
578+
* # Update all installed language packs for all plugins.
556579
* $ wp language plugin update --all
557580
* Updating 'Japanese' translation for Akismet 3.1.11...
558581
* Downloading translation from https://downloads.wordpress.org/translation/plugin/akismet/3.1.11/ja.zip...

0 commit comments

Comments
 (0)