add translation for config data
authorYves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Wed, 05 Oct 2011 18:11:31 +0200
changeset 291 db1e6bfaa54e
parent 290 2ddd11ec2da2
child 292 dfcc0e08f295
child 293 ec0911588143
child 306 70c9688a1486
add translation for config data
.hgignore
.settings/.jsdtscope
.settings/org.eclipse.core.resources.prefs
.settings/org.eclipse.wst.jsdt.ui.superType.container
.settings/org.eclipse.wst.jsdt.ui.superType.name
web/archives.php
web/client.php
web/common.php
web/index.php
web/player_embed.php
web/polemicaltimeline.php
--- a/.hgignore	Wed Oct 05 13:39:57 2011 +0200
+++ b/.hgignore	Wed Oct 05 18:11:31 2011 +0200
@@ -37,3 +37,6 @@
 syntax: regexp
 ^script/virtualenv/venv2$
 ^script/virtualenv/venv_prod$
+
+syntax: regexp
+^\.settings$
\ No newline at end of file
--- a/.settings/.jsdtscope	Wed Oct 05 13:39:57 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path=""/>
-	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
-		<attributes>
-			<attribute name="hide" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
-	<classpathentry kind="output" path=""/>
-</classpath>
--- a/.settings/org.eclipse.core.resources.prefs	Wed Oct 05 13:39:57 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#Thu Jul 21 03:09:15 CEST 2011
-eclipse.preferences.version=1
-encoding//script/lib/iri_tweet/export_twitter_alchemy.py=utf-8
-encoding//script/rest/export_twitter.py=utf-8
-encoding//script/virtualenv/venv/lib/python2.6/site-packages/twitter_text/__init__.py=utf-8
-encoding//script/virtualenv/venv/lib/python2.6/site-packages/twitter_text/extractor.py=utf-8
-encoding//script/virtualenv/venv/lib/python2.6/site-packages/twitter_text/tests.py=utf-8
--- a/.settings/org.eclipse.wst.jsdt.ui.superType.container	Wed Oct 05 13:39:57 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
--- a/.settings/org.eclipse.wst.jsdt.ui.superType.name	Wed Oct 05 13:39:57 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-Window
\ No newline at end of file
--- a/web/archives.php	Wed Oct 05 13:39:57 2011 +0200
+++ b/web/archives.php	Wed Oct 05 18:11:31 2011 +0200
@@ -18,11 +18,11 @@
     <!-- Framework CSS -->
     <link rel="stylesheet" href="<?php echo(registry_url('blueprint-screen','css'));?>" type="text/css" media="screen, projection"/>
     <link rel="stylesheet" href="<?php echo(registry_url('blueprint-print','css'));?>" type="text/css" media="print"/>
-    <!--[if lt IE 8]><link rel="stylesheet" href="<?php echo(registry_url('blueprint-ie','css'));?>" type="text/css" media="screen, projection"><![endif]--> 
+    <!--[if lt IE 8]><link rel="stylesheet" href="<?php echo(registry_url('blueprint-ie','css'));?>" type="text/css" media="screen, projection"><![endif]-->
 	<link rel="stylesheet" href="<?php echo(registry_url('blueprint-plugins-fancy-type','css'));?>" type="text/css" media="screen, projection"/>
 	<link rel="stylesheet" href="<?php echo(registry_url('custom','css'));?>" type="text/css" media="screen, projection"/>
 
-	<!-- JAVASCRIPT --> 
+	<!-- JAVASCRIPT -->
 	<script type="text/javascript" src="<?php echo(registry_url('jquery','js'));?>"></script>
 
 	<!-- FONT -->
@@ -44,7 +44,7 @@
 		var _gaq = _gaq || [];
 		_gaq.push(['_setAccount', 'UA-23581291-1']);
 		_gaq.push(['_trackPageview']);
