Translate strings loaded before parser

This commit is contained in:
Brian Miyaji
2014-01-06 17:04:50 +11:00
parent ffb98dc686
commit a68190f320
17 changed files with 336 additions and 398 deletions

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['baseball'] = array(
'name' => __( 'Baseball', 'sportspress' ),
'name' => 'Baseball',
'posts' => array(
// Columns
'sp_column' => array(

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['basketball'] = array(
'name' => __( 'Basketball', 'sportspress' ),
'name' => 'Basketball',
'posts' => array(
// Table Columns
'sp_column' => array(

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['cricket'] = array(
'name' => __( 'Cricket', 'sportspress' ),
'name' => 'Cricket',
'posts' => array(
// Table Columns
'sp_column' => array(

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['football'] = array(
'name' => __( 'American Football', 'sportspress' ),
'name' => 'American Football',
'posts' => array(
// Table Columns
'sp_column' => array(

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['footy'] = array(
'name' => __( 'Australian Rules Football', 'sportspress' ),
'name' => 'Australian Rules Football',
'posts' => array(
// Table Columns
'sp_column' => array(

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['gaming'] = array(
'name' => __( 'Competitive Gaming', 'sportspress' ),
'name' => 'Competitive Gaming',
'posts' => array(
// Table Columns
'sp_column' => array(

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['golf'] = array(
'name' => __( 'Golf', 'sportspress' ),
'name' => 'Golf',
'posts' => array(
// Table Columns
'sp_column' => array(
@@ -10,7 +10,7 @@ $sportspress_sports['golf'] = array(
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Events', 'sportspress' ),
'post_title' => 'Events',
'post_name' => 'events',
'meta' => array(
'sp_equation' => '$eventsplayed',
@@ -24,7 +24,7 @@ $sportspress_sports['golf'] = array(
),
),
array(
'post_title' => __( 'Total', 'sportspress' ),
'post_title' => 'Total',
'post_name' => 'total',
'meta' => array(
'sp_equation' => '$ptsfor',

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['hockey'] = array(
'name' => __( 'Hockey', 'sportspress' ),
'name' => 'Hockey',
'posts' => array(
// Table Columns
'sp_column' => array(

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['racing'] = array(
'name' => __( 'Racing', 'sportspress' ),
'name' => 'Racing',
'posts' => array(
// Table Columns
'sp_column' => array(

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['rugby'] = array(
'name' => __( 'Rugby', 'sportspress' ),
'name' => 'Rugby',
'posts' => array(
// Table Columns
'sp_column' => array(

View File

@@ -2,7 +2,7 @@
global $sportspress_sports;
$sportspress_sports['soccer'] = array(
'name' => __( 'Association Football (Soccer)', 'sportspress' ),
'name' => 'Association Football (Soccer)',
'posts' => array(
// Table Columns
'sp_column' => array(
@@ -88,7 +88,7 @@ $sportspress_sports['soccer'] = array(
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_title' => 'Appearances',
'post_name' => 'appearances',
'meta' => array(
'sp_equation' => '$eventsplayed',
@@ -97,7 +97,7 @@ $sportspress_sports['soccer'] = array(
),
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_title' => 'Goals',
'post_name' => 'goals',
'meta' => array(
'sp_equation' => '',
@@ -108,7 +108,7 @@ $sportspress_sports['soccer'] = array(
),
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_title' => 'Assists',
'post_name' => 'assists',
'meta' => array(
'sp_equation' => '',
@@ -117,7 +117,7 @@ $sportspress_sports['soccer'] = array(
),
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_title' => 'Yellow Cards',
'post_name' => 'yellowcards',
'meta' => array(
'sp_equation' => '',
@@ -126,7 +126,16 @@ $sportspress_sports['soccer'] = array(
),
),
array(
'post_title' => __( 'Height', 'sportspress' ),
'post_title' => 'Red Cards',
'post_name' => 'redcards',
'meta' => array(
'sp_equation' => '',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'Height',
'post_name' => 'height',
'meta' => array(
'sp_equation' => '',
@@ -135,7 +144,7 @@ $sportspress_sports['soccer'] = array(
),
),
array(
'post_title' => __( 'Weight', 'sportspress' ),
'post_title' => 'Weight',
'post_name' => 'weight',
'meta' => array(
'sp_equation' => '',
@@ -147,7 +156,7 @@ $sportspress_sports['soccer'] = array(
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_title' => 'Goals',
'post_name' => 'goals',
'meta' => array(
'sp_format' => 'integer',

View File

@@ -83,6 +83,9 @@ function sportspress_validate( $input ) {
// Make sure post doesn't overlap
if ( ! get_page_by_path( $post['post_name'], OBJECT, $post_type ) ):
// Translate post title
$post['post_title'] = __( $post['post_title'], 'sportspress' );
// Set post type
$post['post_type'] = $post_type;
@@ -146,7 +149,7 @@ function sportspress_sport_callback() {
?>
<select id="sportspress_sport" name="sportspress[sport]">
<?php foreach( $sportspress_sports as $slug => $sport ): ?>
<option value="<?php echo $slug; ?>" <?php selected( $options['sport'], $slug ); ?>><?php echo $sport['name']; ?></option>
<option value="<?php echo $slug; ?>" <?php selected( $options['sport'], $slug ); ?>><?php _e( $sport['name'], 'sportspress' ); ?></option>
<?php endforeach; ?>
</select>
<?