0

In order to display the date information in French, I have modified the node.tpl.php file as follows.

 print t('publié le !datetime',
      array('!datetime' => format_date($variables['node']->created, $type='medium', $format = 'D j F Y', $timezone = NULL, $langcode = 'fr'))
 );  

The week day, and the month are still displayed in English!

1 Answer 1

0

Add this to your template.php file.

function THEMENAME_preprocess_node(&$variables) {
  $variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date']));
}

You might need to add this to your node.page.tpl file.

$variables['submitted'] = t('Submitted on !datetime', array('!datetime' => $variables['date']));

The source is this post.

3
  • My drupal site is in english ! I know this solution but it doesn't work !! I need $langcode = 'fr'
    – user62025
    Mar 30, 2013 at 14:10
  • It seems that the format_date ignores the $language parameter ?
    – user62025
    Mar 30, 2013 at 14:25
  • Day of week and month are always in english !
    – user62025
    Apr 2, 2013 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.