aboutsummaryrefslogtreecommitdiffstats
path: root/lib/news.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2010-11-30 10:15:41 +0000
committerRomain d'Alverny <rda@mageia.org>2010-11-30 10:15:41 +0000
commit2526a809439c1287f421c320bc2efa25ccc4fe9c (patch)
tree42f7889114e899b1982039a6e3b0ebe964abea89 /lib/news.php
parent46df032b4cd05e2fdedd2a10fd3e6e7e2ed99d89 (diff)
downloadwww-2526a809439c1287f421c320bc2efa25ccc4fe9c.tar
www-2526a809439c1287f421c320bc2efa25ccc4fe9c.tar.gz
www-2526a809439c1287f421c320bc2efa25ccc4fe9c.tar.bz2
www-2526a809439c1287f421c320bc2efa25ccc4fe9c.tar.xz
www-2526a809439c1287f421c320bc2efa25ccc4fe9c.zip
German months
Diffstat (limited to 'lib/news.php')
-rw-r--r--lib/news.php11
1 files changed, 10 insertions, 1 deletions
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;
}
/**