-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Use namespace for textdomain when --no-plugin is in use #54980
Comments
Thank you for the report. That's a valid issue because we assume that the
The solution would be to offer another prompt that shows up in the plugin section in the regular flow, but also when creating a block without a plugin. |
Hi, I created this PR which makes another prompt in the block scaffolding flow to add |
@vampdroid, thank you for working on it. I hope it won't take too long to review and test it. I'll keep an eye on it. |
@vampdroid I added some comments to the PR. |
Thanks a lot @gziolo and @ryanwelcher 🙇 |
Resolved with #57197. |
Description
When scaffolding a new block with
@wordpress/create-block
and the--no-plugin
flag, the textdomain in block.json is being set to the slug of the block. In the case where a plugin has already been set up (when--no-plugin
would be used) and additional blocks are being added to it, this means that each block has the wrong textdomain. It's more likely that the namespace for each block will be better to use for the textdomain, as it should be consistent across blocks. Alternatively, a custom textdomain could be set up during the interactive scaffolding process, or the ability to set a default in the block metadata template.Step-by-step reproduction instructions
npx @wordpress/create-block --no-plugin
in the blocks directory of an existing plugin.textdomain
has been set to the slug instead of the namespace.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: