Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#53435 closed task (blessed) (fixed)

api.w.org needs locale for pattern translation

Reported by: iandunn Owned by: iandunn
Priority: high Milestone: 5.8
Component: Editor Version: 5.8
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

This ticket is to track merging the upstream issue #32754-gutenberg

#53246 moved Core's block patterns out of Core and into the w.org Pattern Directory, which means they're no longer translated by Core. 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.

We're past the feature freeze date, but this is a trivial change on the Core side, and very important for the pattern directory, so I've added it to the 5.8 milestone. I'm happy to consider other options if folks have concerns, though.

I'm planning to open a PR tonight or tomorrow.

Change History (7)

This ticket was mentioned in PR #1390 on WordPress/wordpress-develop by iandunn.


5 years ago
#1

  • Keywords has-patch added

This information is needed by the w.org API for translation and caching.

Trac ticket: https://core.trac.wordpress.org/ticket/53435

#2 @iandunn
5 years ago

  • Owner set to iandunn
  • Status newassigned

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


5 years ago

TimothyBJacobs commented on PR #1390:


5 years ago
#4

I agree with @ocean90 about the cache placement. Aside from that, code looks good to me.

#5 @iandunn
5 years ago

In 51206:

Block Editor: Send locale, version with remote pattern requests.

This information is needed by the w.org API for translation and caching.

Props dd32, ryelle, tellyworth
See #53435

#6 @iandunn
5 years ago

  • Resolutionfixed
  • Status assignedclosed

In 51208:

Block Editor: Move caching to endpoint for unique responses.

Now that the pattern API request includes the locale and version, the cache key needs to contain a hash of the query args.

Props ocean90, dd32, timothyblynjacobs
Fixes #53435

Note: See TracTickets for help on using tickets.