Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples for wp i18n update-po command #392

Merged
merged 2 commits into from
Mar 11, 2024
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
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.
ernilambar marked this conversation as resolved.
Show resolved Hide resolved
* $ 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.
ernilambar marked this conversation as resolved.
Show resolved Hide resolved
* $ wp i18n update-po example-plugin.pot languages
* Success: Updated 2 files.
*
* @when before_wp_load
*
* @throws WP_CLI\ExitException
Expand Down