Skip to content

Commit

Permalink
Add example for update po command
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Mar 11, 2024
1 parent b722556 commit cab4e9b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,26 @@ This behaves similarly to the [msgmerge](https://www.gnu.org/software/gettext/ma
**OPTIONS**

<source>
Path to an existing POT file to use for updating
Path to an existing POT file to use for updating.

[<destination>]
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 same 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 from a POT file in the specific directory.
$ 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.
Expand Down
16 changes: 15 additions & 1 deletion src/UpdatePoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,26 @@ class UpdatePoCommand extends WP_CLI_Command {
* ## OPTIONS
*
* <source>
* : Path to an existing POT file to use for updating
* : Path to an existing POT file to use for updating.
*
* [<destination>]
* : 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 same 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 from a POT file in the specific directory.
* $ wp i18n update-po example-plugin.pot languages
* Success: Updated 2 files.
*
* @when before_wp_load
*
* @throws WP_CLI\ExitException
Expand Down

0 comments on commit cab4e9b

Please sign in to comment.