Skip to content

make-mo: Add destination file support#373

Merged
swissspidy merged 1 commit intowp-cli:mainfrom
sdnunca:feature/i18n-command-add-destination-file-support
Nov 16, 2023
Merged

make-mo: Add destination file support#373
swissspidy merged 1 commit intowp-cli:mainfrom
sdnunca:feature/i18n-command-add-destination-file-support

Conversation

@sdnunca
Copy link
Copy Markdown

@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
@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 the command:i18n-make-mo Related to 'i18n make-mo' command label Nov 16, 2023
@danielbachhuber danielbachhuber added this to the 2.5.0 milestone Nov 16, 2023
@danielbachhuber
Copy link
Copy Markdown
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 make-mo: Add destination file support Nov 16, 2023
@swissspidy swissspidy merged commit 9cf9b40 into wp-cli:main Nov 16, 2023
@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

Labels

command:i18n-make-mo Related to 'i18n make-mo' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make-mo: Add option to specify filename

3 participants