summaryrefslogtreecommitdiffstats
path: root/rss.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2012-06-12 20:59:43 -0700
committerArun Persaud <arun@nubati.net>2012-06-12 20:59:43 -0700
commit47a0a9b5b1c8acb36aa0e93179ce5a661a69427a (patch)
treecc54e31b32363e42ba8a7a7f2bc2bd10784a292c /rss.php
parent5d1647f138763213a32e3e1ba426e3f86157f018 (diff)
downloade-DoKo-47a0a9b5b1c8acb36aa0e93179ce5a661a69427a.tar.gz
e-DoKo-47a0a9b5b1c8acb36aa0e93179ce5a661a69427a.tar.bz2
e-DoKo-47a0a9b5b1c8acb36aa0e93179ce5a661a69427a.zip
use gettext for Atom feed
Diffstat (limited to 'rss.php')
-rw-r--r--rss.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/rss.php b/rss.php
index a06dc63..269b734 100644
--- a/rss.php
+++ b/rss.php
@@ -72,9 +72,28 @@ header("Content-Type: text/xml");
?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>E-DoKo Feed</title>
-<subtitle>Know when it is your turn</subtitle>
<?php
+ /* set language */
+ $PREF = DB_get_PREF($id);
+ $lang = $PREF['language'];
+
+ switch($lang)
+ {
+ case 'de':
+ putenv("LC_ALL=de_DE");
+ setlocale(LC_ALL, "de_DE");
+ // Specify location of translation tables
+ bindtextdomain("edoko", "./locale");
+ // Choose domain
+ textdomain("edoko");
+ break;
+ default:
+ /* do nothing */
+ }
+
+echo '<subtitle>'._('Know when it is your turn')."</subtitle>\n";
+
global $WIKI,$INDEX, $HOST;
/* output last creation date */
@@ -104,7 +123,7 @@ echo "</author>\n\n";
while( $r = DB_fetch_array($result))
{
echo "<entry>\n";
- echo "<title>game ".DB_format_gameid($r[1])."</title>\n";
+ echo "<title>"._('game').' '.DB_format_gameid($r[1])."</title>\n";
$url=$INDEX."?action=game&amp;me=".$r[0];
echo "<link href=\"".$HOST.$url."\" />\n";
$date = DB_get_game_timestamp($r[1]);
@@ -112,7 +131,7 @@ echo "</author>\n\n";
$date = date("Y-m-d",$timestamp);
echo "<id>tag:doko.nubati.net,$date:$url</id>\n";
echo "<updated>".date(DATE_ATOM,$timestamp)."</updated>\n";
- echo "<summary>Please use the link to access the game.</summary>\n";
+ echo '<summary>'._('Please use the link to access the game.')."</summary>\n";
echo "</entry>\n\n";
}