Make WordPress Core


Ignore:
Timestamp:
02/26/2024 08:33:46 PM (16 months ago)
Author:
swissspidy
Message:

Upgrade/Install: Improve localized strings related to plugin/theme installation and activation.

Adds context to strings where applicable to disambiguate them, coherently throughout the admin. Also improves some of the strings introduced in [57545] to ease localization.

Props swissspidy, costdev.
Fixes #60630. See #22316.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r57620 r57714  
    608608
    609609        if ( 'active' !== $status ) {
    610             $actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' );
     610            $actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? _x( 'Network Activate', 'plugin' ) : _x( 'Activate', 'plugin' );
    611611        }
    612612
    613613        if ( 'inactive' !== $status && 'recent' !== $status ) {
    614             $actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' );
     614            $actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? _x( 'Network Deactivate', 'plugin' ) : _x( 'Deactivate', 'plugin' );
    615615        }
    616616
     
    821821                                /* translators: %s: Plugin name. */
    822822                                esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ),
    823                                 __( 'Network Deactivate' )
     823                                _x( 'Network Deactivate', 'plugin' )
    824824                            );
    825825                        }
     
    829829                        if ( $compatible_php && $compatible_wp ) {
    830830                            if ( $has_unmet_dependencies ) {
    831                                 $actions['activate'] = __( 'Network Activate' ) .
     831                                $actions['activate'] = _x( 'Network Activate', 'plugin' ) .
    832832                                    '<span class="screen-reader-text">' .
    833833                                    __( 'You cannot activate this plugin as it has unmet requirements.' ) .
     
    846846                                    /* translators: %s: Plugin name. */
    847847                                    esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ),
    848                                     __( 'Network Activate' )
     848                                    _x( 'Network Activate', 'plugin' )
    849849                                );
    850850                            }
     
    935935                        if ( $compatible_php && $compatible_wp ) {
    936936                            if ( $has_unmet_dependencies ) {
    937                                 $actions['activate'] = __( 'Activate' ) .
     937                                $actions['activate'] = _x( 'Activate', 'plugin' ) .
    938938                                    '<span class="screen-reader-text">' .
    939939                                    __( 'You cannot activate this plugin as it has unmet requirements.' ) .
     
    952952                                    /* translators: %s: Plugin name. */
    953953                                    esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ),
    954                                     __( 'Activate' )
     954                                    _x( 'Activate', 'plugin' )
    955955                                );
    956956                            }
     
    15331533        }
    15341534
    1535         $dependency_note = __( 'Note: this plugin cannot be deactivated or deleted until the plugins that require it are deactivated or deleted.' );
     1535        $dependency_note = __( 'Note: This plugin cannot be deactivated or deleted until the plugins that require it are deactivated or deleted.' );
     1536
     1537        $comma       = wp_get_list_item_separator();
     1538        $required_by = sprintf(
     1539            /* translators: %s: List of dependencies. */
     1540            __( '<strong>Required by:</strong> %s' ),
     1541            implode( $comma, $dependent_names )
     1542        );
     1543
    15361544        printf(
    1537             '<div class="required-by"><p><strong>%1$s</strong> %2$s</p><p>%3$s</p></div>',
    1538             __( 'Required by:' ),
    1539             esc_html( implode( ' | ', $dependent_names ) ),
     1545            '<div class="required-by"><p>%1$s</p><p>%2$s</p></div>',
     1546            $required_by,
    15401547            $dependency_note
    15411548        );
     
    15611568        }
    15621569
    1563         $dependency_note = __( 'Note: this plugin cannot be activated until the plugins that are required by it are activated.' );
     1570        $dependency_note = __( 'Note: This plugin cannot be activated until the plugins that are required by it are activated.' );
     1571
     1572        $comma    = wp_get_list_item_separator();
     1573        $requires = sprintf(
     1574            /* translators: %s: List of dependency names. */
     1575            __( '<strong>Requires:</strong> %s' ),
     1576            implode( $comma, $links )
     1577        );
    15641578
    15651579        printf(
    1566             '<div class="requires"><p><strong>%1$s</strong> %2$s</p><p>%3$s</p></div>',
    1567             __( 'Requires:' ),
    1568             implode( ' | ', $links ),
     1580            '<div class="requires"><p>%1$s</p><p>%2$s</p></div>',
     1581            $requires,
    15691582            $dependency_note
    15701583        );
Note: See TracChangeset for help on using the changeset viewer.