Minor cleanup and line breaking to formatTimePeriod()
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 24 Sep 2011 17:55:34 +0000 (17:55 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 24 Sep 2011 17:55:34 +0000 (17:55 +0000)
languages/Language.php

index c262bf1..6327cae 100644 (file)
@@ -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 ) );