Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add language plugin and language theme command. #29

Merged
merged 9 commits into from
Aug 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,23 @@ labels:
color: c5def5
- name: command:language-core-update
color: c5def5
- name: command:language-plugin
color: c5def5
- name: command:language-plugin-install
color: c5def5
- name: command:language-plugin-list
color: c5def5
- name: command:language-plugin-uninstall
color: c5def5
- name: command:language-plugin-update
color: c5def5
- name: command:language-theme
color: c5def5
- name: command:language-theme-install
color: c5def5
- name: command:language-theme-list
color: c5def5
- name: command:language-theme-uninstall
color: c5def5
- name: command:language-theme-update
color: c5def5
339 changes: 337 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Updates installed languages.
wp language core update [--dry-run]
~~~

Updates installed languages for core, plugins and themes.
Updates installed languages for core.

**OPTIONS**

Expand All @@ -229,13 +229,348 @@ Updates installed languages for core, plugins and themes.
**EXAMPLES**

$ wp language core update
Updating 'Japanese' translation for WordPress 4.9.2...
Downloading translation from https://downloads.wordpress.org/translation/core/4.9.2/ja.zip...
Translation updated successfully.
Success: Updated 1/1 translations.



### wp language plugin

Installs, activates, and manages plugin language packs.

~~~
wp language plugin
~~~

**EXAMPLES**

# Install the Dutch theme language pack.
$ wp language plugin install hello-dolly nl_NL
Success: Language installed.

# Uninstall the Dutch theme language pack.
$ wp language plugin uninstall hello-dolly nl_NL
Success: Language uninstalled.

# List installed theme 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 |
+----------+--------------+-------------+-----------+-----------+---------------------+





### wp language plugin install

Installs a given language.

~~~
wp language plugin install <plugin> <language>...
~~~

Downloads the language pack from WordPress.org.

**OPTIONS**

<plugin>
Plugin to install language for.

<language>...
Language code to install.

**EXAMPLES**

# Install the Japanese language.
$ wp language core install ja
Success: Language installed.



### wp language plugin list

Lists all available languages.

~~~
wp language plugin list [<plugin>...] [--all] [--field=<field>] [--<field>=<value>] [--fields=<fields>] [--format=<format>]
~~~

**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

These fields are optionally available:

* version
* package

**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 |



### wp language plugin uninstall

Uninstalls a given language.

~~~
wp language plugin uninstall <plugin> <language>...
~~~

**OPTIONS**

<plugin>
Plugin to uninstall language for.

<language>...
Language code to uninstall.

**EXAMPLES**

$ wp language plugin uninstall hello-dolly ja
Success: Language uninstalled.



### wp language plugin update

Updates installed languages.

~~~
wp language plugin update [--dry-run]
~~~

Updates installed languages for plugins.

**OPTIONS**

[--dry-run]
Preview which translations would be updated.

**EXAMPLES**

$ wp language plugin update
Updating 'Japanese' translation for Akismet 3.1.11...
Downloading translation from https://downloads.wordpress.org/translation/plugin/akismet/3.1.11/ja.zip...
Translation updated successfully.
Success: Updated 1/1 translations.



### wp language theme

Installs, activates, and manages theme language packs.

~~~
wp language theme
~~~

**EXAMPLES**

# Install the Dutch theme language pack.
$ wp language theme install twentyten nl_NL
Success: Language installed.

# Uninstall the Dutch theme language pack.
$ wp language theme uninstall twentyten nl_NL
Success: Language uninstalled.

# List installed theme language packages.
$ wp language theme list --status=installed
+----------+--------------+-------------+-----------+-----------+---------------------+
| language | english_name | native_name | status | update | updated |
+----------+--------------+-------------+-----------+-----------+---------------------+
| nl_NL | Dutch | Nederlands | installed | available | 2016-05-13 08:12:50 |
+----------+--------------+-------------+-----------+-----------+---------------------+





### wp language theme install

Installs a given language.

~~~
wp language theme install <theme> <language>...
~~~

Downloads the language pack from WordPress.org.

**OPTIONS**

<theme>
Theme to install language for.

<language>...
Language code to install.

**EXAMPLES**

# Install the Japanese language.
$ wp language core install ja
Success: Language installed.



### wp language theme list

Lists all available languages.

~~~
wp language theme list [<theme>...] [--all] [--field=<field>] [--<field>=<value>] [--fields=<fields>] [--format=<format>]
~~~

**OPTIONS**

[<theme>...]
One or more themes to list languages for.

[--all]
If set, available languages for all themes 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:

* theme
* language
* english_name
* native_name
* status
* update
* updated

These fields are optionally available:

* version
* package

**EXAMPLES**

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



### wp language theme uninstall

Uninstalls a given language.

~~~
wp language theme uninstall <theme> <language>...
~~~

**OPTIONS**

<theme>
Theme to uninstall language for.

<language>...
Language code to uninstall.

**EXAMPLES**

$ wp language theme uninstall twentyten ja
Success: Language uninstalled.



### wp language theme update

Updates installed languages.

~~~
wp language theme update [--dry-run]
~~~

Updates installed languages for themes.

**OPTIONS**

[--dry-run]
Preview which translations would be updated.

**EXAMPLES**

$ wp language theme update
Updating 'Japanese' translation for Twenty Fifteen 1.5...
Downloading translation from https://downloads.wordpress.org/translation/theme/twentyfifteen/1.5/ja.zip...
Translation updated successfully.
Success: Updated 2/2 translations.
Success: Updated 1/1 translations.

## Installing

Expand Down
Loading