diff options
| author | 2013-04-27 15:17:10 +0200 | |
|---|---|---|
| committer | 2013-04-27 15:17:10 +0200 | |
| commit | 81ea32d53e85b623356f56910b0a7aa9acf6bcd6 (patch) | |
| tree | aa62aa2d59a3d820f4fdd9c4bd08283d407af2b9 | |
| parent | 6efbedd1890b482a432254babc060713606ca6bf (diff) | |
Gestion de la traduction pour les dates (bug #38)
| -rw-r--r-- | app/i18n/fr.php | 30 | ||||
| -rw-r--r-- | app/views/index/index.phtml | 2 | ||||
| -rw-r--r-- | lib/lib_rss.php | 51 |
3 files changed, 36 insertions, 47 deletions
diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 2ddac3066..652ec2782 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -183,4 +183,34 @@ return array ( 'freshrss_description' => 'FreshRSS est un agrégateur de flux RSS à auto-héberger à l\'image de <a href="http://rsslounge.aditu.de/">RSSLounge</a>, <a href="http://tt-rss.org/redmine/projects/tt-rss/wiki">TinyTinyRSS</a> ou <a href="http://projet.idleman.fr/leed/">Leed</a>. Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable. L\'objectif étant d\'offrir une alternative sérieuse au futur feu-Google Reader.', 'credits' => 'Crédits', 'credits_content' => 'Des éléments de design sont issus du <a href="http://twitter.github.io/bootstrap/">projet Bootstrap</a> bien que FreshRSS n\'utilise pas ce framework. Les <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">icônes</a> sont issues du <a href="https://www.gnome.org/">projet GNOME</a>. La police <em>Open Sans</em> utilisée a été créée par <a href="https://www.google.com/webfonts/specimen/Open+Sans">Steve Matteson</a>. Les favicons sont récupérés grâce au site <a href="https://getfavicon.appspot.com/">getFavicon</a>. FreshRSS repose sur <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, un framework PHP.', + + // DATE + 'january' => 'janvier', + 'february' => 'février', + 'march' => 'mars', + 'april' => 'avril', + 'may' => 'mai', + 'june' => 'juin', + 'july' => 'juillet', + 'august' => 'août', + 'september' => 'septembre', + 'october' => 'octobre', + 'november' => 'novembre', + 'december' => 'décembre', + // format spécial pour la fonction date() + 'Jan' => '\j\a\n\v\i\e\r', + 'Feb' => '\f\é\v\r\i\e\r', + 'Mar' => '\m\a\r\s', + 'Apr' => '\a\v\r\i\l', + 'May' => '\m\a\i', + 'Jun' => '\j\u\i\n', + 'Jul' => '\j\u\i\l\l\e\t', + 'Aug' => '\a\o\û\t', + 'Sep' => '\s\e\p\t\e\m\b\r\e', + 'Oct' => '\o\c\t\o\b\r\e', + 'Nov' => '\n\o\v\e\m\b\r\e', + 'Dec' => '\d\é\c\e\m\b\r\e', + // format pour la fonction date(), %s permet d'indiquer le mois en toutes lettres + 'format_date' => 'd %s Y', + 'format_date_hour' => '\l\e d %s Y \à H\:i', ); diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 5c6ab0376..a7b67bcbc 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -51,7 +51,7 @@ if (isset ($this->entryPaginator)) { <?php $feed = $item->feed (true); ?> <li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="http://g.etfv.co/<?php echo $feed->website (); ?>" alt="" /> <span><?php echo $feed->name (); ?></span></a></li> <li class="item title"><?php echo $item->title (); ?></li> - <li class="item date">le <?php echo $item->date (); ?></li> + <li class="item date"><?php echo $item->date (); ?></li> <li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"> </a></li> </ul> diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 81a98590e..76c304064 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -20,55 +20,14 @@ function small_hash ($txt) { } function timestamptodate ($t, $hour = true) { - $jour = date ('d', $t); - $mois = date ('m', $t); - $annee = date ('Y', $t); - - switch ($mois) { - case 1: - $mois = 'janvier'; - break; - case 2: - $mois = 'février'; - break; - case 3: - $mois = 'mars'; - break; - case 4: - $mois = 'avril'; - break; - case 5: - $mois = 'mai'; - break; - case 6: - $mois = 'juin'; - break; - case 7: - $mois = 'juillet'; - break; - case 8: - $mois = 'août'; - break; - case 9: - $mois = 'septembre'; - break; - case 10: - $mois = 'octobre'; - break; - case 11: - $mois = 'novembre'; - break; - case 12: - $mois = 'décembre'; - break; - } - - $date = $jour . ' ' . $mois . ' ' . $annee; + $month = Translate::t (date('M', $t)); if ($hour) { - return $date . date (' \à H\:i', $t); + $date = Translate::t ('format_date_hour', $month); } else { - return $date; + $date = Translate::t ('format_date', $month); } + + return date ($date, $t); } function sortEntriesByDate ($entry1, $entry2) { |
