-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Closed as not planned
Copy link
Labels
Internationalization (i18n)Issues or PRs related to internationalization effortsIssues or PRs related to internationalization efforts[Type] WP Core TicketRequires an upstream change from WordPress. Core Trac ticket should be linked.Requires an upstream change from WordPress. Core Trac ticket should be linked.
Description
Description
When registering blocks from PHP, either by using register_block_type or wp_register_block_types_from_metadata_collection, they use under the hood register_block_type_from_metadata. This function in turn attempts to load translations from plugin root. It is much more common, and would be a good practice to offer a choice from where it should be loaded, and that is typically /languages folder.
Step-by-step reproduction instructions
Use register_block_type or wp_register_block_types_from_metadata_collection to register a block(s).
Create some translations for block.json metadata like block title etc. Use query monitor plugin to debug and see from where is loading of translations attempted.
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
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Metadata
Metadata
Assignees
Labels
Internationalization (i18n)Issues or PRs related to internationalization effortsIssues or PRs related to internationalization efforts[Type] WP Core TicketRequires an upstream change from WordPress. Core Trac ticket should be linked.Requires an upstream change from WordPress. Core Trac ticket should be linked.