-		_gaq.push(['_setAllowAnchor', true]); 
+		_gaq.push(['_setAllowAnchor', true]);
 	  
 		(function() {
 		    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
@@ -58,7 +58,7 @@
 	<div id="sendUsFeedBack"><a href="<?php echo($C_feedback_form_url); ?>" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/sendusfeedback.png"></a></div>
     <div class="container">
       <img src="images/ENMI_2010_logo.gif" class="logo">
-	  <ul class="menu"> 
+	  <ul class="menu">
 		  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>" class="menuLink">
 		  	<?php print $translate->_("Accueil"); ?></a></li>
 		  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>about.php" class="menuLink">
@@ -66,13 +66,13 @@
 		  <li ><a href="mailto:contact@iri.centrepompidou.fr" class="menuLink" >
 		  	<?php print $translate->_("Contact"); ?></a></li>
 	  </ul>
-	  <ul class="menu"> 
+	  <ul class="menu">
 		  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>archives.php" class="menuLink">
 		  	<?php print $translate->_("Archives"); ?></a></li>
 	  </ul>
 	  
 	  
-	  <ul class="menu lang" > 
+	  <ul class="menu lang" >
 	  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>archives.php?lang=ja_JP" class="menuLink" >
 	       <img src='images/flag_jp.gif'<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
 	        <?php print $translate->_("Japonais"); ?></a></li>
@@ -85,14 +85,14 @@
 	  </ul>
 	</div>
 	<div class="container">
-	  <!-- --> 
+	  <!-- -->
 	  <div class="archivesBoxArchives">
 		<div class="archivesBoxContainer">
 			<!-- -->
 			<h3 class="archivesTitle"><?php print $translate->_("Archive Title :"); ?></h3>
 			<!-- -->
 			<div id="all_archives">
-			    <?php display_archives_list($archives_list, "archive_box_3", URL_ROOT, dirname(__FILE__)."/"); ?>
+			    <?php display_archives_list($archives_list, "archive_box_3", URL_ROOT, dirname(__FILE__)."/", $translate); ?>
 			</div>
 		</div>
 	  </div>
@@ -100,13 +100,13 @@
       <div class="footer">
 		<hr>
 		<?php
-			print $translate->_("footer text home"); 
+			print $translate->_("footer text home");
 			if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
 					echo("| 	<a href='clear.php'  class='footerLink'>".$translate->_("D&eacute;connexion")."</a>");
 			}
 		 ?>
 		  <input type="text" id="txt" size="3" style="visibility:hidden;"/>
-	  </div>   
+	  </div>
 	
 
     </div>
--- a/web/client.php	Wed Oct 05 13:39:57 2011 +0200
+++ b/web/client.php	Wed Oct 05 18:11:31 2011 +0200
@@ -1,9 +1,9 @@
 <?php
 
 if(!isset($_REQUEST['rep'])) {
-	include_once dirname(__FILE__).'/common.php';
-	header('Location: ' . URL_ROOT . "$C_default_rep/client.php" );
-	exit();
+    include_once dirname(__FILE__).'/common.php';
+    header('Location: ' . URL_ROOT . "$C_default_rep/client.php" );
+    exit();
 }
 
 $rep = $_REQUEST['rep'];
@@ -30,13 +30,13 @@
 
 
 $big_visual_url = URL_ROOT."/$rep/images/big_visuel_rsln_mb.jpg";
-if(isset($config['client_visual']) && $config['client_visual'] != null ) {
-	$big_visual_url = URL_ROOT."$rep/".$config['client_visual'];
+if($translate->_('config__client_visual') != 'config__client_visual' && $translate->_('config__client_visual') != null ) {
+	$big_visual_url = URL_ROOT."$rep/".$translate->_('config__client_visual');
 }
 
 $head_logo = URL_ROOT."$rep/images/head_logo.gif";
-if(isset($config['head_logo']) && $config['head_logo'] != null ) {
-	$head_logo = URL_ROOT."$rep/".$config['head_logo'];
+if($translate->_('config__head_logo') != 'config__head_logo' && $translate->_('config__head_logo') != null ) {
+	$head_logo = URL_ROOT."$rep/".$translate->_('config__head_logo');
 }
 
 ?>
@@ -48,17 +48,17 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <title>Live Video and Annotation</title>
-	<meta http-equiv="X-UA-Compatible" content="IE=8" /> 
+	<meta http-equiv="X-UA-Compatible" content="IE=8" />
 
     <!-- Framework CSS -->
     <link rel="stylesheet" href="<?php echo(registry_url('blueprint-screen','css'));?>" type="text/css" media="screen, projection"/>
     <link rel="stylesheet" href="<?php echo(registry_url('blueprint-print','css'));?>" type="text/css" media="print"/>
-    <!--[if lt IE 8]><link rel="stylesheet" href="<?php echo(registry_url('blueprint-ie','css'));?>" type="text/css" media="screen, projection"><![endif]--> 
+    <!--[if lt IE 8]><link rel="stylesheet" href="<?php echo(registry_url('blueprint-ie','css'));?>" type="text/css" media="screen, projection"><![endif]-->
 	<link rel="stylesheet" href="<?php echo(registry_url('blueprint-plugins-fancy-type','css'));?>" type="text/css" media="screen, projection"/>
 	<link rel="stylesheet" href="<?php echo(registry_url('custom','css'));?>" type="text/css" media="screen, projection"/>
 	<link rel="stylesheet" href="<?php echo(registry_url('fancybox','css'));?>" type="text/css" media="screen">
 
-	<!-- JAVASCRIPT --> 
+	<!-- JAVASCRIPT -->
 	<script type="text/javascript" src="<?php echo(registry_url('jquery','js'))?>"></script>
 	<script type="text/javascript" src="<?php echo(registry_url('fancybox','js'))?>"></script>
 	<script type="text/javascript" src="<?php echo(registry_url('jquery-tools','js'))?>"></script>
@@ -69,7 +69,7 @@
 	<link href='<?php echo(registry_url('PT-Sans','font'))?>' rel='stylesheet' type='text/css'>
 	<link href='<?php echo(registry_url('Geo','font'))?>' rel='stylesheet' type='text/css'>
 
-	<script type="text/javascript">	
+	<script type="text/javascript">
 	$(document).ready(function() {
 
 			doTimer();
@@ -104,7 +104,7 @@
 				add_grammar("??");
 			});
 			
-			// SEND TWEETS 
+			// SEND TWEETS
 			$("#sendTweet").click(function(){
 				var MyStatus = $('#status').val();
 				$.post('tweet_ajax.php', {status:MyStatus}
@@ -123,7 +123,7 @@
 					
 				});
 				
-			});	
+			});
 
 			$("#status").bind("change keyup paste blur focus",function() {
 				newval = 140-$("#status").val().length;
@@ -133,13 +133,13 @@
 				}
 				else {
 					$('#tweetCounter').removeClass("tweetCounterNegative");
-				}				
-			});		
+				}
+			});
 			
 			$(".timeFrame").tooltip();
 			/*
-			*   Lightbox button 
-			*/			
+			*   Lightbox button
+			*/
 			
 			$("#Program").fancybox({
 				'width'				: '75%',
@@ -154,21 +154,20 @@
 				$.fancybox.close();
 			});
 			
-			// Buttons 
+			// Buttons
 			
