Ticket #5583: widgets-js-i18n.diff
File widgets-js-i18n.diff, 2.7 KB (added by , 17 years ago) |
---|
-
wp-admin/js/widgets.js
1 1 jQuery(function($) { 2 2 $('.noscript-action').remove(); 3 3 4 // TODO: i18n5 var addText = 'Add';6 var editText = 'Edit';7 var cancText = 'Cancel';8 4 var increment = 1; 9 5 10 6 // Open or close widget control form … … 16 12 t.animate( { height: 'hide' } ); 17 13 if ( width > 250 ) 18 14 li.animate( { marginLeft: 0 } ); 19 t.siblings('h4').children('a').text( editText );15 t.siblings('h4').children('a').text( widgetsL10n.edit ); 20 16 } else { 21 17 t.animate( { height: 'show' } ); 22 18 if ( width > 250 ) 23 19 li.animate( { marginLeft: ( width - 250 ) * -1 } ); 24 t.siblings('h4').children('a').text( cancText);20 t.siblings('h4').children('a').text( widgetsL10n.cancel ); 25 21 } 26 22 } ).end(); 27 23 }; … … 54 50 increment++; 55 51 newLi.html( newLi.html().replace( /%i%/g, i ) ); 56 52 } else { 57 $(this).text( editText ).unbind().click( editClick );53 $(this).text( widgetsL10n.edit ).unbind().click( editClick ); 58 54 // save form content in textarea so we don't have any conflicting HTML ids 59 55 oldLi.html( '<textarea>' + oldLi.html() + '</textarea>' ); 60 56 } … … 91 87 $(this).parents('li:first').remove(); 92 88 var t = $('#widget-list ul#widget-control-info-' + w + ' textarea'); 93 89 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 ); 95 91 var n = parseInt( $('#widget-count').text(), 10 ) - 1; 96 92 $('#widget-count').text( n.toString() ) 97 93 return false; -
wp-admin/includes/widgets.php
177 177 </h4> 178 178 179 179 <div class="widget-control"<?php if ( 'edit' == $display ) echo ' style="display: block;"'; ?>> 180 <div class="widget-control-actions"> 180 181 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 181 191 <?php 182 192 if ( $control ) 183 193 call_user_func_array( $control['callback'], $control['params'] );