Make WordPress Core

Changeset 40034


Ignore:
Timestamp:
01/31/2017 09:26:52 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Update/Install: Give context to some more install/update strings to allow for differentiation between theme and plugin translations.

Fixes #39747. See #37290.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/updates.js

    r40025 r40034  
    372372                        $updateRow = $( 'tr[data-plugin="' + args.plugin + '"]' );
    373373                        $message   = $updateRow.find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' );
    374                         message    = wp.updates.l10n.updatingLabel.replace( '%s', $updateRow.find( '.plugin-title strong' ).text() );
     374                        message    = wp.updates.l10n.pluginUpdatingLabel.replace( '%s', $updateRow.find( '.plugin-title strong' ).text() );
    375375                } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
    376376                        $card    = $( '.plugin-card-' + args.slug );
    377377                        $message = $card.find( '.update-now' ).addClass( 'updating-message' );
    378                         message  = wp.updates.l10n.updatingLabel.replace( '%s', $message.data( 'name' ) );
     378                        message  = wp.updates.l10n.pluginUpdatingLabel.replace( '%s', $message.data( 'name' ) );
    379379
    380380                        // Remove previous error messages, if any.
     
    430430
    431431                $updateMessage
    432                         .attr( 'aria-label', wp.updates.l10n.updatedLabel.replace( '%s', response.pluginName ) )
    433                         .text( wp.updates.l10n.updated );
     432                        .attr( 'aria-label', wp.updates.l10n.pluginUpdatedLabel.replace( '%s', response.pluginName ) )
     433                        .text( wp.updates.l10n.pluginUpdated );
    434434
    435435                wp.a11y.speak( wp.updates.l10n.updatedMsg, 'polite' );
     
    477477                        if ( response.pluginName ) {
    478478                                $message.find( 'p' )
    479                                         .attr( 'aria-label', wp.updates.l10n.updateFailedLabel.replace( '%s', response.pluginName ) );
     479                                        .attr( 'aria-label', wp.updates.l10n.pluginUpdateFailedLabel.replace( '%s', response.pluginName ) );
    480480                        } else {
    481481                                $message.find( 'p' ).removeAttr( 'aria-label' );
     
    494494                        if ( response.pluginName ) {
    495495                                $card.find( '.update-now' )
    496                                         .attr( 'aria-label', wp.updates.l10n.updateFailedLabel.replace( '%s', response.pluginName ) );
     496                                        .attr( 'aria-label', wp.updates.l10n.pluginUpdateFailedLabel.replace( '%s', response.pluginName ) );
    497497                        } else {
    498498                                $card.find( '.update-now' ).removeAttr( 'aria-label' );
     
    581581                        .addClass( 'updated-message installed button-disabled' )
    582582                        .attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) )
    583                         .text( wp.updates.l10n.installed );
     583                        .text( wp.updates.l10n.pluginInstalled );
    584584
    585585                wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
     
    966966                        updatedMessage = {
    967967                                className: 'updated-message notice-success notice-alt',
    968                                 message:   wp.updates.l10n.updated
     968                                message:   wp.updates.l10n.themeUpdated
    969969                        },
    970970                        $notice, newText;
     
    11031103                        .addClass( 'updated-message disabled' )
    11041104                        .attr( 'aria-label', wp.updates.l10n.themeInstalledLabel.replace( '%s', response.themeName ) )
    1105                         .text( wp.updates.l10n.installed );
     1105                        .text( wp.updates.l10n.themeInstalled );
    11061106
    11071107                wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
     
    17771777                                if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
    17781778                                        if ( 'update-plugin' === job.action ) {
    1779                                                 $message.attr( 'aria-label', wp.updates.l10n.updateNowLabel.replace( '%s', $message.data( 'name' ) ) );
     1779                                                $message.attr( 'aria-label', wp.updates.l10n.pluginUpdateNowLabel.replace( '%s', $message.data( 'name' ) ) );
    17801780                                        } else if ( 'install-plugin' === job.action ) {
    1781                                                 $message.attr( 'aria-label', wp.updates.l10n.installNowLabel.replace( '%s', $message.data( 'name' ) ) );
     1781                                                $message.attr( 'aria-label', wp.updates.l10n.pluginInstallNowLabel.replace( '%s', $message.data( 'name' ) ) );
    17821782                                        }
    17831783                                }
  • trunk/src/wp-includes/script-loader.php

    r40033 r40034  
    638638                                'noItemsSelected'            => __( 'Please select at least one item to perform this action on.' ),
    639639                                'updating'                   => __( 'Updating...' ), // No ellipsis.
    640                                 'updated'                    => __( 'Updated!' ),
     640                                'pluginUpdated'              => _x( 'Updated!', 'plugin' ),
     641                                'themeUpdated'               => _x( 'Updated!', 'theme' ),
    641642                                'update'                     => __( 'Update' ),
    642643                                'updateNow'                  => __( 'Update Now' ),
    643644                                /* translators: %s: Plugin name and version */
    644                                 'updateNowLabel'             => __( 'Update %s now' ),
     645                                'pluginUpdateNowLabel'       => _x( 'Update %s now', 'plugin' ),
    645646                                'updateFailedShort'          => __( 'Update Failed!' ),
    646647                                /* translators: %s: Error string for a failed update */
    647648                                'updateFailed'               => __( 'Update Failed: %s' ),
    648649                                /* translators: %s: Plugin name and version */
    649                                 'updatingLabel'              => __( 'Updating %s...' ), // No ellipsis.
     650                                'pluginUpdatingLabel'        => _x( 'Updating %s...', 'plugin' ), // No ellipsis.
    650651                                /* translators: %s: Plugin name and version */
    651                                 'updatedLabel'               => __( '%s updated!' ),
     652                                'pluginUpdatedLabel'         => _x( '%s updated!', 'plugin' ),
    652653                                /* translators: %s: Plugin name and version */
    653                                 'updateFailedLabel'          => __( '%s update failed' ),
     654                                'pluginUpdateFailedLabel'    => _x( '%s update failed', 'plugin' ),
    654655                                /* translators: Accessibility text */
    655656                                'updatingMsg'                => __( 'Updating... please wait.' ), // No ellipsis.
     
    661662                                'installNow'                 => __( 'Install Now' ),
    662663                                /* translators: %s: Plugin name */
    663                                 'installNowLabel'            => __( 'Install %s now' ),
     664                                'pluginInstallNowLabel'      => _x( 'Install %s now', 'plugin' ),
    664665                                'installing'                 => __( 'Installing...' ),
    665                                 'installed'                  => __( 'Installed!' ),
     666                                'pluginInstalled'            => _x( 'Installed!', 'plugin' ),
     667                                'themeInstalled'             => _x( 'Installed!', 'theme' ),
    666668                                'installFailedShort'         => __( 'Install Failed!' ),
    667669                                /* translators: %s: Error string for a failed installation */
  • trunk/tests/qunit/fixtures/updates.js

    r38221 r40034  
    77                'noItemsSelected': 'Please select at least one item to perform this action on.',
    88                'updating': 'Updating...',
    9                 'updated': 'Updated!',
     9                'pluginUpdated': 'Updated!',
     10                'themeUpdated': 'Updated!',
    1011                'update': 'Update',
    1112                'updateNow': 'Update Now',
    12                 'updateNowLabel': 'Update %s now',
     13                'pluginUpdateNowLabel': 'Update %s now',
    1314                'updateFailedShort': 'Update Failed!',
    1415                'updateFailed': 'Update Failed: %s',
    15                 'updatingLabel': 'Updating %s...',
    16                 'updatedLabel': '%s updated!',
    17                 'updateFailedLabel': '%s update failed',
     16                'pluginUpdatingLabel': 'Updating %s...',
     17                'pluginUpdatedLabel': '%s updated!',
     18                'pluginUpdateFailedLabel': '%s update failed',
    1819                'updatingMsg': 'Updating... please wait.',
    1920                'updatedMsg': 'Update completed successfully.',
     
    2122                'beforeunload': 'Updates may not complete if you navigate away from this page.',
    2223                'installNow': 'Install Now',
    23                 'installNowLabel': 'Install %s now',
     24                'pluginInstallNowLabel': 'Install %s now',
    2425                'installing': 'Installing...',
    25                 'installed': 'Installed!',
     26                'pluginInstalled': 'Installed!',
     27                'themeInstalled': 'Installed!',
    2628                'installFailedShort': 'Install Failed!',
    2729                'installFailed': 'Installation failed: %s',
Note: See TracChangeset for help on using the changeset viewer.