Replace dynamic strings with static ones

This commit is contained in:
Brian Miyaji
2014-02-21 08:35:46 +11:00
parent 1318cfdced
commit 38e53ac37c
32 changed files with 294 additions and 227 deletions

View File

@@ -2,16 +2,16 @@
function sportspress_admin_post_thumbnail_html( $translated_text, $post_id ) {
$texts = array(
'sp_team' => array(
'Set featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Logo', 'sportspress' ) ),
'Remove featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Logo', 'sportspress' ) ),
'Set featured image' => __( 'Select Logo', 'sportspress' ),
'Remove featured image' => __( 'Remove Logo', 'sportspress' ),
),
'sp_player' => array(
'Set featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ),
'Remove featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ),
'Set featured image' => __( 'Select Photo', 'sportspress' ),
'Remove featured image' => __( 'Remove Photo', 'sportspress' ),
),
'sp_staff' => array(
'Set featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ),
'Remove featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ),
'Set featured image' => __( 'Select Photo', 'sportspress' ),
'Remove featured image' => __( 'Remove Photo', 'sportspress' ),
),
);

View File

@@ -9,13 +9,13 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
$translated_text = __( 'Team', 'sportspress' );
break;
case 'Set featured image':
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Logo', 'sportspress' ) );
$translated_text = __( 'Select Logo', 'sportspress' );
break;
case 'Set Featured Image':
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Logo', 'sportspress' ) );
$translated_text = __( 'Select Logo', 'sportspress' );
break;
case 'Remove featured image':
$translated_text = sprintf( __( 'Remove %s', 'sportspress' ), __( 'Logo', 'sportspress' ) );
$translated_text = __( 'Remove Logo', 'sportspress' );
break;
endswitch;
elseif ( in_array( $typenow, array( 'sp_event', 'sp_player', 'sp_staff' ) ) ):
@@ -24,13 +24,13 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
$translated_text = __( '(Auto)', 'sportspress' );
break;
case 'Set featured image':
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
$translated_text = __( 'Select Photo', 'sportspress' );
break;
case 'Set Featured Image':
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
$translated_text = __( 'Select Photo', 'sportspress' );
break;
case 'Remove featured image':
$translated_text = sprintf( __( 'Remove %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
$translated_text = __( 'Remove Photo', 'sportspress' );
break;
case 'Scheduled for: <b>%1$s</b>':
$translated_text = __( 'Date/Time: <b>%1$s</b>', 'sportspress' );

View File

@@ -4,8 +4,8 @@ function sportspress_media_buttons() {
//if ( ! in_array( array('post.php', 'page.php', 'page-new.php', 'post-new.php')
?>
<a href="#TB_inline?width=480&inlineId=select_sp_table" class="thickbox button sp-insert sp-insert-map" id="add_gform" title="<?php printf( __( 'Add %s', 'sportspress' ), __( 'Map', 'sportspress' ) ); ?>"><span class="sp-buttons-icon sp-map-buttons-icon "></span> <?php printf( __( 'Add %s', 'sportspress' ), __( 'Map', 'sportspress' ) ); ?></a>
<a href="#TB_inline?width=480&inlineId=select_sp_table" class="thickbox button sp-insert sp-insert-table" id="add_gform" title="<?php printf( __( 'Add %s', 'sportspress' ), __( 'League Table', 'sportspress' ) ); ?>"><span class="sp-buttons-icon sp-table-buttons-icon "></span> <?php printf( __( 'Add %s', 'sportspress' ), __( 'League Table', 'sportspress' ) ); ?></a>
<a href="#TB_inline?width=480&inlineId=select_sp_table" class="thickbox button sp-insert sp-insert-map" id="add_gform" title="<?php _e( 'Add Map', 'sportspress' ); ?>"><span class="sp-buttons-icon sp-map-buttons-icon "></span> <?php _e( 'Add Map', 'sportspress' ); ?></a>
<a href="#TB_inline?width=480&inlineId=select_sp_table" class="thickbox button sp-insert sp-insert-table" id="add_gform" title="<?php _e( 'Add League Table', 'sportspress' ); ?>"><span class="sp-buttons-icon sp-table-buttons-icon "></span> <?php _e( 'Add League Table', 'sportspress' ); ?></a>
<?php
}
add_action( 'media_buttons', 'sportspress_media_buttons', 20 );

View File

@@ -1,38 +1,41 @@
<?php
function sportspress_post_updated_messages( $messages ) {
global $typenow, $post;
if ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_metric', 'sp_statistic' ) ) ):
$obj = get_post_type_object( $typenow );
$messages['post'][1] = sprintf( __( '%s updated.', 'sportspress' ), $obj->labels->singular_name ) .
' <a href="' . esc_url( admin_url( 'edit.php?post_type=' . $typenow ) ) . '">' .
sprintf( __( 'Edit %s', 'sportspress' ), $obj->labels->name ) . '</a>';
for ( $i = 0; $i <= 10; $i++ ):
$messages['post'][ $i ] = __( 'Settings saved.', 'sportspress' ) .
' <a href="' . esc_url( admin_url( 'edit.php?post_type=' . $typenow ) ) . '">' .
__( 'View all', 'sportspress' ) . '</a>';
endfor;
elseif ( in_array( $typenow, array( 'sp_event', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) ) ):
$obj = get_post_type_object( $typenow );
$messages['post'][1] = sprintf( __( '%s updated.', 'sportspress' ), $obj->labels->singular_name ) .
$messages['post'][1] = __( 'Changes saved.', 'sportspress' ) .
' <a href="' . esc_url( get_permalink($post->ID) ) . '">' . $obj->labels->view_item . '</a>';
$messages['post'][4] = sprintf( __( '%s updated.', 'sportspress' ), $obj->labels->singular_name );
$messages['post'][4] = __( 'Changes saved.', 'sportspress' );
$messages['post'][6] = sprintf( __( '%s published.', 'sportspress' ), $obj->labels->singular_name ) .
$messages['post'][6] = __( 'Success!', 'sportspress' ) .
' <a href="' . esc_url( get_permalink($post->ID) ) . '">' . $obj->labels->view_item . '</a>';
$messages['post'][7] = sprintf( __( '%s saved.', 'sportspress' ), $obj->labels->singular_name );
$messages['post'][7] = __( 'Changes saved.', 'sportspress' );
$messages['post'][8] = sprintf( __( '%s submitted.', 'sportspress' ), $obj->labels->singular_name ) .
$messages['post'][8] = __( 'Success!', 'sportspress' ) .
' <a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($post->ID) ) ) . '">' .
sprintf( __( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';
$messages['post'][9] = sprintf(
__( '%s scheduled for: <strong>%s</strong>.', 'sportspress' ),
__( 'Scheduled for: <b>%1$s</b>.', 'sportspress' ),
date_i18n( __( 'M j, Y @ G:i', 'sportspress' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post->ID) ) ) .
' <a target="_blank" href="' . esc_url( get_permalink($post->ID) ) . '">' .
sprintf( __( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';
$messages['post'][8] = sprintf( __( '%s draft updated.', 'sportspress' ), $obj->labels->singular_name ) .
$messages['post'][10] = __( 'Success!', 'sportspress' ) .
' <a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($post->ID) ) ) . '">' .
sprintf( __( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';

View File

@@ -5,7 +5,7 @@ function sportspress_restrict_manage_posts() {
if ( in_array( $typenow, array( 'sp_event', 'sp_player', 'sp_staff', 'sp_table', 'sp_list' ) ) ):
$selected = isset( $_REQUEST['sp_team'] ) ? $_REQUEST['sp_team'] : null;
$args = array(
'show_option_none' => sprintf( __( 'All %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
'show_option_none' => __( 'All Teams', 'sportspress' ),
'post_type' => 'sp_team',
'name' => 'sp_team',
'selected' => $selected
@@ -15,7 +15,7 @@ function sportspress_restrict_manage_posts() {
if ( in_array( $typenow, array( 'sp_player' ) ) ):
$selected = isset( $_REQUEST['sp_position'] ) ? $_REQUEST['sp_position'] : null;
$args = array(
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Positions', 'sportspress' ) ),
'show_option_all' => __( 'All Positions', 'sportspress' ),
'taxonomy' => 'sp_position',
'name' => 'sp_position',
'selected' => $selected
@@ -25,7 +25,7 @@ function sportspress_restrict_manage_posts() {
if ( in_array( $typenow, array( 'sp_team', 'sp_event', 'sp_player', 'sp_staff', 'sp_table', 'sp_list' ) ) ):
$selected = isset( $_REQUEST['sp_season'] ) ? $_REQUEST['sp_season'] : null;
$args = array(
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Seasons', 'sportspress' ) ),
'show_option_all' => __( 'All Seasons', 'sportspress' ),
'taxonomy' => 'sp_season',
'name' => 'sp_season',
'selected' => $selected
@@ -37,7 +37,7 @@ function sportspress_restrict_manage_posts() {
$args = array(
'post_type' => 'sp_team',
'name' => 'team',
'show_option_none' => sprintf( __( 'All %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
'show_option_none' => __( 'All Teams', 'sportspress' ),
'selected' => $selected,
'values' => 'ID',
);