WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Recently Viewed Posts] Translation to dutch (4 posts)

  1. Timple
    Member
    Posted 4 years ago #

    Hello,

    I started using the Recently Viewed Posts and I liked it to be in Dutch.

    I haven't got any experience with php but still managed to translate it.

    Replace this:

    function recently_viewed_posts_time_since( $original ) {
    		// array of time period chunks
    		$chunks = array(
    			array( 60 * 60 * 24 * 365 , 'year' ),
    			array( 60 * 60 * 24 * 30 , 'month' ),
    			array( 60 * 60 * 24 * 7, 'week' ),
    			array( 60 * 60 * 24 , 'day' ),
    			array( 60 * 60 , 'hour' ),
    			array( 60 , 'minute' ),
    		array( 1, 'second' ),
    		 );
    
    		$today = time(); /* Current unix time  */
    		$since = $today - $original;
    
    		// $j saves performing the count function each time around the loop
    		for ( $i = 0, $j = count( $chunks ); $i < $j; $i++ ) {
    
    			$seconds = $chunks[$i][0];
    			$name = $chunks[$i][1];
    
    			// finding the biggest chunk ( if the chunk fits, break )
    			if ( ( $count = floor( $since / $seconds ) ) != 0 ) {
    				// DEBUG print "<!-- It's $name -->\n";
    				break;
    			}
    		}
    
    		$print = ( $count == 1 ) ? '1 '.$name : "$count {$name}s";
    
    		if ( $i + 1 < $j ) {
    			// now getting the second item
    			$seconds2 = $chunks[$i + 1][0];
    			$name2 = $chunks[$i + 1][1];
    
    			// add second item if it's greater than 0
    			if ( ( $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ) ) != 0 ) {
    				$print .= ( $count2 == 1 ) ? ', 1 '.$name2 : ", $count2 {$name2}s";
    			}
    		}
    		return $print;
    	}

    By this:

    function recently_viewed_posts_time_since( $original ) {
    		// array of time period chunks
    		$chunks = array(
    			array( 60 * 60 * 24 * 365 , 'jaar' , 'jaar' ),
    			array( 60 * 60 * 24 * 30 , 'month' , 'maanden' ),
    			array( 60 * 60 * 24 * 7, 'week' , 'weken' ),
    			array( 60 * 60 * 24 , 'dag' , 'dagen' ),
    			array( 60 * 60 , 'uur' , 'uur' ),
    			array( 60 , 'minuut' , 'minuten' ),
    		array( 1, 'seconde' , 'seconden' ),
    		 );
    
    		$today = time(); /* Current unix time  */
    		$since = $today - $original;
    
    		// $j saves performing the count function each time around the loop
    		for ( $i = 0, $j = count( $chunks ); $i < $j; $i++ ) {
    
    			$seconds = $chunks[$i][0];
    			$name = $chunks[$i][1];
                            $names = $chunks[$i][2];
    
    			// finding the biggest chunk ( if the chunk fits, break )
    			if ( ( $count = floor( $since / $seconds ) ) != 0 ) {
    				// DEBUG print "<!-- It's $name -->\n";
    				break;
    			}
    		}
    
    		$print = ( $count == 1 ) ? '1 '.$name : "$count {$names}";
    
    		if ( $i + 1 < $j ) {
    			// now getting the second item
    			$seconds2 = $chunks[$i + 1][0];
    			$name2 = $chunks[$i + 1][1];
                            $names2 = $chunks[$i + 1][2];
    
    			// add second item if it's greater than 0
    			if ( ( $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ) ) != 0 ) {
    				$print .= ( $count2 == 1 ) ? ', 1 '.$name2 : ", $count2 {$names2}";
    			}
    		}
    		return $print;
    	}

    And ofcourse replace the word 'ago' with 'geleden'.

    I wanted to suggest this to the author but his site doesn't work here.

    Nederlands: vertaling Recently Viewed Posts naar het Nederlands

    See it live:
    http://www.clephas.nl

    http://wordpress.org/extend/plugins/recently-viewed-posts/

  2. Pinoy.ca
    Member
    Posted 4 years ago #

    Hey there. Thanks for checking it out.

    The next version will be fully internationalized.

  3. Scaramanga XXX
    Member
    Posted 3 years ago #

    Is there still support for this plugin? Or - if anybody has an idea.. My installed version of this plugin doesn't actualize anymore. Any idea?

    It happened sometimes under my previous version of WP (2.92). But since I've upgraded to WP 3.03 it stopped completely now.

  4. Scaramanga XXX
    Member
    Posted 3 years ago #

    Just played a bit around with it: It doesn't like the WordPress Stats Plugin...

  5. Scaramanga XXX
    Member
    Posted 3 years ago #

    Just played a bit around with it: It doesn't like the WordPress Stats Plugin...

Topic Closed

This topic has been closed to new replies.

About this Topic