Skip to:
Content
Pages
Categories
Search
Top
Bottom

Date format in spanish

  • @alfredo49

    Participant

    Hi:

    I’ve been translating into Spanish the. Po, now I would like to know how to change the date format for bbpress forums, i.e: instead of 24 January 2013, 24 Enero 2013.

    Regards!

Viewing 10 replies - 1 through 10 (of 10 total)
  • @alfredo49

    Participant

    My blog is es_ES , the date format is in spanish in all of the blog except bbpress forums..

    @alfredo49

    Participant

    nobody?

    @lchambers

    Participant

    The function get_post_time is disable for translation. You can use a filter, example

    add_filter ( ‘get_post_time’, ‘new_date’, 10, 3);

    function new_date ($time, $d = ‘U’, $gmt = false) {
    $translate = true;
    $time = mysql2date($d, $time, $translate);
    return $time;
    }

    Un saludo šŸ˜‰

    @alfredo49

    Participant

    This filter i put in functions.php, isnt it?
    Thxs!!!!!!
    šŸ˜€ šŸ˜€

    @lchambers

    Participant

    OK, file functions.php in your theme’s folder.

    By the way, WordPress 3.5.1 and bbPress 2.2.4

    De nada… šŸ˜‰

    @alfredo49

    Participant

    There is a problem with that code when using latest post bbpres widget

    “last post was 43 years ago” when the last post was 6 days ago

    Regards

    @lchambers

    Participant

    Ay, bbPress make me feel so happy… šŸ˜‰

    add_filter ( ‘get_post_time’, ‘new_date’, 10, 3);

    function new_date ($time, $d = ā€˜Uā€™, $gmt = false) {
    $translate = true;
    $time = mysql2date($d, $time, $translate);
    remove_filter (‘get_post_time’, ‘new_date’, 10, 3);
    return $time;
    }

    Un saludo

    @alfredo49

    Participant

    Sorry, not run yet šŸ™ still showing “43 dias y 2 meses” in last post widget on the sidebar šŸ™

    Saludos!

    @lchambers

    Participant

    Please try this code instead:

    add_filter ( ‘bbp_get_reply_post_date’, ‘act_fecha’, 10, 6);
    add_filter ( ‘bbp_get_topic_post_date’, ‘act_fecha’, 10, 6);

    function act_fecha( $result, $reply_id, $humanize, $gmt, $date, $time ) {
    $date = get_post_time( get_option( ‘date_format’ ), $gmt, $reply_id, $translate = true );
    $result = sprintf( _x( ‘%1$s at %2$s’, ‘date at time’, ‘bbpress’ ), $date, $time );
    $return $result;
    }

    The above code would now work.

    Via ayudawordpres.com/foros

    @lchambers

    Participant

    Up!

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar