From 9c1d8d1d653da2060d878983a6a11ac9e30f116a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 24 Sep 2011 17:55:34 +0000 Subject: [PATCH] Minor cleanup and line breaking to formatTimePeriod() --- languages/Language.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/languages/Language.php b/languages/Language.php index c262bf18d2..6327caec37 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -3558,7 +3558,7 @@ class Language { */ function formatTimePeriod( $seconds, $format = array() ) { if ( !is_array( $format ) ) { - $format = array( 'avoid' => $format, 'noabbrevs' => false ); // For backwards compatibility + $format = array( 'avoid' => $format ); // For backwards compatibility } if ( !isset( $format['avoid'] ) ) { $format['avoid'] = false; @@ -3566,10 +3566,14 @@ class Language { if ( !isset( $format['noabbrevs' ] ) ) { $format['noabbrevs'] = false; } - $secondsMsg = wfMessage( $format['noabbrevs'] ? 'seconds' : 'seconds-abbrev' )->inLanguage( $this ); - $minutesMsg = wfMessage( $format['noabbrevs'] ? 'minutes' : 'minutes-abbrev' )->inLanguage( $this ); - $hoursMsg = wfMessage( $format['noabbrevs'] ? 'hours' : 'hours-abbrev' )->inLanguage( $this ); - $daysMsg = wfMessage( $format['noabbrevs'] ? 'days' : 'days-abbrev' )->inLanguage( $this ); + $secondsMsg = wfMessage( + $format['noabbrevs'] ? 'seconds' : 'seconds-abbrev' )->inLanguage( $this ); + $minutesMsg = wfMessage( + $format['noabbrevs'] ? 'minutes' : 'minutes-abbrev' )->inLanguage( $this ); + $hoursMsg = wfMessage( + $format['noabbrevs'] ? 'hours' : 'hours-abbrev' )->inLanguage( $this ); + $daysMsg = wfMessage( + $format['noabbrevs'] ? 'days' : 'days-abbrev' )->inLanguage( $this ); if ( round( $seconds * 10 ) < 100 ) { $s = $this->formatNum( sprintf( "%.1f", round( $seconds * 10 ) / 10 ) ); -- 2.20.1