Skip to:
Content

BuddyPress.org

Changeset 624


Ignore:
Timestamp:
12/06/2008 01:42:04 AM (18 years ago)
Author:
apeatling
Message:

Fixed plural 's' translation issue on time since function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r623 r624  
    822822function bp_core_time_since( $older_date, $newer_date = false ) {
    823823        // array of time period chunks
     824
    824825        $chunks = array(
    825         array( 60 * 60 * 24 * 365 , __('year', 'buddypress') ),
    826         array( 60 * 60 * 24 * 30 , __('month', 'buddypress') ),
    827         array( 60 * 60 * 24 * 7, __('week', 'buddypress') ),
    828         array( 60 * 60 * 24 , __('day', 'buddypress') ),
    829         array( 60 * 60 , __('hour', 'buddypress') ),
    830         array( 60 , __('minute', 'buddypress') ),
    831         array( 1, __('second', 'buddypress') )
     826        array( 60 * 60 * 24 * 365 , __( 'year', 'buddypress' ), __( 'years', 'buddypress' ) ),
     827        array( 60 * 60 * 24 * 30 , __( 'month', 'buddypress' ), __( 'months', 'buddypress' ) ),
     828        array( 60 * 60 * 24 * 7, __( 'week', 'buddypress' ), __( 'weeks', 'buddypress' ) ),
     829        array( 60 * 60 * 24 , __( 'day', 'buddypress' ), __( 'days', 'buddypress' ) ),
     830        array( 60 * 60 , __( 'hour', 'buddypress' ), __( 'hours', 'buddypress' ) ),
     831        array( 60 , __( 'minute', 'buddypress' ), __( 'minutes', 'buddypress' ) ),
     832        array( 1, __( 'second', 'buddypress' ), __( 'seconds', 'buddypress' ) )
    832833        );
    833834
     
    849850        for ( $i = 0, $j = count($chunks); $i < $j; $i++) {
    850851                $seconds = $chunks[$i][0];
    851                 $name = $chunks[$i][1];
    852852
    853853                /* Finding the biggest chunk (if the chunk fits, break) */
     
    857857
    858858        /* Set output var */
    859         $output = ( $count == 1 ) ? '1 '. $name : "$count {$name}s";
     859        $output = ( $count == 1 ) ? '1 '. $chunks[$i][1] : $count . ' ' . $chunks[$i][2];
    860860
    861861        /* Step two: the second chunk */
     
    864864                $name2 = $chunks[$i + 1][1];
    865865               
    866                 if ( $name2 == __('second', 'buddypress') ) return $output;
     866                if ( $chunks[$i + 1][1] == __( 'second', 'buddypress' ) ) return $output;
    867867       
    868868                if ( ( $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ) ) != 0 ) {
    869869                        /* Add to output var */
    870                         $output .= ($count2 == 1) ? ', 1 '.$name2 : ", $count2 {$name2}s";
     870                        $output .= ($count2 == 1) ? ', 1 '. $chunks[$i + 1][1] : ", " . $count2 . ' ' . $chunks[$i + 1][2];
    871871                }
    872872        }
Note: See TracChangeset for help on using the changeset viewer.