This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Days / week / time ago translation

  • Creator
    Topic
  • #25650
    vnp
    Participant

    The ‘3 days ago’ is a nice feature on the post grid/list/etc meta.
    I’d like to be able to translate these easily.
    Is it an idea to put these in the string swap plugin?

    And what would be the best way to translate now, use a filter?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #25653
    Jason Bobich
    Keymaster

    Hi,

    You can use standard WordPress localization, or you can filter an array of all of them directly with the filter themeblvd_time_ago_locals from your child theme’s functions.php. See the function themeblvd_get_time_ago() in /framework/includes/helpers.php.

    #25658
    vnp
    Participant

    thanks!

    #25740
    vnp
    Participant

    For anyone searching for the copypaste

    function my_locals( $locals ) {
    	$locals =array(
    		'year' 		=> __('jaar', 'themeblvd'),
    		'years' 	=> __('jaren', 'themeblvd'),
    		'month' 	=> __('maand', 'themeblvd'),
    		'months' 	=> __('maanden', 'themeblvd'),
    		'week' 		=> __('week', 'themeblvd'),
    		'weeks' 	=> __('weken', 'themeblvd'),
    		'day' 		=> __('dag', 'themeblvd'),
    		'days' 		=> __('dagen', 'themeblvd'),
    		'hour' 		=> __('uur', 'themeblvd'),
    		'hours' 	=> __('uren', 'themeblvd'),
    		'minute' 	=> __('minuut', 'themeblvd'),
    		'minutes' 	=> __('minuten', 'themeblvd'),
    		'second' 	=> __('seconde', 'themeblvd'),
    		'seconds' 	=> __('seconden', 'themeblvd'),
    		'ago'		=> __('geleden', 'themeblvd'),
    		'error' 	=> __('een tijdje terug', 'themeblvd')
    	);
        return $locals;
    }
    add_filter( 'themeblvd_time_ago_locals', 'my_locals' );
    • This reply was modified 6 years, 5 months ago by Jason Bobich. Reason: Please use pre tags for non-inline code blocks
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.