-		
-		});
-		
-		
-		<!-- LIMIT TEXTAREA:
+
+        });
+
+		//<!-- LIMIT TEXTAREA:
 		function imposemax(Object) {
             return (Object.value.length <= 140);
-		}
-		// End -->
+		};
+        // End -->
 		
-		<!-- TIMER 
+		//<!-- TIMER
 	    var c=0;
-		var t;
+        var t;
 		var timer_is_on=0;
 
 		function timedCount()
@@ -224,7 +223,7 @@
 	  var _gaq = _gaq || [];
 	  _gaq.push(['_setAccount', 'UA-23581291-1']);
 	  _gaq.push(['_trackPageview']);
-	  _gaq.push(['_setAllowAnchor', true]); 
+	  _gaq.push(['_setAllowAnchor', true]);
 	
 	  (function() {
 	    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
@@ -240,17 +239,17 @@
     <div class="container">
       <img src="<?php echo($head_logo); ?>" class="Producteur logo">
       <div id="minilogo" style="margin-left:85px;height:5px;top:5px;"></div>
-	  <ul class="menu"> 
+	  <ul class="menu">
 	  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>" class="menuLink">
 	  	<?php print $translate->_("Accueil"); ?> </a></li>
-	  <li class="menuUnderline" ><a href="<?php echo($config['link']); ?>" class="menuLink" target="_blank" id='Program'> 
+	  <li class="menuUnderline" ><a href="<?php echo($translate->_('config__link')); ?>" class="menuLink" target="_blank" id='Program'>
 	  	<?php print $translate->_("Programme"); ?></a></li>
 	  <li ><a href="about.php" class="menuLink" >
 	  	<?php print $translate->_("A propos"); ?></a></li>
 
 	  </ul>
 	  
-	  	  <ul class="menu" > 
+	  	  <ul class="menu" >
 	  <li class="menuUnderline"><a href="<?php URL_ROOT ?>client.php?lang=ja_JP" class="menuLink" >
 	       <img src='<?php echo(URL_ROOT); ?>images/flag_jp.gif'<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
 	        <?php print $translate->_("Japonais"); ?></a></li>
@@ -266,28 +265,28 @@
 	  <div class="videoLive">
 	  <?php if ($config['islive']):?>
 	  <div class="videoLivePlayer">
-			<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="500" height="375"> 
-				<param name="movie" value="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf" /> 
-				<param name="allowfullscreen" value="true" /> 
-				<param name="allowscriptaccess" value="always" /> 
+			<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="500" height="375">
+				<param name="movie" value="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf" />
+				<param name="allowfullscreen" value="true" />
+				<param name="allowscriptaccess" value="always" />
 				<param name="wmode" value="transparent" />
-				<param name="flashvars" value="autostart=true&live=true&image=<?php echo($big_visual_url); ?>&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&controlbar=none&autostart=true" /> 
-				<embed 
+				<param name="flashvars" value="autostart=true&live=true&image=<?php echo($big_visual_url); ?>&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&controlbar=none&autostart=true" />
+				<embed
 					type="application/x-shockwave-flash"
 					id="player2"
 					name="player2"
-					src="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf" 
-					width="500" 
+					src="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf"
+					width="500"
 					height="375"
-					allowscriptaccess="always" 
+					allowscriptaccess="always"
 					allowfullscreen="true"
 					wmode="transparent"
-					flashvars="autostart=true&live=true&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&image=<?php echo($big_visual_url); ?>&controlbar=none&autostart=true" 
+					flashvars="autostart=true&live=true&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&image=<?php echo($big_visual_url); ?>&controlbar=none&autostart=true"
 					
-				/> 
-			</object> 
+				/>
+			</object>
 			
-		</div>	
+		</div>
 	  	<?php else: ?>
 	  
 		<div class="videoLivePlayer">
@@ -297,15 +296,15 @@
 		
 	  </div>
 
-	<div class="videoLiveProgram">	
+	<div class="videoLiveProgram">
 		
 		<div class="arrowContainer">
 			<div class="arrow"> </div>
 		</div>
 		<div class="videoLiveProgramTitle">
-			<b><?php echo($config['title']); ?></b></div>
+			<b><?php echo($translate->_('config__title')); ?></b></div>
 		<div class="videoLiveProgramDescription">
-			<br><?php echo($config['description']); ?></div>
+			<br><?php echo($translate->_('config__description')); ?></div>
 		
 		
 	</div>
@@ -334,18 +333,18 @@
 			
 			<a class="button_w" href="#"  id="sendTweet" style="float:right;margin-right:15px;margin-left:35px;width:70px;" >
 				<span><?php print $translate->_("Envoyer"); ?></span>
-			</a> 
+			</a>
 			<!--<button name="s" type="button" id="sendTweet"
 					style="float:right;margin-right:15px;margin-left:35px;width:70px;"  >Envoyer</button>-->
 			<?php if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])): ?>
-			<input id="tweetCounter" value="<?php echo(140-strlen($config[hashtag]));?>" disabled="disabled" size="3"/>
+			<input id="tweetCounter" value="<?php echo(140-strlen($config['hashtag']));?>" disabled="disabled" size="3"/>
 			<?php endif;?>
-			<a 
+			<a
 					
 					id="positive"
 					title="accord"
 					class="tweetButton">++</a>
-			<a 
+			<a
 					
 					id="negative"
 					title="désaccord"
@@ -355,9 +354,9 @@
 					id="reference"
 					title="reference"
 					class="tweetButton">==</a>
-			<a 
+			<a
 					
