Currently, date formatting is customizable via Drupal settings. But it doesn't care about languages... The date formatting is different depending on the language.

English : Tuesday, March 13th 2007
French : Mardi, le 13 mars 2007

English : 03/13/2007
French : 13-03-2007

It would be nice to be able to customize date settings per language.

Comments

TSK2006’s picture

Title: Add date translation » My current fix...

I fixed this by calling a new theme hook in the Drupal core (in the date formatting function), then implementing it in my themes. This is giving code like:

function phptemplate_date_format($type, $format) {
$language = 'en';
if (function_exists('i18n_get_lang')) {
$language = i18n_get_lang();
}
switch ($language) {
case 'fr':
switch ($type) {
case 'custom':
switch ($format) {
case 'F dS':
$format = 'd F'; break;
}
break;
default:
switch ($format) {
case "F j, Y - H:i":
$format = "j F Y - H\hi";
}
}
break;
}
return $format;
}

As well, this new hook should be implemented in core officially.

jose reyero’s picture

Status: Active » Fixed

You can add the variables holding date formats to the translatable variables

See http://drupal.org/node/134002

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.