Making WordPress.org


Ignore:
Timestamp:
01/24/2017 10:59:27 AM (8 years ago)
Author:
dd32
Message:

Plugin Directory: Use translated data for the api.wordpress.org info endpoint.

  • Also translates screenshot titles on the front end
  • Also uses plugin tags in API info endpoint rather than defunct categories.

See #2112
Fixes #2415

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-screenshots.php

    r4622 r4764  
    22namespace WordPressdotorg\Plugin_Directory\Shortcodes;
    33use WordPressdotorg\Plugin_Directory\Template;
     4use WordPressdotorg\Plugin_Directory\Plugin_i18n;
    45
    56/**
     
    3536
    3637            if ( $descriptions && ! empty( $descriptions[ (int)$image['resolution'] ] ) ) {
    37                 $screen_shot .= '<figcaption>' . $descriptions[ (int)$image['resolution'] ] . '</figcaption>';
     38                $caption = $descriptions[ (int)$image['resolution'] ];
     39                $caption = Plugin_I18n::instance()->translate( 'screenshot-' . $image['resolution'], $caption, [ 'post_id' => $$plugin->ID ] );
     40                $screen_shot .= '<figcaption>' . $caption . '</figcaption>';
    3841            }
    3942
Note: See TracChangeset for help on using the changeset viewer.