Skip to content

Commit

Permalink
Merge pull request #315 from wp-cli/fix/314-make-mo-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored May 30, 2022
2 parents e743122 + 0410369 commit 7d12dda
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
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

0 comments on commit 7d12dda

Please sign in to comment.