• Resolved Anonymous User 8097816

    (@anonymized-8097816)


    Hello,

    In the file \livemesh-siteorigin-widgets\includes\widgets\lsow-portfolio-widget\tpl\default.php, line 129, the function lsow_entry_published() is not completely internationalized.

    The implicit format is $format = “M d, Y” and there is no way to adapt it.

    You could remove $format from the function parameter list and add

    
    $format = esc_html__('M d, Y', 'livemesh-so-widgets') ;
    

    By the way, lsow_entry_published contains 2 return:

    1. return $published
    2. return $link

    To my knowledge, php does not use the second return.

    Here is a copy of the function :

    
    function lsow_entry_published($format = "M d, Y") {
    
        $published = '<span class="published"><abbr title="' . sprintf(get_the_time(esc_html__('l, F, Y, g:i a', 'livemesh-so-widgets'))) . '">' . sprintf(get_the_time($format)) . '</abbr></span>';
    
        return $published;
    
        $link = '<span class="published">' . '<a href="' . get_day_link(get_the_time(esc_html__('Y', 'livemesh-so-widgets')), get_the_time(esc_html__('m', 'livemesh-so-widgets')), get_the_time(esc_html__('d', 'livemesh-so-widgets'))) . '" title="' . sprintf(get_the_time(esc_html__('l, F, Y, g:i a', 'livemesh-so-widgets'))) . '">' . '<span class="updated">' . get_the_time($format) . '</span>' . '</a></span>';
    
        return $link;
    }
    

    I think the second calculated value (ie $link) is more interesting.

    Regards.

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

    (@livemesh)

    Have made the following change in local dev –

    function lsow_entry_published($format = null) {
        
        if (empty($format))
            $format = esc_html__("M d, Y", 'livemesh-so-widgets');
    
        $published = '<span class="published"><abbr title="' . sprintf(get_the_time(esc_html__('l, F, Y, g:i a', 'livemesh-so-widgets'))) . '">' . sprintf(get_the_time($format)) . '</abbr></span>';
    
        return $published;
    
        $link = '<span class="published">' . '<a href="' . get_day_link(get_the_time(esc_html__('Y', 'livemesh-so-widgets')), get_the_time(esc_html__('m', 'livemesh-so-widgets')), get_the_time(esc_html__('d', 'livemesh-so-widgets'))) . '" title="' . sprintf(get_the_time(esc_html__('l, F, Y, g:i a', 'livemesh-so-widgets'))) . '">' . '<span class="updated">' . get_the_time($format) . '</span>' . '</a></span>';
    
        return $link;
    }

    and will be part of next update.

    You are right about the double return statements- we just have it there as an alternative to switch to when we decide to. Thanks for all your inputs.

    Thread Starter Anonymous User 8097816

    (@anonymized-8097816)

    Hello,

    Great news !

    Thank you.

    Regards.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Livemesh Grid Localization’ is closed to new replies.