WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/13/2016 05:31:15 PM (3 years ago)
Author:
ocean90
Message:

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

Props swissspidy, SergeyBiryukov.
Fixes #37290.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/themes.php

    r37914 r38057  
    278278        <?php } ?>
    279279    <?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>
    281285        <?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
    282286            <a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a>
     
    403407            <# } #>
    404408        <# } 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>
    406414            <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a>
    407415        <# } #>
     
    457465            </div>
    458466            <div class="inactive-theme">
     467                <?php
     468                /* translators: %s: Theme name */
     469                $aria_label = sprintf( __( 'Activate %s' ), '{{ data.name }}' );
     470                ?>
    459471                <# 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>
    461473                <# } #>
    462474                <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a>
Note: See TracChangeset for help on using the changeset viewer.