-					id="question"  
+					id="question"
 					title="question"
 					class="tweetButton"> ??</a>
 		</form>
@@ -401,8 +400,8 @@
 
       <div class="footer">
 		<hr>
-		 <?php 
-				echo($config['partenaires']);
+		 <?php
+				echo($translate->_('config__partenaires'));
 				
 				if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
 					echo("| 	<a href='clear.php'  class='footerLink'>".$translate->_("D&eacute;connexion")."</a>");
@@ -410,7 +409,7 @@
 		 ?>
 		  <input type="hidden" id="txt"/>
 		  
-	  </div>   
+	  </div>
 	
 
     </div>
--- a/web/common.php	Wed Oct 05 13:39:57 2011 +0200
+++ b/web/common.php	Wed Oct 05 18:11:31 2011 +0200
@@ -10,6 +10,39 @@
     . PATH_SEPARATOR . get_include_path()
 );
 
+function get_config_translations($config) {
+
+    $fr = array();
+    $en = array();
+    $jp = array();
+    
+    $array_loop = array("fr"=>&$fr,"en"=>&$en,"jp"=>&$jp);
+    /**
+    * add all config key as translation.
+    * translation key is "config__<config_key>"
+    */
+    foreach ($config as $key => $value) {
+        $translation_key = "config__$key";
+    
+        foreach ($array_loop as $lang => &$lang_array) {
+            if(is_array($value) && count(array_intersect_key($value,$array_loop)) > 0 ) {
+                if (array_key_exists($lang, $value)) {
+                    $lang_array[$translation_key] = $value[$lang];
+                }
+                elseif (array_key_exists('fr', $value)) {
+                    $lang_array[$translation_key] = $value['fr'];
+                }
+            }
+            else {
+                $lang_array[$translation_key] = $value;
+            }
+        }
+    }
+    
+    return $array_loop;
+    
+}
+
 /**
 * Base configuration
 */
@@ -69,17 +102,27 @@
 **/
 
 
-Zend_Loader::loadClass('Zend_Translate'); 
-Zend_Loader::loadClass('Zend_Http_Cookie'); 
+Zend_Loader::loadClass('Zend_Translate');
+Zend_Loader::loadClass('Zend_Http_Cookie');
 
 
 $client = new Zend_Http_Client();
 $translate = new Zend_Translate('array', $init, 'fr');
 
+
 $translate->addTranslation($english, 'en');
 $translate->addTranslation($japan, 'ja_JP');
 $translate->addTranslation($french, 'fr');
 
+if(isset($config)) {
+    $config_translations = get_config_translations($config);
+    
+    
+    $translate->addTranslation($config_translations['en'], 'en');
+    $translate->addTranslation($config_translations['jp'], 'ja_JP');
+    $translate->addTranslation($config_translations['fr'], 'fr');
+}
+    
 $actual = $translate->getLocale();
 
 //$translate->setLocale("en");
@@ -199,21 +242,34 @@
 
 }
 
