r56881 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56880‎ | r56881 | r56882 >
Date:15:04, 24 September 2009
Author:rotem
Status:ok (Comments)
Tags:
Comment:
Removing parameter from messages 'mv_hours_singular', 'mv_minutes_singular', 'mv_seconds_singular' - does not seem to be necessary (must be 1).
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/MetavidWiki/languages/MV_Messages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -617,22 +617,34 @@
618618 $dur = time_duration_2array( $seconds , array('days'=> '86400', 'hours'=> 3600,'minutes' => 60,'seconds' => 1));
619619 $o='';
620620 if( $dur['days']!=0){
621 - $msg = ($singular)?'mv_days_singular':'mv_days';
622 - $o.= wfMsg($msg, intval( $dur['days']) );
 621+ if( $singular ) {
 622+ $o.= wfMsg( 'mv_days_singular' );
 623+ } else {
 624+ $o.= wfMsg( 'mv_days', intval( $dur['days'] ) );
 625+ }
623626 }
624627 if( $dur['hours'] != 0 ){
625 - $msg = ($singular)?'mv_hours_singular':'mv_hours';
626 - $o.= wfMsg($msg, intval( $dur['hours']) );
 628+ if( $singular ) {
 629+ $o.= wfMsg( 'mv_hours_singular' );
 630+ } else {
 631+ $o.= wfMsg( 'mv_hours', intval( $dur['hours'] ) );
 632+ }
627633 }
628634 if( $dur['minutes'] != 0 ){
629 - $msg = ($singular)?'mv_minutes_singular':'mv_minutes';
630635 $o.=($o!='')?' ':'';
631 - $o.= wfMsg($msg, intval( $dur['minutes']) );
 636+ if( $singular ) {
 637+ $o.= wfMsg( 'mv_minutes_singular' );
 638+ } else {
 639+ $o.= wfMsg( 'mv_minutes', intval( $dur['minutes'] ) );
 640+ }
632641 }
633642 if( ( $short == false || $o == '' ) && $dur['seconds'] ){
634 - $msg = ($singular)?'mv_seconds_singular':'mv_seconds';
635643 $o.=($o!='')?' ':'';
636 - $o.= wfMsg($msg, intval( $dur['seconds']) );
 644+ if( $singular ) {
 645+ $o.= wfMsg( 'mv_seconds_singular' );
 646+ } else {
 647+ $o.= wfMsg( 'mv_seconds', intval( $dur['seconds'] ) );
 648+ }
637649 }
638650 return $o;
639651 }
Index: trunk/extensions/MetavidWiki/languages/MV_Messages.php
@@ -280,11 +280,11 @@
281281 'mv_contextmenu_opt' => 'Enable context menus',
282282 'mv_days' => '$1 {{PLURAL:$1|day|days}}',
283283 'mv_hours' => '$1 {{PLURAL:$1|hour|hours}}',
284 - 'mv_hours_singular' => '$1 hour',
 284+ 'mv_hours_singular' => '1 hour',
285285 'mv_minutes' => '$1 {{PLURAL:$1|minute|minutes}}',
286 - 'mv_minutes_singular' => '$1 minute',
 286+ 'mv_minutes_singular' => '1 minute',
287287 'mv_seconds' => '$1 {{PLURAL:$1|second|seconds}}',
288 - 'mv_seconds_singular' => '$1 second',
 288+ 'mv_seconds_singular' => '1 second',
289289 'mv_stream_length' => 'Total video length:',
290290
291291 'mv_sequence_timeline' => 'Sequence timeline:',

Comments

#Comment by Nikerabbit (talk | contribs)   15:38, 24 September 2009

What's the point of keeping the singular messages at all?

#Comment by Rotemliss (talk | contribs)   15:40, 24 September 2009

I am not even sure what the purpose of the $singular parameter is. However, I didn't check where it is used.

Status & tagging log