Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add example for update po command
  • Loading branch information
ernilambar committed Mar 11, 2024
commit cab4e9bbdfa8bd6784f0988769b62836cde86c7b
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