Skip to content

Conversation

@sun
Copy link

@sun sun commented Apr 11, 2025

Follow-up to

Problem

The documentation on https://developer.wordpress.org/cli/commands/i18n/make-mo/ and in the help is inaccurate and misleading. It states:

# Create a MO file from a single PO file in a specific directory.
$ wp i18n make-mo example-plugin-de_DE.po languages

But the suggested command yields an error:

$ wp i18n make-mo woocommerce-de_DE.po wp-content/languages/plugins
Error: Source file or directory does not exist.

The correct command argument is to just specify the file including path:

$ wp i18n make-mo wp-content/languages/plugins/woocommerce-de_DE.po
Success: Created 1 file.

Proposed solution

Correct the documentation.

@sun sun requested a review from a team as a code owner April 11, 2025 12:07
@sun sun mentioned this pull request Apr 11, 2025
1 task
@codecov
Copy link

codecov bot commented Apr 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@sun sun changed the title Fixed inaccurate command arguments. Fixed inaccurate make-mo command arguments. Apr 11, 2025
@sun sun changed the title Fixed inaccurate make-mo command arguments. Fixed inaccurate make-mo command arguments docs. Apr 11, 2025
@swissspidy
Copy link
Member

Thanks for opening this. Not sure about the suggested changes 🤔

wp make-mo <source> [<destination>] is definitely supported and covered by our tests.

wp i18n make-mo woocommerce-de_DE.po wp-content/languages/plugins definitely works, if there is a woocommerce-de_DE.po in the current working directory.

It sounds like you're trying to run the command from a different directory where that file doesn't exist, in which case of course it will fail. And then, yes, wp i18n make-mo path/to/my/translations/woocommerce-de_DE.po works. But that's different from wp i18n make-mo path/to/my/translations/woocommerce-de_DE.po path/to/destination/folder

@swissspidy
Copy link
Member

Closing as per the above

@swissspidy swissspidy closed this Apr 12, 2025
@sun
Copy link
Author

sun commented Apr 12, 2025

That is not what the documentation suggests. Specifically, to run the command inside of the directory already.

I understand you want to keep the queue clean by closing this, but it’s a bit too quick and premature.

@swissspidy
Copy link
Member

I‘m happy to accept a docs change with a better example, but the current suggested change js just wrong and doesn‘t match the description.

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.

2 participants