• Resolved mic22

    (@mic22)


    In Polish there is a different suffix for words that are counting few.
    So:
    1 minute = in polish: 1 minuta
    2 minutes = in polish: 2 minuty
    3 minutes = in polish: 3 minuty
    4 minutes = in polish: 4 minuty
    5 minutes = in polish: 5 minut
    6 minutes = in polish: 6 minut
    and then it continues with “minut”. Also I know that most east Europe languages also have a different grammar for “few” counters, so it would help a lot of people.
    So the postfix_few would show the text after number for numbers: 2, 3 and 4
    If you could add this functionality to the shortcode and if possible to the plugin settings as well – IT WOULD BE AWESOME
    I have 10 projects running and on each I would like to show the reading time, but this has to be grammaricly correct ??
    Thank you in advance

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jason Yingling

    (@yingling017)

    Hi there,

    In Reading Time WP I added a new filter for editing the postfix output. You’ll need to include this code in your theme’s functions.php. Preferably with a child theme.

    /**
     * Adjust the reading time postfix.
     */
    function my_custom_reading_time( $postfix, $time, $singular, $multiple ) {
    	if ( $time == 1 ) {
    		$postfix = 'minuta';
    	} elseif ( $time == 2 || $time == 3 || $time == 4 ) {
    		$postfix = 'minuty';
    	} else {
    		$postfix = 'minut';
    	}
    
    	return $postfix;
    }
    add_filter( 'rt_edit_postfix', 'my_custom_reading_time', 10, 4 );

    Here it is in Gist form. https://gist.github.com/yingles/919f8edd402f1215f77fae623371f71b

    Let me know if you have any questions.

    Thread Starter mic22

    (@mic22)

    Works! thank you !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘a need for: postfix_few’ is closed to new replies.