diff --git a/article.php b/article.php index 196fae5d96a242e0b1bfb9acf5a27cdc8d0f5d8d..0f21a6cde3d9a88ec541b42178914490277dff8b 100644 --- a/article.php +++ b/article.php @@ -8,8 +8,8 @@ <section class="footnote"> <!-- Unfortunately, CSS means everything's got to be inline. --> - <p>Article numéro: <?php echo numeral(article_number(article_id()), true); ?> . <?php echo count_words(article_markdown()); ?> mots, <?php if(comments_open()): ?>, - <?php echo total_comments();?> commentaires pour le moment.<?php endif; ?> <?php echo article_custom_field('attribution'); ?></p> + <p>Article numéro: <?php echo article_number(article_id()); ?>, <?php echo count_words(article_markdown()); ?> mots <?php if(comments_open()): ?>, + <?php echo total_comments();?> <?php echo pluralise(total_comments(), "commentaire", "s") ?> pour le moment.<?php endif; ?> <?php echo article_custom_field('attribution'); ?></p> </section> </section> diff --git a/functions.php b/functions.php index 9e95c87d5dd5ae75cdad5c98687336b20ae91578..e7333f459a1d0bd709f9f0ce73ae14828c1b3df9 100644 --- a/functions.php +++ b/functions.php @@ -11,7 +11,6 @@ function numeral($number, $hideIfOne = false) { return ''; } - $test = abs($number) % 10; $ext = ((abs($number) % 100 < 21 and abs($number) % 100 > 4) ? 'th' : (($test < 4) ? ($test < 3) ? ($test < 2) ? ($test < 1) ? 'th' : 'st' : 'nd' : 'rd' : 'th')); return $number . $ext; } @@ -40,13 +39,13 @@ function relative_time($date) { } $times = array( - 31104000 => 'year', - 2592000 => 'month', - 604800 => 'week', - 86400 => 'day', - 3600 => 'hour', + 31104000 => 'an', + 2592000 => 'mois', + 604800 => 'semaine', + 86400 => 'jour', + 3600 => 'heure', 60 => 'minute', - 1 => 'second' + 1 => 'seconde' ); foreach($times as $seconds => $title) { @@ -54,7 +53,7 @@ function relative_time($date) { if($rounded > 1) { $rounded = round($rounded); - return $rounded . ' ' . pluralise($rounded, $title) . ' ago'; + return 'il y a ' . $rounded . ' ' . pluralise($rounded, $title); } } } diff --git a/posts.php b/posts.php index 9e7ba2a4ea11724c1a726ad4f4ac8c688e65961e..f1fbfe3293edb7cfe72e7a7d5f344e018ee3a479 100644 --- a/posts.php +++ b/posts.php @@ -16,7 +16,7 @@ </div> <footer> - Posted <time datetime="<?php echo date(DATE_W3C, article_time()); ?>"><?php echo relative_time(article_time()); ?></time> by <?php echo article_author('real_name'); ?>. + Posté <time datetime="<?php echo date(DATE_W3C, article_time()); ?>"><?php echo relative_time(article_time()); ?></time> par <?php echo article_author('real_name'); ?>. </footer> </article> </li>