[wp-meta] [Making WordPress.org] #3935: Language specific screenshots
Making WordPress.org
noreply at wordpress.org
Fri May 3 07:17:27 UTC 2019
#3935: Language specific screenshots
------------------------------+---------------------
Reporter: f.staude | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Plugin Directory | Resolution:
Keywords: has-patch |
------------------------------+---------------------
Comment (by dd32):
@ck3lee nice work!
In [8729] I've rearranged a bit of the code, and generalised it more to
allow it to work with the API components.
Some things I noticed while working with the patch
- In `reduce_screenshots_with_locale()` it was expecting that the new
`$image['locale']` field was always set, where it won't be for any older
screenshot meta, In the above commit i simply flipped the first two if
conditionals to account for that
- Images with locales such as `de_DE` and `de_CH` work as intended, but
`de_DE_informal` will fall back to `de_CH` if it exists as it's lower in
the alphabet. I left it as-is there as it's pretty minor and no plugins
yet have these anyway :)
Updating it to support the API was required as otherwise the images were
duplicated within WordPress installs, you can see the API responses
[https://wordpress.org/plugins/wp-json/plugins/v1/plugin/test-
plugin-3?locale=de_CH here] and [https://de.wordpress.org/plugins/wp-
json/wp/v2/plugin/87 here] (Note: Using those APIs directly isn't
encouraged, but it's good for testing. All API clients should be using
[https://api.wordpress.org/plugins/info/1.2/ api.wordpress.org] instead
which is heavily cached).
Testing was performed with one of my test plugins, for those who would
like to see it in action compare [https://wordpress.org/plugins/test-
plugin-3/#screenshots English] to [https://ary.wordpress.org/plugins/test-
plugin-3/#screenshots German] to [https://ary.wordpress.org/plugins/test-
plugin-3/#screenshots Moroccan Arabic].
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/3935#comment:8>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list