Changeset 38057
- Timestamp:
- 07/13/2016 05:31:15 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r38033 r38057 3345 3345 } 3346 3346 3347 $status['themeName'] = wp_get_theme( $slug )->get( 'Name' ); 3348 3347 3349 if ( current_user_can( 'switch_themes' ) ) { 3348 3350 if ( is_multisite() ) { -
trunk/src/wp-admin/includes/theme.php
r38025 r38057 636 636 <div class="theme-actions"> 637 637 <div class="inactive-theme"> 638 <a href="<?php echo $preview_url; ?>" target="_top" class="button button-primary"><?php _e( 'Live Preview' ); ?></a> 638 <?php 639 /* translators: %s: Theme name */ 640 $aria_label = sprintf( __( 'Preview %s' ), '{{ data.name }}' ); 641 ?> 642 <a href="<?php echo $preview_url; ?>" target="_top" class="button button-primary" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Live Preview' ); ?></a> 639 643 </div> 640 644 </div> -
trunk/src/wp-admin/includes/update.php
r37714 r38057 691 691 * @type string content The row content. 692 692 * } 693 * 693 * 694 694 * The delete template takes one argument with four values: 695 695 * … … 717 717 <tr class="plugin-deleted-tr inactive deleted" id="{{ data.slug }}-deleted" data-slug="{{ data.slug }}" <# if ( data.plugin ) { #>data-plugin="{{ data.plugin }}"<# } #>> 718 718 <td colspan="{{ data.colspan }}" class="plugin-update colspanchange"> 719 <?php 720 printf( 721 /* translators: %s: Plugin or Theme name */ 722 __( '%s was successfully deleted.' ), 723 '<strong>{{{ data.name }}}</strong>' 724 ); 725 ?> 719 <# if ( data.plugin ) { #> 720 <?php 721 printf( 722 /* translators: %s: Plugin name */ 723 _x( '%s was successfully deleted.', 'plugin' ), 724 '<strong>{{{ data.name }}}</strong>' 725 ); 726 ?> 727 <# } else { #> 728 <?php 729 printf( 730 /* translators: %s: Theme name */ 731 _x( '%s was successfully deleted.', 'theme' ), 732 '<strong>{{{ data.name }}}</strong>' 733 ); 734 ?> 735 <# } #> 726 736 </td> 727 737 </tr> -
trunk/src/wp-admin/js/updates.js
r38033 r38057 509 509 } 510 510 511 $message.addClass( 'updating-message' ); 511 $message 512 .addClass( 'updating-message' ) 513 .attr( 'aria-label', wp.updates.l10n.pluginInstallingLabel.replace( '%s', $message.data( 'name' ) ) ); 512 514 513 515 wp.a11y.speak( wp.updates.l10n.installingMsg, 'polite' ); … … 536 538 .removeClass( 'updating-message' ) 537 539 .addClass( 'updated-message installed button-disabled' ) 540 .attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) ) 538 541 .text( wp.updates.l10n.installed ); 539 542 … … 548 551 $message.removeClass( 'install-now installed button-disabled updated-message' ).addClass( 'activate-now button-primary' ) 549 552 .attr( 'href', response.activateUrl ) 553 .attr( 'aria-label', wp.updates.l10n.activatePluginLabel.replace( '%s', response.pluginName ) ) 550 554 .text( wp.updates.l10n.activatePlugin ); 551 555 }, 1000 ); … … 596 600 $button 597 601 .removeClass( 'updating-message' ).addClass( 'button-disabled' ) 598 .attr( 'aria-label', wp.updates.l10n. installFailedLabel.replace( '%s', response.pluginName) )602 .attr( 'aria-label', wp.updates.l10n.pluginInstallFailedLabel.replace( '%s', $button.data( 'name' ) ) ) 599 603 .text( wp.updates.l10n.installFailedShort ); 600 604 … … 1004 1008 } 1005 1009 1006 $message.text( wp.updates.l10n.installing ); 1010 $message 1011 .text( wp.updates.l10n.installing ) 1012 .attr( 'aria-label', wp.updates.l10n.themeInstallingLabel.replace( '%s', $message.data( 'name' ) ) ); 1007 1013 wp.a11y.speak( wp.updates.l10n.installingMsg, 'polite' ); 1008 1014 … … 1033 1039 .removeClass( 'updating-message' ) 1034 1040 .addClass( 'updated-message disabled' ) 1041 .attr( 'aria-label', wp.updates.l10n.themeInstalledLabel.replace( '%s', response.themeName ) ) 1035 1042 .text( wp.updates.l10n.installed ); 1036 1043 … … 1046 1053 .removeClass( 'theme-install updated-message disabled' ) 1047 1054 .addClass( 'activate' ) 1055 .attr( 'aria-label', wp.updates.l10n.activateThemeLabel.replace( '%s', response.themeName ) ) 1048 1056 .text( wp.updates.l10n.activateTheme ); 1049 1057 } … … 1099 1107 $button 1100 1108 .removeClass( 'updating-message' ) 1101 .attr( 'aria-label', wp.updates.l10n. installFailedLabel.replace( '%s', $card.find( '.theme-name' ).text() ) )1109 .attr( 'aria-label', wp.updates.l10n.themeInstallFailedLabel.replace( '%s', $button.data( 'name' ) ) ) 1102 1110 .text( wp.updates.l10n.installFailedShort ); 1103 1111 -
trunk/src/wp-admin/theme-install.php
r37914 r38057 249 249 <div class="theme-actions"> 250 250 <# if ( data.installed ) { #> 251 <?php 252 /* translators: %s: Theme name */ 253 $aria_label = sprintf( __( 'Activate %s' ), '{{ data.name }}' ); 254 ?> 251 255 <# if ( data.activate_url ) { #> 252 <a class="button button-primary activate" href="{{ data.activate_url }}" ><?php esc_html_e( 'Activate' ); ?></a>256 <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> 253 257 <# } #> 254 258 <# if ( data.customize_url ) { #> 255 <a class="button button-secondary load-customize" href="{{ data.customize_url }}"><?php esc_html_e( 'Live Preview' ); ?></a>259 <a class="button button-secondary load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a> 256 260 <# } else { #> 257 <button class="button-secondary preview install-theme-preview"><?php esc_html_e( 'Preview' ); ?></button>261 <button class="button-secondary preview install-theme-preview"><?php _e( 'Preview' ); ?></button> 258 262 <# } #> 259 263 <# } else { #> 260 <a class="button button-primary theme-install" data-slug="{{ data.id }}" href="{{ data.install_url }}"><?php esc_html_e( 'Install' ); ?></a> 261 <button class="button-secondary preview install-theme-preview"><?php esc_html_e( 'Preview' ); ?></button> 264 <?php 265 /* translators: %s: Theme name */ 266 $aria_label = sprintf( __( 'Install %s' ), '{{ data.name }}' ); 267 ?> 268 <a class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a> 269 <button class="button-secondary preview install-theme-preview"><?php _e( 'Preview' ); ?></button> 262 270 <# } #> 263 271 </div> … … 275 283 <button class="next-theme"><span class="screen-reader-text"><?php _ex( 'Next', 'Button label for a theme' ); ?></span></button> 276 284 <# if ( data.installed ) { #> 277 <a class="button button-primary activate" href="{{ data.activate_url }}"><?php esc_html_e( 'Activate' ); ?></a>285 <a class="button button-primary activate" href="{{ data.activate_url }}"><?php _e( 'Activate' ); ?></a> 278 286 <# } else { #> 279 <a href="{{ data.install_url }}" class="button button-primary theme-install" data- slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>287 <a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a> 280 288 <# } #> 281 289 </div> -
trunk/src/wp-admin/themes.php
r37914 r38057 278 278 <?php } ?> 279 279 <?php } else { ?> 280 <a class="button button-secondary activate" href="<?php echo $theme['actions']['activate']; ?>"><?php _e( 'Activate' ); ?></a> 280 <?php 281 /* translators: %s: Theme name */ 282 $aria_label = sprintf( __( 'Activate %s' ), '{{ data.name }}' ); 283 ?> 284 <a class="button button-secondary activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> 281 285 <?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?> 282 286 <a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a> … … 403 407 <# } #> 404 408 <# } else { #> 405 <a class="button button-secondary activate" href="{{{ data.actions.activate }}}"><?php _e( 'Activate' ); ?></a> 409 <?php 410 /* translators: %s: Theme name */ 411 $aria_label = sprintf( __( 'Activate %s' ), '{{ data.name }}' ); 412 ?> 413 <a class="button button-secondary activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a> 406 414 <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a> 407 415 <# } #> … … 457 465 </div> 458 466 <div class="inactive-theme"> 467 <?php 468 /* translators: %s: Theme name */ 469 $aria_label = sprintf( __( 'Activate %s' ), '{{ data.name }}' ); 470 ?> 459 471 <# if ( data.actions.activate ) { #> 460 <a href="{{{ data.actions.activate }}}" class="button button-secondary activate" ><?php _e( 'Activate' ); ?></a>472 <a href="{{{ data.actions.activate }}}" class="button button-secondary activate" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a> 461 473 <# } #> 462 474 <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a> -
trunk/src/wp-includes/script-loader.php
r38033 r38057 629 629 /* translators: Error string for a failed installation */ 630 630 'installFailed' => __( 'Installation failed: %s' ), 631 /* translators: Plugin/Theme name and version */ 632 'installingLabel' => __( 'Installing %s...' ), // no ellipsis 633 /* translators: Plugin/Theme name and version */ 634 'installedLabel' => __( '%s installed!' ), 635 /* translators: Plugin/Theme name and version */ 636 'installFailedLabel' => __( '%s installation failed' ), 631 /* translators: Plugin name and version */ 632 'pluginInstallingLabel' => _x( 'Installing %s...', 'plugin' ), // no ellipsis 633 /* translators: Theme name and version */ 634 'themeInstallingLabel' => _x( 'Installing %s...', 'theme' ), // no ellipsis 635 /* translators: Plugin name and version */ 636 'pluginInstalledLabel' => _x( '%s installed!', 'plugin' ), 637 /* translators: Theme name and version */ 638 'themeInstalledLabel' => _x( '%s installed!', 'theme' ), 639 /* translators: Plugin name and version */ 640 'pluginInstallFailedLabel' => _x( '%s installation failed', 'plugin' ), 641 /* translators: Theme name and version */ 642 'themeInstallFailedLabel' => _x( '%s installation failed', 'theme' ), 637 643 'installingMsg' => __( 'Installing... please wait.' ), 638 644 'installedMsg' => __( 'Installation completed successfully.' ), … … 650 656 'deleted' => __( 'Deleted!' ), 651 657 'livePreview' => __( 'Live Preview' ), 658 /* translators: %s: Theme name */ 652 659 'activatePlugin' => is_network_admin() ? __( 'Network Activate' ) : __( 'Activate' ), 653 660 'activateTheme' => is_network_admin() ? __( 'Network Enable' ) : __( 'Activate' ), 661 /* translators: %s: Plugin name */ 662 'activatePluginLabel' => is_network_admin() ? _x( 'Network Activate %s', 'plugin' ) : _x( 'Activate %s', 'plugin' ), 663 /* translators: %s: Theme name */ 664 'activateThemeLabel' => is_network_admin() ? _x( 'Network Activate %s', 'theme' ) : _x( 'Activate %s', 'theme' ), 654 665 'activateImporter' => __( 'Activate importer' ), 655 'unknownError' => __( 'An unknown error occur ed' ),666 'unknownError' => __( 'An unknown error occurred' ), 656 667 'pluginsFound' => __( 'Number of plugins found: %d' ), 657 668 'noPluginsFound' => __( 'No plugins found. Try a different search.' ), -
trunk/tests/qunit/fixtures/updates.js
r38033 r38057 23 23 'installFailedShort': 'Install Failed!', 24 24 'installFailed': 'Installation failed: %s', 25 'installingLabel': 'Installing %s...', // No ellipsis 26 'installedLabel': '%s installed!', 27 'installFailedLabel': '%s installation failed', 25 'pluginInstallingLabel': 'Installing %s...', // No ellipsis 26 'themeInstallingLabel': 'Installing %s...', // No ellipsis 27 'pluginInstalledLabel': '%s installed!', 28 'themeInstalledLabel': '%s installed!', 29 'pluginInstallFailedLabel': '%s installation failed', 30 'themeInstallFailedLabel': '%s installation failed', 28 31 'installingMsg': 'Installing... please wait.', 29 32 'installedMsg': 'Installation completed successfully.', … … 38 41 'livePreview': 'Live Preview', 39 42 'activatePlugin': 'Activate', 40 'activateTheme': 'Activate', 43 'activateTheme': 'Activate', 44 'activatePluginLabel': 'Activate %s', 45 'activateThemeLabel': 'Activate %s', 41 46 'activateImporter': 'Activate importer', 42 'unknownError': 'An unknown error occur ed',47 'unknownError': 'An unknown error occurred', 43 48 'pluginsFound': 'Number of plugins found: %d', 44 49 'noPluginsFound': 'No plugins found. Try a different search.'
Note: See TracChangeset
for help on using the changeset viewer.