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

make-mo: Add destination file support #373

Conversation

sdnunca
Copy link

@sdnunca sdnunca commented Nov 16, 2023

Based on the discussion in #372, the MakeMo command should support a destination file name.

This PR allows you to specify a destination file name when the source is a file. When the source is a directory, providing a destination file name is not supported:

wp i18n make-mo foo.po -> unchanged behavior, writes foo.mo to same directory as foo.po
wp i18n make-mo foo.po bar.mo -> writes file to bar.mo
wp i18n make-mo foo/bar -> unchanged behavior, generates MO files for all PO files in the directory
wp i18n make-mo foo/bar baz.mo -> won't work!

@sdnunca sdnunca requested a review from a team as a code owner November 16, 2023 14:50
@sdnunca sdnunca force-pushed the feature/i18n-command-add-destination-file-support branch from dc14056 to fdf5181 Compare November 16, 2023 14:58
src/MakeMoCommand.php Outdated Show resolved Hide resolved
@sdnunca sdnunca force-pushed the feature/i18n-command-add-destination-file-support branch 3 times, most recently from d004b09 to 0943437 Compare November 16, 2023 15:42
@sdnunca sdnunca force-pushed the feature/i18n-command-add-destination-file-support branch from 0943437 to c5a4442 Compare November 16, 2023 15:53
@danielbachhuber danielbachhuber added this to the 2.5.0 milestone Nov 16, 2023
@danielbachhuber
Copy link
Member

Looks good to me! I'll let @swissspidy give it a final review.

@swissspidy swissspidy changed the title Add destination file support to MakePoCommand Nov 16, 2023
@swissspidy swissspidy merged commit 9cf9b40 into wp-cli:main Nov 16, 2023
65 checks passed
@swissspidy swissspidy linked an issue Nov 21, 2023 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants