diff --git a/admin/hooks/gettext.php b/admin/hooks/gettext.php index 24335fa6..472cae37 100644 --- a/admin/hooks/gettext.php +++ b/admin/hooks/gettext.php @@ -70,14 +70,13 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) { $translated_text = $venue->name; endif; endif; - endif; - - if ( isset( $sportspress_options['text'] ) ): - foreach( $sportspress_options['text'] as $key => $value ): - if ( $untranslated_text == $key ): - $translated_text = $value; - endif; - endforeach; + if ( isset( $sportspress_options['text'] ) ): + foreach( $sportspress_options['text'] as $key => $value ): + if ( $translated_text == $key ): + $translated_text = $value; + endif; + endforeach; + endif; endif; return $translated_text; diff --git a/admin/includes/globals.php b/admin/includes/globals.php index fda7ad16..80fe65b5 100644 --- a/admin/includes/globals.php +++ b/admin/includes/globals.php @@ -10,40 +10,39 @@ function sportspress_define_globals() { global $sportspress_text_options; $sportspress_text_options = array( - 'Calendar', - 'Calendars', - 'Current Team', - 'Event', - 'Events', - 'Friendly', - 'League', - 'Leagues', - 'League Table', - 'League Tables', - 'Nationality', - 'Number', - 'Past Teams', - 'Played', - 'Player', - 'Players', - 'Player List', - 'Player Lists', - 'Position', - 'Positions', - 'Pos', - 'Rank', - 'Roster', - 'Schedule', - 'Season', - 'Seasons', - 'Staff', - 'Substitute', - 'Team', - 'Teams', - 'Venue', - 'Venues', + __( 'Article', 'sportspress' ), + __( 'Current Team', 'sportspress' ), + __( 'Date', 'sportspress' ), + __( 'Details', 'sportspress' ), + __( 'days', 'sportspress' ), + __( 'Event', 'sportspress' ), + __( 'Friendly', 'sportspress' ), + __( 'hrs', 'sportspress' ), + __( 'League', 'sportspress' ), + __( 'mins', 'sportspress' ), + __( 'Nationality', 'sportspress' ), + __( 'Past Teams', 'sportspress' ), + __( 'Player', 'sportspress' ), + __( 'Position', 'sportspress' ), + __( 'Pos', 'sportspress' ), + __( 'Preview', 'sportspress' ), + __( 'Rank', 'sportspress' ), + __( 'Recap', 'sportspress' ), + __( 'Results', 'sportspress' ), + __( 'Season', 'sportspress' ), + __( 'secs', 'sportspress' ), + __( 'Staff', 'sportspress' ), + __( 'Substitute', 'sportspress' ), + __( 'Team', 'sportspress' ), + __( 'Teams', 'sportspress' ), + __( 'Time', 'sportspress' ), + __( 'Total', 'sportspress' ), + __( 'Venue', 'sportspress' ), + __( 'View all players', 'sportspress' ), + __( 'View all events', 'sportspress' ), + __( 'View full table', 'sportspress' ), ); - + sort( $sportspress_text_options ); // Continents diff --git a/admin/settings/options-text.php b/admin/settings/options-text.php index 8f1aaa50..3bee8402 100644 --- a/admin/settings/options-text.php +++ b/admin/settings/options-text.php @@ -24,7 +24,7 @@ class SportsPressTextSettingsPage { foreach ( $this->strings as $string ): add_settings_field( sanitize_title( $string ), - __( $string, 'sportspress' ), + $string, array( $this, 'text_callback' ), 'sportspress_text', 'text' @@ -35,9 +35,8 @@ class SportsPressTextSettingsPage { public function text_callback( $test ) { $string = array_shift( $this->strings ); $key = sanitize_title( $string ); - $localized = $string; $text = sportspress_array_value( sportspress_array_value( $this->options, 'text', array() ), $string, null ); - ?>