From 041036932c0173d2f962ab397c6a2c162a3db170 Mon Sep 17 00:00:00 2001 From: Pascal Birchler <pascalb@google.com> Date: Mon, 2 May 2022 10:44:37 +0200 Subject: [PATCH] Add missing docs for make-mo command --- .github/settings.yml | 2 ++ README.md | 26 ++++++++++++++++++++++++++ composer.json | 3 ++- src/MakeMoCommand.php | 8 ++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/settings.yml b/.github/settings.yml index c1981325..fe34f414 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -26,3 +26,5 @@ labels: color: c5def5 - name: command:i18n-make-json color: c5def5 + - name: command:i18n-make-mo + color: c5def5 diff --git a/README.md b/README.md index c56b59d7..ab82cdd2 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/composer.json b/composer.json index 213c9e59..323ac0ff 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,8 @@ "commands": [ "i18n", "i18n make-pot", - "i18n make-json" + "i18n make-json", + "i18n make-mo" ] }, "autoload": { diff --git a/src/MakeMoCommand.php b/src/MakeMoCommand.php index 34548084..22907844 100644 --- a/src/MakeMoCommand.php +++ b/src/MakeMoCommand.php @@ -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