Skip to content

Commit

Permalink
Merge pull request #392 from ernilambar/add/updatepo-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Mar 11, 2024
2 parents b722556 + 2e9866c commit e29d181
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 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.
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 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
Expand Down

0 comments on commit e29d181

Please sign in to comment.