Ticket #5583: widgets-js-i18n.diff

File widgets-js-i18n.diff, 2.7 kB (added by nbachiyski, 5 months ago)
  • wp-admin/js/widgets.js

    old new  
    11jQuery(function($) { 
    22        $('.noscript-action').remove(); 
    33 
    4         // TODO: i18n 
    5         var addText  = 'Add'; 
    6         var editText = 'Edit'; 
    7         var cancText = 'Cancel'; 
    84        var increment = 1; 
    95 
    106        // Open or close widget control form 
     
    1612                                t.animate( { height: 'hide' } ); 
    1713                                if ( width > 250 ) 
    1814                                        li.animate( { marginLeft: 0 } ); 
    19                                 t.siblings('h4').children('a').text( editText ); 
     15                                t.siblings('h4').children('a').text( widgetsL10n.edit ); 
    2016                        } else { 
    2117                                t.animate( { height: 'show' } ); 
    2218                                if ( width > 250 ) 
    2319                                        li.animate( { marginLeft: ( width - 250 ) * -1 } ); 
    24                                 t.siblings('h4').children('a').text( cancText ); 
     20                                t.siblings('h4').children('a').text( widgetsL10n.cancel ); 
    2521                        } 
    2622                } ).end(); 
    2723        }; 
     
    5450                        increment++; 
    5551                        newLi.html( newLi.html().replace( /%i%/g, i ) ); 
    5652                } else { 
    57                         $(this).text( editText ).unbind().click( editClick ); 
     53                        $(this).text( widgetsL10n.edit ).unbind().click( editClick ); 
    5854                        // save form content in textarea so we don't have any conflicting HTML ids 
    5955                        oldLi.html( '<textarea>' + oldLi.html() + '</textarea>' ); 
    6056                } 
     
    9187                        $(this).parents('li:first').remove(); 
    9288                        var t = $('#widget-list ul#widget-control-info-' + w + ' textarea'); 
    9389                        t.parent().html( t.text() ).parents('li.widget-list-item:first').children( 'h4' ).children('a.widget-action') 
    94                                 .show().text( addText ).unbind().click( addClick ); 
     90                                .show().text( widgetsL10n.add ).unbind().click( addClick ); 
    9591                        var n = parseInt( $('#widget-count').text(), 10 ) - 1; 
    9692                        $('#widget-count').text( n.toString() ) 
    9793                        return false; 
  • wp-admin/includes/widgets.php

    old new  
    177177                        </h4> 
    178178 
    179179                        <div class="widget-control"<?php if ( 'edit' == $display ) echo ' style="display: block;"'; ?>> 
     180                                <div class="widget-control-actions"> 
    180181 
     182                                        <?php if ( $control && 'edit' != $display ) : ?> 
     183 
     184                                        <a class="widget-action widget-control-save edit alignleft" href="#save:<?php echo $id_format; ?>"><?php _e('Save'); ?></a> 
     185 
     186                                        <?php endif; ?> 
     187 
     188                                        <a class="widget-action widget-control-remove delete alignright" href="<?php echo add_query_arg( array( 'remove' => $id_format, 'key' => $key ), wp_nonce_url( null, "remove-widget_$widget[id]" ) ); ?>"><?php _e('Remove'); ?></a> 
     189                                        <br class="clear" /> 
     190 
    181191                                <?php 
    182192                                if ( $control ) 
    183193                                        call_user_func_array( $control['callback'], $control['params'] );