5) $locale = 'en'; } $locales = array( 'en' => array('template' => '%2$d %3$s to Mageia 1 release', 'minus' => 'before', 'day' => 'day', 'days' => 'days'), 'de' => array('template' => 'Noch %2$s %3$s bis zum Release von Mageia 1', 'minus' => '', 'day' => 'Tag', 'days' => 'Tage'), 'fr' => array('template' => 'Mageia 1 %s %d %s', 'minus' => 'moins', 'day' => 'jour', 'days' => 'jours') ); if (!array_key_exists($locale, $locales)) $locale = 'en'; $l = $locales[$locale]; // Mageia 1 on June 1st, 2011 $release_ts = strtotime('2011/06/01 12:00:00'); $now_ts = time(); $diff = $release_ts - $now_ts; $s = ''; if ($diff < 0) { // todo (rda) } else { $diff = floor($diff / 3600 / 24); $s = sprintf(sprintf('

%s

', $l['template']), $l['minus'], $diff, $diff > 1 ? $l['days'] : $l['day']); } echo <<
{$s}
S;