-
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
Comment Query Loop block not translated. #41292
Comments
I will be happy to take a look at it |
Please note: since opening this issue I've edited it as it appears to be a general translation issue in the comment query loop block. @c4rl0sbr4v0 Thank you! Please be aware that in the When it comes time to merging the fix for WP 6.0, the team can manage moving around the files if you wish. |
In WordPress trunk, as you mention, without Gutenberg, is taking the data from In the Gutenberg repo, if we update the
to
I'm afraid I am stuck here. I don't know how to address this fix in the code, as there seem to be more variables happening (the JS to PHP translatable string function, I guess), but I don't know if we do more steps during the deployment of a version. |
cc @ocean90 in case this is related to language packs |
Block titles and descriptions are usually taken from block.json if available, but that only works for server-side registered blocks. The Registering it server-side fixes the issue, but there's probably a reason why it wasn't done like this. Plus, the same problem might exist for other blocks as well. @gziolo Perhaps you have some ideas here? |
It looks like we missed listing https://github.com/WordPress/wordpress-develop/blob/6.0/src/wp-includes/blocks/index.php This is going to be addressed with WordPress/wordpress-develop#2647 in the |
Yep, because we only pass translations from JS files there, not JSON files. |
In practice, we bundle the JSON file into the JS file. We might be able to revisit that approach as soon as the proposal for import assertions for JSON becomes the standard in JS: https://github.com/tc39/proposal-import-assertions (stage 3 as of today) and we start using it. |
Right, but during string extraction we can only extract the block name/description from |
Right, now I remember how complex this use case was. I guess a proper server-side registration is the best approach I can think of in the short term 👍🏻 |
I created a PR on wordpress-develop to fix it. But there are a few unit tests failing. Does anyone know what could it be? |
Description
This was originally reported by @c4rl0sbr4v0 as WP#55809.
I (Peter) suspect the data is being pulled from
block.json
rather than included as a translatable string within the block's JavaScript files.@mukeshpanchal27 posted a follow-up comment that the description is also not translated so it appears to be a general translation issue with the comment query loop.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Other data was not provided but I suspect it was without the Gutenberg plugin activated as the block has been renamed in trunk.
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: