Index: /trunk/translator/func.php
===================================================================
--- /trunk/translator/func.php	(revision 2177)
+++ /trunk/translator/func.php	(revision 2178)
@@ -43,5 +43,5 @@
 		if ($fp && !$err && ($fl = @fopen(LANGDIR."$lang_prefix$file", 'w')))
 		{
-			// echo '<div class="console">Update from SVN: '.$lang_dir.$file.'</div>';
+			echo '<!-- Update from SVN: ' . $lang_dir.$file . "-->\n";
 			while (!feof($fp))
 			{
@@ -131,10 +131,10 @@
 }
 
-function count_lines($filename)
+function count_lines($lang, $file)
 {
 	$count = 0;
 	$lines = array();
 	
-	if(file_exists($filename))
+	if ($filename = update_from_svn($lang, $file))
 		$lines = file($filename);
 	
@@ -147,15 +147,16 @@
 }
 
-function localization_stats()
-{
+function localization_stats($force = false)
+{
+	$cachefile = LANGDIR . 'langstats.txt';
 	// use saved file (cache)
-	if(file_exists('langstats.txt'))
-		if(filemtime('langstats.txt') + 60*60*2 > time())
-			return file_get_contents('langstats.txt');
-
-	$us_count = count_lines(LANGDIR.'/'.ORIGINAL.'/'.LABELS);
-	$us_count += count_lines(LANGDIR.'/'.ORIGINAL.'/'.MESSAGES);
-
-	include(LANGDIR.'/index.inc');
+	if (!$force && file_exists($cachefile))
+		if (filemtime($cachefile) + 60*60*12 > time())
+			return file_get_contents($cachefile);
+
+	$us_count = count_lines(ORIGINAL, LABELS);
+	$us_count += count_lines(ORIGINAL, MESSAGES);
+
+	include(LANGDIR . 'index.inc');
 	
 	$i = 0;
@@ -165,6 +166,6 @@
 			continue;
 
-		$count = count_lines(LANGDIR.'/'.$l_key.'/'.LABELS);
-		$count += count_lines(LANGDIR.'/'.$l_key.'/'.MESSAGES);
+		$count = count_lines($l_key, LABELS);
+		$count += count_lines($l_key, MESSAGES);
 		$percent = ($count * 100) / $us_count;
 		
@@ -185,5 +186,5 @@
 	
 	// save to cache file
-	file_put_contents('langstats.txt', $result);
+	file_put_contents($cachefile, $result);
 	
 	return $result;
Index: /trunk/translator/index.php
===================================================================
--- /trunk/translator/index.php	(revision 2177)
+++ /trunk/translator/index.php	(revision 2178)
@@ -116,7 +116,9 @@
 	echo "\n</form></div>";
 }
-else
-
-	echo '<div align="center">'.localization_stats().'</div>';
+else if (empty($file))
+{
+	echo '<h4>Current completeness status</h4>';
+	echo '<div>'.localization_stats().'</div>';
+}
 
 ?>
Index: /trunk/translator/styles.css
===================================================================
--- /trunk/translator/styles.css	(revision 2177)
+++ /trunk/translator/styles.css	(revision 2178)
@@ -104,5 +104,5 @@
 	width: 300px;
 	border-collapse: collapse;
-	border: 1px #999 solid;
+	border: 1px #bbb solid;
 }
 
@@ -120,5 +120,5 @@
 
 td.zebra {
-	background-color: silver;
+	background-color: #eaeaea;
 }
 