-function get_archive_box($rep, $metadata, $url_root, $basepath) {
+function get_archive_box($rep, $metadata, $url_root, $basepath, &$translate) {
 
 	include("$basepath$rep/config.php");
-
+	
+	
+	$config_translations = get_config_translations($config);
+	
+	// save the locale because it gets changed when adding translations
+	$locale = $translate->getLocale();
+	
+	$translate->addTranslation($config_translations['en'], 'en');
+	$translate->addTranslation($config_translations['jp'], 'ja_JP');
+	$translate->addTranslation($config_translations['fr'], 'fr');
+	
+	// set the locale back
+	$translate->setLocale($locale);
+	
 	$id = "abox_$rep".(($metadata!=null)?"_$metadata":"");
 	$hash = ($metadata!=null)?"#metadata=$metadata":"";
-	$tail_img = $config['archive_img'];
+	$tail_img = $translate->_('config__archive_img');
 	if(is_array($tail_img)) {
 		$tail_img = $tail_img[$metadata];
 	}
-	$archive_title = $config['archive_title'];
+	$archive_title = $translate->_('config__archive_title');
 	if(is_array($archive_title)) {
 		$archive_title = $archive_title[$metadata];
 	}
-	$archive_description = $config['archive_description'];
+	$archive_description = $translate->_('config__archive_description');
 	if(is_array($archive_description)) {
 		$archive_description = $archive_description[$metadata];
 	}
@@ -233,7 +289,9 @@
 
 }
 
-function display_archives_list($archives_list, $box_class, $url_root, $basepath) {
+function display_archives_list($archives_list, $box_class, $url_root, $basepath, &$translate) {
+    
+    
 	for($i=0;$i<count($archives_list);$i++) {
 		if(($i % 3)==0) {
 			print("			    <div class=\"$box_class\">\n");
@@ -246,7 +304,7 @@
 			$archive_name = $archive_ref[0];
 			$metadata = $archive_ref[1];
 		}
-		print(get_archive_box($archive_name,$metadata, $url_root, $basepath));
+		print(get_archive_box($archive_name,$metadata, $url_root, $basepath, $translate));
 		if(($i % 3)==2 || $i == (count($archives_list)-1)) {
 			print("			    </div>\n");
 		}
--- a/web/index.php	Wed Oct 05 13:39:57 2011 +0200
+++ b/web/index.php	Wed Oct 05 18:11:31 2011 +0200
@@ -38,12 +38,12 @@
     <!-- Framework CSS -->
     <link rel="stylesheet" href="<?php echo(registry_url('blueprint-screen','css'));?>" type="text/css" media="screen, projection"/>
     <link rel="stylesheet" href="<?php echo(registry_url('blueprint-print','css'));?>" type="text/css" media="print"/>
-    <!--[if lt IE 8]><link rel="stylesheet" href="<?php echo(registry_url('blueprint-ie','css'));?>" type="text/css" media="screen, projection"><![endif]--> 
+    <!--[if lt IE 8]><link rel="stylesheet" href="<?php echo(registry_url('blueprint-ie','css'));?>" type="text/css" media="screen, projection"><![endif]-->
 	<link rel="stylesheet" href="<?php echo(registry_url('blueprint-plugins-fancy-type','css'));?>" type="text/css" media="screen, projection"/>
 	<link rel="stylesheet" href="<?php echo(registry_url('custom','css'));?>" type="text/css" media="screen, projection"/>
 	<link rel="stylesheet" href="<?php echo(registry_url('tabs-slideshow','css'));?>" type="text/css" media="screen, projection">
 
-	<!-- JAVASCRIPT --> 
+	<!-- JAVASCRIPT -->
 	<script type="text/javascript" src="<?php echo(registry_url('jquery','js'));?>"></script>
 	<script type="text/javascript" src="<?php echo(registry_url('jquery-tools','js'));?>"></script>
 	<script type="text/javascript" src="<?php echo(registry_url('jquery-mousewheel','js'));?>"></script>
@@ -53,7 +53,7 @@
 	<link href='<?php echo(registry_url('PT-Sans','font'));?>' rel='stylesheet' type='text/css'>
 	<link href='<?php echo(registry_url('Geo','font'));?>' rel='stylesheet' type='text/css'>
 
-	<script type="text/javascript">	
+	<script type="text/javascript">
 	$(document).ready(function() {
 		$(".loginbutton").click(function() {
 			document.location.href="<?php echo(URL_ROOT.$C_default_rep); ?>/client.php?CONNECT=true";
@@ -77,7 +77,7 @@
 			rotate: false,
 			interval: 4000,
 			clickable:false
-		}).slideshow();		
+		}).slideshow();
 		
 		$(".slidetabs").data("slideshow").play();
 
@@ -93,7 +93,7 @@
 	  var _gaq = _gaq || [];
 	  _gaq.push(['_setAccount', 'UA-23581291-1']);
 	  _gaq.push(['_trackPageview']);
-	  _gaq.push(['_setAllowAnchor', true]); 
+	  _gaq.push(['_setAllowAnchor', true]);
 	
 	  (function() {
 	    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
@@ -106,7 +106,7 @@
 	<div id="sendUsFeedBack"><a href="<?php echo($C_feedback_form_url); ?>" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/sendusfeedback.png"></a></div>
     <div class="container">
       <img src="images/ENMI_2010_logo.gif" class="logo">
-	  <ul class="menu"> 
+	  <ul class="menu">
 	  <li class="menuUnderline"><a href="<?php echo(URL_ROOT.$C_default_rep); ?>/client.php?CONNECT=true" class="menuLink">
 	  	<?php print $translate->_("S&apos;identifier"); ?></a></li>
 	  <li class="menuUnderline"><a href="about.php" class="menuLink">
@@ -114,12 +114,12 @@
 	  <li ><a href="mailto:contact@iri.centrepompidou.fr" class="menuLink" >
 	  	<?php print $translate->_("Contact"); ?></a></li>
 	  </ul>
-	  <ul class="menu"> 
+	  <ul class="menu">
 		  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>archives.php" class="menuLink">
 		  	<?php print $translate->_("Archives"); ?></a></li>
 	  </ul>
 	  
-	  <ul class="menu lang" > 
+	  <ul class="menu lang" >
 	  <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>index.php?lang=ja_JP" class="menuLink" >
 	       <img src='images/flag_jp.gif'<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
 	        <?php print $translate->_("Japonais"); ?></a></li>
@@ -155,7 +155,7 @@
 				<?php print $translate->_("1.1 TextSlide"); ?></span></a>
 				<?php print $translate->_("1.2 TextSlide"); ?>,<br/> <br/>
 				<a class="button_w" href="#"  id="ACCES"><span>
-				<?php print $translate->_("1.3 TextSlide"); ?></span></a> 
+				<?php print $translate->_("1.3 TextSlide"); ?></span></a>
 				</p>
 				</div>
 				<!-- second slide -->
@@ -202,7 +202,7 @@
 		</div>
 		  
 	  </div>
-	  <!-- --> 
+	  <!-- -->
 	  <div class="archivesBox">
 	  <div class="archivesBoxHeader"></div>
 
@@ -220,7 +220,7 @@
 			<div class="items">
 			    <?php
 			    $arch_list = array_reverse($archives_list);
-			   	display_archives_list($arch_list, "archive_box_3 item", URL_ROOT, dirname(__FILE__)."/");
+			   	display_archives_list($arch_list, "archive_box_3 item", URL_ROOT, dirname(__FILE__)."/", $translate);
 			    ?>
 		    </div>
 		</div>
@@ -231,18 +231,18 @@
       <div class="footer">
 		<hr>
 		<?php
-			print $translate->_("footer text home"); 
+			print $translate->_("footer text home");
 			if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
 					echo("| 	<a href='clear.php'  class='footerLink'>".$translate->_("D&eacute;connexion")."</a>");
 			}
 		 ?>
 		  <input type="text" id="txt" size="3" style="visibility:hidden;"/>
-	  </div>   
+	  </div>
 	
 
     </div>
 	
-	<!-- LIGHTBOX --> 
+	<!-- LIGHTBOX -->
 	<div style="display:none;">
 		<div id="Aboutbox" >
 		<div class="lightBorder">
@@ -253,7 +253,7 @@
 			<div>
 				<br/>
 				<a class="button_b" href="#"  id="IDENTIFIER"><span>S'identifier</span></a> <br/><br/>
-				<a class="button_w" href="#"  id="ACCES"><span>Libre accès</span></a> 
+				<a class="button_w" href="#"  id="ACCES"><span>Libre accès</span></a>
 			</div>
 		</div>
 		</div>
--- a/web/player_embed.php	Wed Oct 05 13:39:57 2011 +0200
+++ b/web/player_embed.php	Wed Oct 05 18:11:31 2011 +0200
@@ -6,13 +6,13 @@
  */
 $rep = $_REQUEST['rep'];
 include_once dirname(__FILE__).'/'.$rep.'/config.php';
-// configuration 
+// configuration
 include 'common.php';
 
-// todo : 
+// todo :
 // - gestion du parent.document.location mediafragment
-// - limite taille vertical embed 
-// - ajouter la polemic timline en dessous de la video 
+// - limite taille vertical embed
+// - ajouter la polemic timline en dessous de la video
 
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
@@ -23,9 +23,9 @@
 	
 	<!-- JAVASCRIPT -->
 	<script type="text/javascript" src="<?php echo(registry_url('jquery','js'))?>"></script>
-	<script type="text/javascript">	
+	<script type="text/javascript">
 		$.noConflict();
-	</script>	
+	</script>
 	<script type="text/javascript" src="<?php echo(registry_url('jquery-ui','js'))?>"></script>
 	<script type="text/javascript" src="<?php echo(registry_url('raphael','js'))?>"></script>
 	
@@ -34,7 +34,7 @@
 	<link href='<?php echo(registry_url('PT-Sans','font'))?>' rel='stylesheet' type='text/css'>
 	<link href='<?php echo(registry_url('Geo','font'))?>' rel='stylesheet' type='text/css'>
 
-	<style type="text/css"> 
+	<style type="text/css">
 		body{
 			padding:0px;
 			margin:0px;
@@ -47,7 +47,7 @@
 			 padding : 3px;
 			 z-index: 10000000000;
 			 max-width: 200px;
-		}	
+		}
 		#tip {
 			display: none;
 			background: transparent url("<?php echo(URL_ROOT);?>images/white_arrow_long.png");
@@ -74,7 +74,7 @@
 	  var _gaq = _gaq || [];
 	  _gaq.push(['_setAccount', 'UA-23581291-1']);
 	  _gaq.push(['_trackPageview']);
-	  _gaq.push(['_setAllowAnchor', true]); 
+	  _gaq.push(['_setAllowAnchor', true]);
 	
 	
 	  (function() {
@@ -96,13 +96,13 @@
 					height:<?php echo($config['player_height']); ?>,
 					heightmax:<?php echo($config['player_height']); ?>,
 					duration:<?php echo($config['duration']); ?>,
-					metadata:"<?php echo($config['metadata']); ?>"
+					metadata:"<?php echo($translate->_('config__metadata')); ?>"
 					}
   </script>
   <script type='text/javascript' src='<?php echo(URL_ROOT);?>res/metadataplayer.polemic/src/js/polemic.js'></script>
   
   <body>
-  <!-- tooltip --> 
+  <!-- tooltip -->
   <div id="tip">
   <div id="tipcolor" style="height:10px;width:10px"></div>
   <div id="tiptext"></div>
@@ -110,7 +110,7 @@
   
 	  <div class="root" >
 		<div class="videoLivePlayer">
-		<div id="chartTimeline"> </div>	
+		<div id="chartTimeline"> </div>
 		<script type="text/javascript">
 			var paper = Raphael(document.getElementById("chartTimeline"),config.width, config.height);
 		</script>
@@ -120,7 +120,7 @@
 			jQueryToolTip:"<?php echo(registry_url('jquery-tools','js'));?>",
 			jQueryUI:"<?php echo(registry_url('jquery-ui','js'));?>",
 			swfObject:"<?php echo(registry_url('swfobject','js'));?>",
-			cssjQueryUI:"<?php echo(registry_url('jquery-ui','css'));?>"			
+			cssjQueryUI:"<?php echo(registry_url('jquery-ui','css'));?>"
 		});
 		</script>
 		<div id="player_project_843fff80-6b50-11e0-8aef-00145ea49a02_embed" class="iri_player_embed"> </div>
@@ -129,7 +129,7 @@
 				var configMP = {
 						metadata:{
 							format:'cinelab',
-							src:'<?php echo($config['metadata']); ?>',
+							src:'<?php echo($translate->_('config__metadata')); ?>',
 							load:'jsonp'},
 						gui:{
 							width:<?php echo($config['player_width']); ?>,
@@ -143,9 +143,9 @@
 							type:'jwplayer',
 							src:'<?php echo(URL_ROOT);?>res/mediaplayer/player.swf'}
 					};
-				__IriSP.init(configMP);     
+				__IriSP.init(configMP);
 			</script>
-		</div>	
-	  </div>	
+		</div>
+	  </div>
   </body>
 </html>
--- a/web/polemicaltimeline.php	Wed Oct 05 13:39:57 2011 +0200
+++ b/web/polemicaltimeline.php	Wed Oct 05 18:11:31 2011 +0200
@@ -6,14 +6,14 @@
  */
 $rep = $_REQUEST['rep'];
 include_once dirname(__FILE__).'/'.$rep.'/config.php';
-// configuration 
+// configuration
 include 'common.php';
- // objet actuel 
+ // objet actuel
 $baseurl = URL_ROOT;
 
 $div_height = 640;
-if(isset($config['div_height'])) {
-	$div_height = $config['div_height'];	
+if($translate->_('config__div_height') != 'config__div_height') {
+	$div_height = $translate->_('config__div_height');
 }
 $tweet_explain_background = URL_ROOT.'images/tweetExplainBgd.gif';
 if(file_exists(dirname(__FILE__)."/$rep/images/tweetExplainBgd.gif")) {
@@ -28,17 +28,17 @@
 <html lang="<?php echo($actual); ?>">
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>Polemic tweet - <?php echo($config['title']); ?></title>
-	<meta name="keywords" content="<?php echo($config['keywords']); ?>"><!-- add timestampedmetadata -->
+    <title>Polemic tweet - <?php echo($translate->_('config__title')); ?></title>
+	<meta name="keywords" content="<?php echo($translate->_('config__keywords')); ?>"><!-- add timestampedmetadata -->
 	<!--<meta name="description" content="PoelmicTweet.fr : debate mapping, opinion, conference, video">-->
-	<meta name="description" content="<?php echo($config['description']); ?>">
+	<meta name="description" content="<?php echo($translate->_('config__description')); ?>">
 	<meta name="robots" content="index, follow">
 	
 	<!-- ICI : <?php echo($_SERVER['DOCUMENT_ROOT']); ?> -->
-	<!-- JAVASCRIPT --> 
+	<!-- JAVASCRIPT -->
 	<script type="text/javascript" src="<?php echo(registry_url('json-js','js'));?>"></script>
 	<script type="text/javascript" src="<?php echo(registry_url('jquery','js'));?>"></script>
-	<script type="text/javascript">	
+	<script type="text/javascript">
 		$.noConflict();
 	</script>
 	<script type="text/javascript" src="<?php echo(registry_url('raphael','js'));?>"></script>
@@ -49,7 +49,7 @@
 	<!-- Framework CSS -->
     <link rel="stylesheet" href="<?php echo(registry_url('blueprint-screen','css'));?>" type="text/css" media="screen, projection"/>
     <link rel="stylesheet" href="<?php echo(registry_url('blueprint-print','css'));?>" type="text/css" media="print"/>
-    <!--[if lt IE 8]><link rel="stylesheet" href="<?php echo(registry_url('blueprint-ie','css'));?>" type="text/css" media="screen, projection"><![endif]--> 
+    <!--[if lt IE 8]><link rel="stylesheet" href="<?php echo(registry_url('blueprint-ie','css'));?>" type="text/css" media="screen, projection"><![endif]-->
 	<link rel="stylesheet" href="<?php echo(registry_url('blueprint-plugins-fancy-type','css'));?>" type="text/css" media="screen, projection"/>
 	<link rel="stylesheet" href="<?php echo(registry_url('custom','css'));?>" type="text/css" media="screen, projection"/>
 	<link rel="stylesheet" href="<?php echo(registry_url('fancybox','css'));?>" media="screen"/>
@@ -59,10 +59,10 @@
 	<link href='<?php echo(registry_url('PT-Sans','font'));?>' rel='stylesheet' type='text/css'/>
 	<link href='<?php echo(registry_url('Geo','font'));?>' rel='stylesheet' type='text/css'/>
 	
-	<style type="text/css"> 
+	<style type="text/css">
 		.tweetButton{float:left;margin-right:5px;}
 		.videoLivePlayer{border:1px solid #c3c3c3;width:650px;height:<?php echo($div_height-2);?>px;}
-		.videoLive{width:650px;height:<?php echo($div_height); ?>px;background:#fff;float:right;margin-top:20px;padding:5px;}					
+		.videoLive{width:650px;height:<?php echo($div_height); ?>px;background:#fff;float:right;margin-top:20px;padding:5px;}
 		.tweetExplain{background-image:url(<?php echo($tweet_explain_background);?>);width:250px;height:<?php echo($div_height)?>px;padding:10px;position:absolute; margin-top:70px;}
 		.footer{margin-top:<?php echo($div_height+100);?>px;width:960px;height:20px;position:absolute;text-align:center;}
 		.tooltip{
@@ -73,7 +73,7 @@
 			 padding : 3px;
 			 z-index: 10000000000;
 			 max-width: 200px;
-		}	
+		}
 		#tip {
 				display: none;
 				background: transparent url("<?php echo($baseurl);?>images/white_arrow_long.png");
@@ -95,32 +95,32 @@
 			position : absolute;
 		}
 
-	</style>	
+	</style>
 	<script type="text/javascript">
   		// Configuration Polemical Timeline
   		<?php
-  		if(is_array($config['metadata'])):
-  			reset($config['metadata']);
-  		    $first_key = key($config['metadata']);
+  		if(is_array($translate->_('config__metadata'))):
+  			reset($translate->_('config__metadata'));
+  		    $first_key = key($translate->_('config__metadata'));
   		?>
-  		var metadatas = jQuery.parseJSON('<?php echo(json_encode($config['metadata'])); ?>');
+  		var metadatas = jQuery.parseJSON('<?php echo(json_encode($translate->_('config__metadata'))); ?>');
   		var url = jQuery.url();
   		var metadata_key = url.fparam('metadata');
   		if(typeof metadata_key === "undefined" || metadata_key.length === 0) {
   			metadata_key = "<?php echo($first_key);?>";
-  		} 
+  		}
   		<?php else: ?>
-  		var metadatas = { metadata: {url: "<?php echo($config['metadata']);?>", duration: <?php echo($config['duration'])?>} };
-  		var metadata_key = "metadata"; 
+  		var metadatas = { metadata: {url: "<?php echo($translate->_('config__metadata'));?>", duration: <?php echo($translate->_('config__duration'))?>} };
+  		var metadata_key = "metadata";
   		<?php endif;?>
   		
 		var config = {
 					target:"chartTimeline",
 					x:8,
 					y:418,
-					width:<?php echo($config['player_width']); ?>,
-					height:<?php echo($config['player_height']); ?>,
-					heightmax:<?php echo($config['player_height']); ?>,
+					width:<?php echo($translate->_('config__player_width')); ?>,
+					height:<?php echo($translate->_('config__player_height')); ?>,
+					heightmax:<?php echo($translate->_('config__player_height')); ?>,
 					duration:metadatas[metadata_key].duration,
 					metadata:metadatas[metadata_key].url
 					};
@@ -131,7 +131,7 @@
 			jQueryToolTip:"<?php echo(registry_url('jquery-tools','js'));?>",
 			jQueryUI:"<?php echo(registry_url('jquery-ui','js'));?>",
 			swfObject:"<?php echo(registry_url('swfobject','js'));?>",
-			cssjQueryUI:"<?php echo(registry_url('jquery-ui','css'));?>"			
+			cssjQueryUI:"<?php echo(registry_url('jquery-ui','css'));?>"
 		});
 		jQuery(document).ready(function() {
 			
@@ -156,12 +156,12 @@
 			});
 			
 		});
-	</script>	
+	</script>
 	<script type="text/javascript">
 		var _gaq = _gaq || [];
 		_gaq.push(['_setAccount', 'UA-23581291-1']);
 		_gaq.push(['_trackPageview']);
-		_gaq.push(['_setAllowAnchor', true]); 
+		_gaq.push(['_setAllowAnchor', true]);
 	  
 		(function() {
 		    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
@@ -173,7 +173,7 @@
   <body>
   <div id="sendUsFeedBack"><a href="<?php echo($C_feedback_form_url); ?>" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/sendusfeedback.png"></a></div>
 
-  <!-- tooltip --> 
+  <!-- tooltip -->
   <div id="tip">
   <div id="tipcolor" style="height:10px;width:10px"></div>
   <div id="tiptext"></div>
@@ -182,7 +182,7 @@
     <div class="container">
       <img src="<?php echo(URL_ROOT."$rep/$config[head_logo]");?>" class="logo">
       <div id="minilogo" style="margin-left:85px;height:5px;top:5px;"></div>
-	  <ul class="menu"> 
+	  <ul class="menu">
 		  <li class="menuUnderline"><a href="<?php echo(URL_ROOT)?>" class="menuLink" id="Accueil">
 		   <?php print $translate->_("Accueil"); ?></a></li>
 		  <li class="menuUnderline"><a href="<?php echo(URL_ROOT.$rep)?>/embed_form.php" class="menuLink" id="Embeded">
@@ -194,11 +194,11 @@
 	  <?php print $translate->_("Archives"); ?></a></li>
 	  </ul>
 	  	  
-	<?php if(is_array($config['metadata'])): ?>
+	<?php if(is_array($translate->_('config__metadata'))): ?>
 	<ul id="content_select_ul" class="menu mdselect">
 	    <span><?php print $translate->_("changer de contenu"); ?></span><br/>
 	    <select id="mdselect">
-	    	<?php foreach ($config['metadata'] as $key => $value):?>
+	    	<?php foreach ($translate->_('config__metadata') as $key => $value):?>
 	    	<option value="<?php echo($key); ?>" id="mdselect_<?php echo($key); ?>" ><?php echo($value['display']); ?></option>
 	    	<?php endforeach;?>
 	    </select>
@@ -206,7 +206,7 @@
 	<ul class="menu shortlang" >
 	<?php else: ?>
 	<ul class="menu lang" >
-	<?php endif;?>	  
+	<?php endif;?>
 	  <li class="menuUnderline"><a href="<?php echo(URL_ROOT.$rep);?>/polemicaltimeline.php?lang=ja_JP" class="menuLink" >
 	       <img src="<?php echo(URL_ROOT)?>images/flag_jp.gif"<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
 	        <?php print $translate->_("Japonais"); ?></a></li>
@@ -216,7 +216,7 @@
 	  <li ><a href="<?php echo(URL_ROOT.$rep) ?>/polemicaltimeline.php?lang=en" class="menuLink">
 	       <img src="<?php echo(URL_ROOT)?>images/flag_en.gif" <?php if($actual!="en"){echo("style='opacity: .5;'"); } ?> />
 	       <?php print $translate->_("Anglais"); ?></a></li>
-	  </ul>	
+	  </ul>
 	
 	<!-- EXPLICATION  -->
 	  <div class="tweetExplain"  >
@@ -225,10 +225,10 @@
 	  </div>
 	 
 	  
-	  <!-- INFOS SUR LA CONF 
+	  <!-- INFOS SUR LA CONF
 	  	<div class="tweetExplain"  >
-		<h3 class="tweetWriterTitle"><?php echo($config['title']); ?></h3><br/>
-			<?php echo($config['description']); ?>
+		<h3 class="tweetWriterTitle"><?php echo($translate->_('config__title')); ?></h3><br/>
+			<?php echo($translate->_('config__description')); ?>
 	  </div>
 	  -->
 
@@ -268,8 +268,8 @@
  
       <div class="footer">
 		<hr>
-			<?php echo($config['partenaires']); ?>
-	  </div>   
+			<?php echo($translate->_('config__partenaires')); ?>
+	  </div>
 	
     </div>