Make WordPress Core

Ticket #49151: 49151.3.diff

File 49151.3.diff, 4.4 KB (added by garrett-eclipse, 3 years ago)

Further improve the language of the translator comments.

  • src/wp-admin/includes/class-wp-debug-data.php

     
    3535        static function debug_data() {
    3636                global $wpdb;
    3737
     38                include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // For plugins_api().
     39                include_once ABSPATH . 'wp-admin/includes/theme.php'; // For themes_api().
     40
    3841                // Save few function calls.
    3942                $upload_dir             = wp_upload_dir();
    4043                $permalink_structure    = get_option( 'permalink_structure' );
     
    880883                        $plugin_version = $plugin['Version'];
    881884                        $plugin_author  = $plugin['Author'];
    882885
     886                        $plugin_slug = explode( '/', $plugin_path );
     887                        $plugin_info = plugins_api(
     888                                'plugin_information',
     889                                array(
     890                                        'slug'   => $plugin_slug[0],
     891                                        'fields' => array(
     892                                                'last_updated',
     893                                        ),
     894                                )
     895                        );
     896
    883897                        $plugin_version_string       = __( 'No version or author information is available.' );
    884898                        $plugin_version_string_debug = 'author: (undefined), version: (undefined)';
    885899
     
    10091023                                $plugin_version_string_debug .= ', ' . $auto_updates_string;
    10101024                        }
    10111025
     1026                        if ( isset( $plugin_info->last_updated ) ) {
     1027                                $plugin_version_string .= sprintf(
     1028                                        /* translators: %s: Time since last plugin release. */
     1029                                        __( ' | Last Plugin release: %s ago' ),
     1030                                        human_time_diff( strtotime( $plugin_info->last_updated ),current_time( 'timestamp' ) )
     1031                                );
     1032
     1033                                $plugin_version_string_debug .= sprintf(
     1034                                        /* translators: %s: Time since last plugin release. */
     1035                                        __( ', last plugin release: %s ago' ),
     1036                                        human_time_diff( strtotime( $plugin_info->last_updated ), current_time( 'timestamp' ) )
     1037                                );
     1038                        }
     1039
    10121040                        $info[ $plugin_part ]['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array(
    10131041                                'label' => $plugin['Name'],
    10141042                                'value' => $plugin_version_string,
     
    10391067                        $auto_updates = (array) get_site_option( 'auto_update_themes', array() );
    10401068                }
    10411069
     1070                $active_theme_info = themes_api(
     1071                        'theme_information',
     1072                        array(
     1073                                'slug'   => $active_theme->template,
     1074                                'fields' => 'last_updated',
     1075                        )
     1076                );
     1077
    10421078                if ( array_key_exists( $active_theme->stylesheet, $theme_updates ) ) {
    10431079                        $theme_update_new_version = $theme_updates[ $active_theme->stylesheet ]->update['new_version'];
    10441080
     
    11471183                        );
    11481184                }
    11491185
     1186                if ( isset( $active_theme->last_updated ) ) {
     1187                        $info['wp-active-theme']['fields']['last_release'] = array(
     1188                                'label' => __( 'Last Theme Release' ),
     1189                                'value' => sprintf(
     1190                                        /* translators: %s: Time since last theme release. */
     1191                                        __( '%s ago' ),
     1192                                        human_time_diff( strtotime( $active_theme_info->last_updated ), current_time( 'timestamp' ) )
     1193                                ),
     1194                                'debug' => sprintf(
     1195                                        /* translators: %s: Time since last theme release. */
     1196                                        __( '%s ago' ),
     1197                                        human_time_diff( strtotime( $active_theme_info->last_updated ), current_time( 'timestamp' ) )
     1198                                ),
     1199                        );
     1200                }
     1201
    11501202                $parent_theme = $active_theme->parent();
    11511203
    11521204                if ( $parent_theme ) {
     
    12591311                        $theme_version_string       = __( 'No version or author information is available.' );
    12601312                        $theme_version_string_debug = 'undefined';
    12611313
     1314                        $theme_info = themes_api(
     1315                                'theme_information',
     1316                                array(
     1317                                        'slug'   => $theme_slug,
     1318                                        'fields' => 'last_updated',
     1319                                )
     1320                        );
     1321
    12621322                        if ( ! empty( $theme_version ) && ! empty( $theme_author ) ) {
    12631323                                /* translators: 1: Theme version number. 2: Theme author name. */
    12641324                                $theme_version_string       = sprintf( __( 'Version %1$s by %2$s' ), $theme_version, $theme_author );
     
    13301390                                $theme_version_string_debug .= ',' . $auto_updates_string;
    13311391                        }
    13321392
     1393                        if ( isset( $theme_info->last_updated ) ) {
     1394                                $theme_version_string .= sprintf(
     1395                                        /* translators: %s: Time since last theme release. */
     1396                                        __( ' | Last Theme release: %s ago' ),
     1397                                        human_time_diff( strtotime( $theme_info->last_updated ), current_time( 'timestamp' ) )
     1398                                );
     1399
     1400                                $theme_version_string_debug .= sprintf(
     1401                                        /* translators: %s: Time since last theme release. */
     1402                                        __( ', last theme release: %s ago' ),
     1403                                        human_time_diff( strtotime( $theme_info->last_updated ), current_time( 'timestamp' ) )
     1404                                );
     1405                        }
     1406
    13331407                        $info['wp-themes-inactive']['fields'][ sanitize_text_field( $theme->name ) ] = array(
    13341408                                'label' => sprintf(
    13351409                                        /* translators: 1: Theme name. 2: Theme slug. */