api.w.org needs locale for pattern translation #32754
Labels
REST API Interaction
Related to REST API
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
#28800 moved Core's block patterns out of Gutenberg and into the w.org Pattern Directory, which means they're no longer translated by Gutenberg. api.w.org will handle translation, but needs to know the user's locale.
Knowing the WP version might also help with caching, and let the API avoid sending newer patterns to old WP versions which don't have the dependent blocks, etc.
What is your proposed solution?
The locale and version can be added to the API request, similar to how the Events Widget
https://github.com/WordPress/wordpress-develop/blob/81182b52ef9a59dc157191d77e130fe166fb2adf/src/wp-admin/includes/class-wp-community-events.php#L198
https://github.com/WordPress/wordpress-develop/blob/81182b52ef9a59dc157191d77e130fe166fb2adf/src/wp-admin/includes/class-wp-community-events.php#L102
I'm planning to open a PR tonight or tomorrow.
The text was updated successfully, but these errors were encountered: