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 missing docs for make-mo command #315

Merged
merged 1 commit into from
May 30, 2022
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
2 changes: 2 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ labels:
color: c5def5
- name: command:i18n-make-json
color: c5def5
- name: command:i18n-make-mo
color: c5def5
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,32 @@ about WordPress JavaScript internationalization.
# Create JSON files with object mapping
$ wp i18n make-json languages '--use-map={"source/index.js":"build/index.js"}'



### wp i18n make-mo

Create MO files from PO files.

~~~
wp i18n make-mo <source> [<destination>]
~~~

**OPTIONS**

<source>
Path to an existing PO file or a directory containing multiple PO files.

[<destination>]
Path to the destination directory for the resulting MO files. Defaults to the source directory.

**EXAMPLES**

# Create MO files for all PO files in the current directory.
$ wp i18n make-mo .

# Create a MO file from a single PO file in a specific directory.
$ wp i18n make-mo example-plugin-de_DE.po languages

## Installing

This package is included with WP-CLI itself, no additional installation necessary.
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"commands": [
"i18n",
"i18n make-pot",
"i18n make-json"
"i18n make-json",
"i18n make-mo"
]
},
"autoload": {
Expand Down
8 changes: 8 additions & 0 deletions src/MakeMoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ class MakeMoCommand extends WP_CLI_Command {
* [<destination>]
* : Path to the destination directory for the resulting MO files. Defaults to the source directory.
*
* ## EXAMPLES
*
* # Create MO files for all PO files in the current directory.
* $ wp i18n make-mo .
*
* # Create a MO file from a single PO file in a specific directory.
* $ wp i18n make-mo example-plugin-de_DE.po languages
*
* @when before_wp_load
*
* @throws WP_CLI\ExitException
Expand Down