From aeb9ef98850e762291bc6a1d39b31d1ac4db4817 Mon Sep 17 00:00:00 2001
From: Arun Persaud <arun@nubati.net>
Date: Mon, 31 Dec 2012 15:11:45 +0000
Subject: improved language detection using browser information; set the
 language directly in more places

previously one had to reload to get the language correct, now it should be correct right away.
We also read out the browser request for a language now.
---
 rss.php | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

(limited to 'rss.php')

diff --git a/rss.php b/rss.php
index 269b734..c089fb5 100644
--- a/rss.php
+++ b/rss.php
@@ -74,23 +74,9 @@ header("Content-Type: text/xml");
 <title>E-DoKo Feed</title>
 <?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 */
-    }
+/* set language */
+$PREF = DB_get_PREF($id);
+set_language($PREF['language']);
 
 echo '<subtitle>'._('Know when it is your turn')."</subtitle>\n";
 
-- 
cgit v1.2.3-18-g5258