Use gettext filter to modify fronted text
This commit is contained in:
@@ -102,5 +102,5 @@ if ( isset( $columns ) )
|
||||
</div>
|
||||
<?php
|
||||
if ( $id && $show_all_events_link )
|
||||
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events') . '</a>';
|
||||
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||
?>
|
||||
@@ -209,6 +209,6 @@ if ( $pad != 0 && $pad != 7 )
|
||||
$calendar_output .= "\n\t</tr>\n\t</tbody>\n\t</table>\n\t</div>";
|
||||
|
||||
if ( $id && $show_all_events_link )
|
||||
$calendar_output .= '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events') . '</a>';
|
||||
$calendar_output .= '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||
|
||||
echo apply_filters( 'sportspress_event_calendar', $calendar_output );
|
||||
|
||||
@@ -17,19 +17,19 @@ $time = get_the_time( get_option('time_format'), $id );
|
||||
$leagues = get_the_terms( $id, 'sp_league' );
|
||||
$seasons = get_the_terms( $id, 'sp_season' );
|
||||
|
||||
$data = array( SP()->text->string('Date') => $date, SP()->text->string('Time') => $time );
|
||||
$data = array( __( 'Date', 'sportspress' ) => $date, __( 'Time', 'sportspress' ) => $time );
|
||||
|
||||
if ( $leagues ):
|
||||
$league = array_pop( $leagues );
|
||||
$data[ SP()->text->string('League') ] = $league->name;
|
||||
$data[ __( 'League', 'sportspress' ) ] = $league->name;
|
||||
endif;
|
||||
|
||||
if ( $seasons ):
|
||||
$season = array_pop( $seasons );
|
||||
$data[ SP()->text->string('Season') ] = $season->name;
|
||||
$data[ __( 'Season', 'sportspress' ) ] = $season->name;
|
||||
endif;
|
||||
?>
|
||||
<h3><?php echo SP()->text->string('Details'); ?></h3>
|
||||
<h3><?php echo __( 'Details', 'sportspress' ); ?></h3>
|
||||
<div class="sp-table-wrapper sp-scrollable-table-wrapper">
|
||||
<table class="sp-event-details sp-data-table">
|
||||
<thead>
|
||||
|
||||
@@ -42,22 +42,22 @@ if ( isset( $columns ) )
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
echo '<th class="data-date">' . SP()->text->string('Date') . '</th>';
|
||||
echo '<th class="data-date">' . __( 'Date', 'sportspress' ) . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'event', $usecolumns ) )
|
||||
echo '<th class="data-event">' . SP()->text->string('Event') . '</th>';
|
||||
echo '<th class="data-event">' . __( 'Event', 'sportspress' ) . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'teams', $usecolumns ) )
|
||||
echo '<th class="data-teams">' . SP()->text->string('Teams') . '</th>';
|
||||
echo '<th class="data-teams">' . __( 'Teams', 'sportspress' ) . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'time', $usecolumns ) )
|
||||
echo '<th class="data-time">' . SP()->text->string('Time/Results') . '</th>';
|
||||
echo '<th class="data-time">' . __( 'Time/Results', 'sportspress' ) . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) )
|
||||
echo '<th class="data-venue">' . SP()->text->string('Venue') . '</th>';
|
||||
echo '<th class="data-venue">' . __( 'Venue', 'sportspress' ) . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'article', $usecolumns ) )
|
||||
echo '<th class="data-article">' . SP()->text->string('Article') . '</th>';
|
||||
echo '<th class="data-article">' . __( 'Article', 'sportspress' ) . '</th>';
|
||||
?>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -160,9 +160,9 @@ if ( isset( $columns ) )
|
||||
endif;
|
||||
if ( $event->post_content !== null ):
|
||||
if ( $event->post_status == 'publish' ):
|
||||
echo SP()->text->string('Recap');
|
||||
echo __( 'Recap', 'sportspress' );
|
||||
else:
|
||||
echo SP()->text->string('Preview');
|
||||
echo __( 'Preview', 'sportspress' );
|
||||
endif;
|
||||
endif;
|
||||
|
||||
@@ -180,5 +180,5 @@ if ( isset( $columns ) )
|
||||
</div>
|
||||
<?php
|
||||
if ( $id && $show_all_events_link )
|
||||
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events') . '</a>';
|
||||
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||
?>
|
||||
@@ -47,7 +47,7 @@ foreach( $teams as $key => $team_id ):
|
||||
<tr>
|
||||
<?php if ( $has_players ): ?>
|
||||
<th class="data-number">#</th>
|
||||
<th class="data-name"><?php echo SP()->text->string('Player'); ?></th>
|
||||
<th class="data-name"><?php echo __( 'Player'), 'sportspress' ; ?></th>
|
||||
<?php endif; foreach( $performance_labels as $key => $label ): ?>
|
||||
<th class="data-<?php echo $key; ?>"><?php echo $label; ?></th>
|
||||
<?php endforeach; ?>
|
||||
@@ -130,7 +130,7 @@ foreach( $teams as $key => $team_id ):
|
||||
<?php
|
||||
if ( $has_players ):
|
||||
echo '<td class="data-number"> </td>';
|
||||
echo '<td class="data-name">' . SP()->text->string('Total') . '</td>';
|
||||
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
||||
endif;
|
||||
|
||||
$row = $data[0];
|
||||
|
||||
@@ -83,16 +83,16 @@ if ( empty( $table_rows ) ):
|
||||
|
||||
else:
|
||||
|
||||
$output .= '<h3>' . SP()->text->string('Team Results') . '</h3>';
|
||||
$output .= '<h3>' . __( 'Team Results', 'sportspress' ) . '</h3>';
|
||||
|
||||
$output .= '<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
|
||||
'<table class="sp-event-results sp-data-table sp-responsive-table"><thead>' .
|
||||
'<th class="data-name">' . SP()->text->string('Team') . '</th>';
|
||||
'<th class="data-name">' . __( 'Team', 'sportspress' ) . '</th>';
|
||||
foreach( $result_labels as $key => $label ):
|
||||
$output .= '<th class="data-' . $key . '">' . $label . '</th>';
|
||||
endforeach;
|
||||
if ( $show_outcomes ):
|
||||
$output .= '<th class="data-outcome">' . SP()->text->string('Outcome') . '</th>';
|
||||
$output .= '<th class="data-outcome">' . __( 'Outcome', 'sportspress' ) . '</th>';
|
||||
endif;
|
||||
$output .= '</tr>' . '</thead>' . '<tbody>';
|
||||
$output .= $table_rows;
|
||||
|
||||
@@ -32,7 +32,7 @@ foreach( $venues as $venue ):
|
||||
$latitude = sp_array_value( $meta, 'sp_latitude', 0 );
|
||||
$longitude = sp_array_value( $meta, 'sp_longitude', 0 );
|
||||
?>
|
||||
<h3><?php echo SP()->text->string('Venue'); ?></h3>
|
||||
<h3><?php _e( 'Venue', 'sportspress' ); ?></h3>
|
||||
<table class="sp-data-table sp-event-venue">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -46,7 +46,7 @@ if ( ! $columns )
|
||||
if ( ! is_array( $columns ) )
|
||||
$columns = explode( ',', $columns );
|
||||
|
||||
$output .= '<th class="data-rank">' . SP()->text->string('Pos') . '</th>';
|
||||
$output .= '<th class="data-rank">' . __( 'Pos', 'sportspress' ) . '</th>';
|
||||
|
||||
foreach( $labels as $key => $label ):
|
||||
if ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) )
|
||||
@@ -107,6 +107,6 @@ $output .= '</tbody>' . '</table>';
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $show_full_table_link )
|
||||
$output .= '<a class="sp-league-table-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View full table') . '</a>';
|
||||
$output .= '<a class="sp-league-table-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View full table', 'sportspress' ) . '</a>';
|
||||
|
||||
echo $output;
|
||||
|
||||
@@ -31,7 +31,7 @@ $metrics_after = $player->metrics( false );
|
||||
$common = array();
|
||||
if ( $nationality ):
|
||||
$country_name = sp_array_value( $countries, $nationality, null );
|
||||
$common[ SP()->text->string('Nationality') ] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . '/assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '—';
|
||||
$common[ __( 'Nationality', 'sportspress' ) ] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . '/assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '—';
|
||||
endif;
|
||||
|
||||
$data = array_merge( $metrics_before, $common, $metrics_after );
|
||||
@@ -50,7 +50,7 @@ if ( $past_teams ):
|
||||
foreach ( $past_teams as $team ):
|
||||
$teams[] = '<a href="' . get_post_permalink( $team ) . '">' . get_the_title( $team ) . '</a>';
|
||||
endforeach;
|
||||
$data[ SP()->text->string('Past Teams') ] = implode( ', ', $teams );
|
||||
$data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
|
||||
endif;
|
||||
|
||||
$output = '<div class="sp-list-wrapper">' .
|
||||
|
||||
@@ -142,4 +142,4 @@ endforeach;
|
||||
echo "</div>\n";
|
||||
|
||||
if ( $show_all_players_link )
|
||||
echo '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players') . '</a>';
|
||||
echo '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all players', 'sportspress' ) . '</a>';
|
||||
|
||||
@@ -85,7 +85,7 @@ foreach ( $groups as $group ):
|
||||
if ( in_array( $orderby, array( 'number', 'name' ) ) ):
|
||||
$output .= '<th class="data-number">#</th>';
|
||||
else:
|
||||
$output .= '<th class="data-rank">' . SP()->text->string('Rank') . '</th>';
|
||||
$output .= '<th class="data-rank">' . __( 'Rank', 'sportspress' ) . '</th>';
|
||||
endif;
|
||||
|
||||
foreach( $labels as $key => $label ):
|
||||
@@ -153,6 +153,6 @@ foreach ( $groups as $group ):
|
||||
endforeach;
|
||||
|
||||
if ( $show_all_players_link )
|
||||
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players') . '</a>';
|
||||
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all players', 'sportspress' ) . '</a>';
|
||||
|
||||
echo apply_filters( 'sportspress_player_list', $output );
|
||||
|
||||
@@ -29,18 +29,18 @@ $past_teams = $staff->past_teams();
|
||||
$data = array();
|
||||
if ( $nationality ):
|
||||
$country_name = sp_array_value( $countries, $nationality, null );
|
||||
$data[ SP()->text->string('Nationality') ] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . '/assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '—';
|
||||
$data[ __( 'Nationality', 'sportspress' ) ] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . '/assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '—';
|
||||
endif;
|
||||
|
||||
if ( $current_team )
|
||||
$data[ SP()->text->string('Current Team') ] = '<a href="' . get_post_permalink( $current_team ) . '">' . get_the_title( $current_team ) . '</a>';
|
||||
$data[ __( 'Current Team', 'sportspress' ) ] = '<a href="' . get_post_permalink( $current_team ) . '">' . get_the_title( $current_team ) . '</a>';
|
||||
|
||||
if ( $past_teams ):
|
||||
$teams = array();
|
||||
foreach ( $past_teams as $team ):
|
||||
$teams[] = '<a href="' . get_post_permalink( $team ) . '">' . get_the_title( $team ) . '</a>';
|
||||
endforeach;
|
||||
$data[ SP()->text->string('Past Teams') ] = implode( ', ', $teams );
|
||||
$data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
|
||||
endif;
|
||||
|
||||
$output = '<div class="sp-list-wrapper">' .
|
||||
|
||||
Reference in New Issue
Block a user