diff --git a/README.md b/README.md index 7c4c013..10adbe2 100644 --- a/README.md +++ b/README.md @@ -270,12 +270,26 @@ This behaves similarly to the [msgmerge](https://www.gnu.org/software/gettext/ma **OPTIONS** - Path to an existing POT file to use for updating + Path to an existing POT file to use for updating. [] PO file to update or a directory containing multiple PO files. Defaults to all PO files in the source directory. +**EXAMPLES** + + # Update all PO files from a POT file in the current directory. + $ wp i18n update-po example-plugin.pot + Success: Updated 3 files. + + # Update a PO file from a POT file. + $ wp i18n update-po example-plugin.pot example-plugin-de_DE.po + Success: Updated 1 file. + + # Update all PO files in a given directory from a POT file. + $ wp i18n update-po example-plugin.pot languages + Success: Updated 2 files. + ## Installing This package is included with WP-CLI itself, no additional installation necessary. diff --git a/src/UpdatePoCommand.php b/src/UpdatePoCommand.php index e739e18..f46f131 100644 --- a/src/UpdatePoCommand.php +++ b/src/UpdatePoCommand.php @@ -21,12 +21,26 @@ class UpdatePoCommand extends WP_CLI_Command { * ## OPTIONS * * - * : Path to an existing POT file to use for updating + * : Path to an existing POT file to use for updating. * * [] * : PO file to update or a directory containing multiple PO files. * Defaults to all PO files in the source directory. * + * ## EXAMPLES + * + * # Update all PO files from a POT file in the current directory. + * $ wp i18n update-po example-plugin.pot + * Success: Updated 3 files. + * + * # Update a PO file from a POT file. + * $ wp i18n update-po example-plugin.pot example-plugin-de_DE.po + * Success: Updated 1 file. + * + * # Update all PO files in a given directory from a POT file. + * $ wp i18n update-po example-plugin.pot languages + * Success: Updated 2 files. + * * @when before_wp_load * * @throws WP_CLI\ExitException