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 wp i18n make-mo command. #214

Merged
merged 5 commits into from Jun 4, 2020
Merged

Conversation

@gedex
Copy link
Contributor

@gedex gedex commented Jun 2, 2020

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 as a code owner Jun 2, 2020
@swissspidy
Copy link
Member

@swissspidy swissspidy commented Jun 2, 2020

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
Copy link
Contributor Author

@gedex gedex commented Jun 2, 2020

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
Member

@schlessera schlessera commented Jun 4, 2020

Great work, @gedex , thanks for the PR!

@schlessera schlessera merged commit 7a5d483 into wp-cli:master Jun 4, 2020
3 checks passed
3 checks passed
@github-actions[bot]
Lint PHP files
Details
@github-actions[bot]
PHPCS
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gedex gedex deleted the add/141-add-make-mo-cmd branch Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

3 participants