Skip to content

Add wp i18n make-mo command. - #214

Merged
schlessera merged 5 commits into
wp-cli:masterfrom
gedex:add/141-add-make-mo-cmd
Jun 4, 2020
Merged

schlessera merged 5 commits into
wp-cli:masterfrom
gedex:add/141-add-make-mo-cmd

Conversation

@gedex

@gedex gedex commented Jun 2, 2020 •

Copy link
Copy Markdown
Contributor

This adds new i18n command make-mo to generate MO files from PO file(s). Examples:

// Reads from a single .po file
$ wp i18n make-mo ./wp-content/languages/slug.po
Success: Created 1 file.

// Reads from a directory—for multiple .po files.
$ wp i18n make-mo ./wp-content/languages/
Success: Created 5 files.

No unit tests added—relies on Gettext\Translations::toMoFile() that may cover the po-to-mo conversion tests.

Resolves #141.

@gedex
gedex requested a review from a team as a code owner June 2, 2020 17:09
@swissspidy

Copy link
Copy Markdown
Member

Looks nice at first glance! Thanks for your contribution 🚀

Would you be able to provide some Behat tests for this new command to test the behavior?

Let me know if you need help with that.

@gedex

gedex commented Jun 2, 2020

Copy link
Copy Markdown
Contributor Author

Would you be able to provide some Behat tests for this new command to test the behavior?

I added a basic test in 0f954da.

Also, added a simple test for checking translation.
@schlessera schlessera added this to the 2.2.3 milestone Jun 4, 2020
@schlessera

Copy link
Copy Markdown
Member

Great work, @gedex , thanks for the PR!

@schlessera
schlessera merged commit 7a5d483 into wp-cli:master Jun 4, 2020
@gedex
gedex deleted the add/141-add-make-mo-cmd branch June 5, 2020 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New command: make-mo

3 participants