views:

23

answers:

1

I am trying to set the date appear in the french way e.g "2 Mai" instead of "May 2"

here is my code:'

    <?php // Get today's date in the right format
    //$todaysDate = date('M d');
    $todaysDate = date('m/d/Y H:i:s');
    ?>
    <?php query_posts('showposts=5&category_name=events&meta_key=Date&meta_compare=>=&meta_value='.$todaysDate.'&orderby=meta_value=order=ASC'); ?>


    <?php 
        if (have_posts()) : while (have_posts()) : the_post();
        $eventMeta = get_post_meta($post->ID, 'Date', true);
        $eventDate = strtotime($eventMeta);
        $displayDate = date ('M d', $eventDate);?>
    <ul>
    <li>
    <span class="date"><?php echo $displayDate ; ?></span>
        <span><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
    </li>
<?php endwhile; else: ?>
<li><?php if ( (strtolower(ICL_LANGUAGE_CODE) == 'en') ) {echo("Sorry, no upcoming events for this month!");} ?>
<?php if ( (strtolower(ICL_LANGUAGE_CODE) == 'fr')) echo("D&eacute;sol&eacute;, aucun &eacute;v&eacute;nement &agrave; venir pour ce mois!") ?></li></ul>

<?php endif; ?>

How do I do it so that it switches the format depending on which language you are. To view the site click here

A: 
if(WPLANG == 'fr_FR'){
  //It's French
} else {
  // It's English
}
John P Bloch
I should actually backtrack a little bit. That checks whether the WordPress installation is in French, not if the user is using French. Also, the else statement means it's not French. It could still be German, Spanish, etc.If this needs to check whether the USER is reading in French, this won't work.
John P Bloch