Widget i18n from nbachiyski. see #5583

git-svn-id: http://svn.automattic.com/wordpress/trunk@6679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-01-29 17:17:13 +00:00
parent 1aef57fb18
commit 53c09007bb
2 changed files with 14 additions and 8 deletions

View File

@ -177,6 +177,16 @@ function wp_widget_control( $key, $widget, $display = 'display' ) {
</h4>
<div class="widget-control"<?php if ( 'edit' == $display ) echo ' style="display: block;"'; ?>>
<div class="widget-control-actions">
<?php if ( $control && 'edit' != $display ) : ?>
<a class="widget-action widget-control-save edit alignleft" href="#save:<?php echo $id_format; ?>"><?php _e('Save'); ?></a>
<?php endif; ?>
<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>
<br class="clear" />
<?php
if ( $control )

View File

@ -1,10 +1,6 @@
jQuery(function($) {
$('.noscript-action').remove();
// TODO: i18n
var addText = 'Add';
var editText = 'Edit';
var cancText = 'Cancel';
var increment = 1;
// Open or close widget control form
@ -16,12 +12,12 @@ jQuery(function($) {
t.animate( { height: 'hide' } );
if ( width > 250 )
li.animate( { marginLeft: 0 } );
t.siblings('h4').children('a').text( editText );
t.siblings('h4').children('a').text( widgetsL10n.edit );
} else {
t.animate( { height: 'show' } );
if ( width > 250 )
li.animate( { marginLeft: ( width - 250 ) * -1 } );
t.siblings('h4').children('a').text( cancText );
t.siblings('h4').children('a').text( widgetsL10n.cancel );
}
} ).end();
};
@ -54,7 +50,7 @@ jQuery(function($) {
increment++;
newLi.html( newLi.html().replace( /%i%/g, i ) );
} else {
$(this).text( editText ).unbind().click( editClick );
$(this).text( widgetsL10n.edit ).unbind().click( editClick );
// save form content in textarea so we don't have any conflicting HTML ids
oldLi.html( '<textarea>' + oldLi.html() + '</textarea>' );
}
@ -91,7 +87,7 @@ jQuery(function($) {
$(this).parents('li:first').remove();
var t = $('#widget-list ul#widget-control-info-' + w + ' textarea');
t.parent().html( t.text() ).parents('li.widget-list-item:first').children( 'h4' ).children('a.widget-action')
.show().text( addText ).unbind().click( addClick );
.show().text( widgetsL10n.add ).unbind().click( addClick );
var n = parseInt( $('#widget-count').text(), 10 ) - 1;
$('#widget-count').text( n.toString() )
return false;