r64063 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64062‎ | r64063 | r64064 >
Date:08:57, 23 March 2010
Author:maxsem
Status:reverted (Comments)
Tags:
Comment:
Tweaked LanguageConverter to use spaces in formatTimePeriod, things like "1h23m45s" look really ugly
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -2711,19 +2711,19 @@
27122712
27132713 function formatTimePeriod( $seconds ) {
27142714 if ( $seconds < 10 ) {
2715 - return $this->formatNum( sprintf( "%.1f", $seconds ) ) . wfMsg( 'seconds-abbrev' );
 2715+ return $this->formatNum( sprintf( "%.1f", $seconds ) ) . ' ' . wfMsg( 'seconds-abbrev' );
27162716 } elseif ( $seconds < 60 ) {
2717 - return $this->formatNum( round( $seconds ) ) . wfMsg( 'seconds-abbrev' );
 2717+ return $this->formatNum( round( $seconds ) ) . ' ' . wfMsg( 'seconds-abbrev' );
27182718 } elseif ( $seconds < 3600 ) {
2719 - return $this->formatNum( floor( $seconds / 60 ) ) . wfMsg( 'minutes-abbrev' ) .
2720 - $this->formatNum( round( fmod( $seconds, 60 ) ) ) . wfMsg( 'seconds-abbrev' );
 2719+ return $this->formatNum( floor( $seconds / 60 ) ) . ' ' . wfMsg( 'minutes-abbrev' ) . ' ' .
 2720+ $this->formatNum( round( fmod( $seconds, 60 ) ) ) . ' ' . wfMsg( 'seconds-abbrev' );
27212721 } else {
27222722 $hours = floor( $seconds / 3600 );
27232723 $minutes = floor( ( $seconds - $hours * 3600 ) / 60 );
27242724 $secondsPart = round( $seconds - $hours * 3600 - $minutes * 60 );
2725 - return $this->formatNum( $hours ) . wfMsg( 'hours-abbrev' ) .
2726 - $this->formatNum( $minutes ) . wfMsg( 'minutes-abbrev' ) .
2727 - $this->formatNum( $secondsPart ) . wfMsg( 'seconds-abbrev' );
 2725+ return $this->formatNum( $hours ) . ' ' . wfMsg( 'hours-abbrev' ) . ' ' .
 2726+ $this->formatNum( $minutes ) . ' ' . wfMsg( 'minutes-abbrev' ) . ' ' .
 2727+ $this->formatNum( $secondsPart ) . ' ' . wfMsg( 'seconds-abbrev' );
27282728 }
27292729 }
27302730

Follow-up revisions

RevisionCommit summaryAuthorDate
r69009Revert r64063, will use a different approach for selected languages latermaxsem16:35, 4 July 2010

Comments

#Comment by Siebrand (talk | contribs)   12:32, 23 March 2010

I think this change should be language specific. You cannot just throw in a bunch of spaces for all languages. The least you could do is use message key word-separator.

Status & tagging log