• Hi folks,

    I’m not very good with php and I’ve got a little problem with the plugin Age Verify. It offers a french translation but the month aren’t translated. I checked the code and I found 2 functions.php :
    /plugins/age-verify/functions.php
    /plugins/age-verify/includes/functions.php

    In both of them there is this :

    $form .= '<p><select name="av_verify_m" id="av_verify_m">';
    foreach ( range( 1, 12 ) as $month ) :
    $month_name = date( 'F', mktime( 0, 0, 0, $month, 1 ) );
    $form .= '<option value="' . $month . '">' . $month_name . '</option>';
    endforeach;

    I tried to insert setlocale(LC_TIME, 'fr_FR'); before the $month_name line but it didn’t work.

    Also, I specify that the plugin has a language folder with an fr_FR.pot but the months aren’t translated in that file.

    If someone can help & why not explain to me how to translate the months, it would be very nice !

    And sorry for my bad english …

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter seiltanzer

    (@seiltanzer)

    Nobody to help me ?

    Thread Starter seiltanzer

    (@seiltanzer)

    Ok I found the solution :

    Replace

    $form .= '<p><select name="av_verify_m" id="av_verify_m">';
    foreach ( range( 1, 12 ) as $month ) :
    $month_name = date( 'F', mktime( 0, 0, 0, $month, 1 ) );
    $form .= '<option value="' . $month . '">' . $month_name . '</option>';
    endforeach;

    By

    foreach ( range( 1, 12 ) as $month ) :
    setlocale(LC_TIME, 'fr_FR');
    $month_name = ucfirst( utf8_encode( strftime( '%B', mktime( 0, 0, 0, $month, 1 ) ) ) );
    $form .= '<option value="' . $month . '">' . $month_name . '</option>';
    endforeach;

    in the two functions.php files.

    Thnx! realy helped me out.

    Dont replace the first line tho..

    just replace

    $month_name = date( 'F', mktime( 0, 0, 0, $month, 1 ) );

    By

    setlocale(LC_TIME, 'fr_FR');
    $month_name = ucfirst( utf8_encode( strftime( '%B', mktime( 0, 0, 0, $month, 1 ) ) ) );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Translate months on the WordPress Plugin Age Verify’ is closed to new replies.