Closed (fixed)
Project:
Internationalization
Version:
master
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Mar 2007 at 14:06 UTC
Updated:
28 Mar 2008 at 21:42 UTC
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
Comment #1
TSK2006 commentedI 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.
Comment #2
jose reyero commentedYou can add the variables holding date formats to the translatable variables
See http://drupal.org/node/134002
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.