From 2526a809439c1287f421c320bc2efa25ccc4fe9c Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Tue, 30 Nov 2010 10:15:41 +0000 Subject: German months --- lib/news.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/news.php') diff --git a/lib/news.php b/lib/news.php index 7bb89e0c5..0a7bcc3c5 100644 --- a/lib/news.php +++ b/lib/news.php @@ -33,6 +33,11 @@ function html_news($locale = 'en') */ function news_date($dt, $locale = 'en') { + $months = array( + 'en' => array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'), + 'fr' => array('jan', 'fév', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'sept', 'oct', 'nov', 'déc'), + 'de' => array('Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez') + ); $formats = array( 'en' => 'M d Y', 'fr' => 'd M Y', @@ -42,7 +47,11 @@ function news_date($dt, $locale = 'en') $ft = array_key_exists($locale, $formats) ? $locale : 'default'; $dts = strtotime($dt); - return date($formats[$ft], $dts); + $dt = date($formats[$ft], $dts); + if (array_key_exists($locale, $months)) + $dt = str_replace($months['en'], $months[$locale], $dt); + + return $dt; } /** -- cgit v1.2.1