[wp-meta] [Making WordPress.org] #1691: Internationalisation

Making WordPress.org noreply at wordpress.org
Sun Jun 5 21:23:51 UTC 2016

#1691: Internationalisation
 Reporter:  dd32              |       Owner:  ocean90
     Type:  task              |      Status:  reviewing
 Priority:  high              |   Milestone:  Plugin Directory v3 - M5
Component:  Plugin Directory  |  Resolution:
 Keywords:                    |

Comment (by ocean90):

 [attachment:1691.3.patch] is a first pass to display the translation of
 plugin names, the readme content, descriptions and screenshots.

 It uses a hidden post type `plugin_translated` and the filters
 `the_title`, `get_the_excerpt`, `get_post_metadata` and
 `wporg_plugins_content`. The last one is a custom filter because
 `get_the_content()` doesn't have a filter. I read through some core
 tickets and adding a filter there might be not the best idea. A filter in
 `get_post()` like proposed in #core12955 could be helpful here.

 To store the translation of plugin we can use
 $id = wp_insert_post( [
         'post_type'    => 'plugin_translated',
         'post_status'  => 'publish', // Inherit?
         'post_name'    => 'ja', // strtolower( get_locale() )
         'post_title'   => 'translated',
         'post_content' => "<!--section=description-->\nTranslated
 description\n<!--section=installation-->\nTranslated installation\n<!--
 section=changelog-->\nTranslated changelog",
         'post_excerpt' => 'translated',
         'post_parent'  => 180, // ID of a plugin post
 ], true );

 add_post_meta( $id, 'screenshots', [ 1 => 'Translated screenshot
 description', 2 => 'Translated screenshot description', 3 => 'Translated
 screenshot description', 4 => 'Translated screenshot description', 5 =>
 'Translated screenshot description' ] );

Ticket URL: <https://meta.trac.wordpress.org/ticket/1691#comment:11>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org

More information about the wp-meta mailing list