wp-cli / i18n-command

Provides internationalization tools for WordPress projects.
MIT License
96 stars 52 forks source link

`make-mo`: Add destination file support #373

Closed sdnunca closed 8 months ago

sdnunca commented 8 months ago

Based on the discussion in #372, the MakeMocommand 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!

danielbachhuber commented 8 months ago

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