From a3644638aaf0418598196a870204e0b632a4c8ad Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Fri, 17 Apr 2015 06:28:40 -0400
Subject: [PATCH] Allow preference sections to define CSS class names

---
 bin/importgettext.sh |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/bin/importgettext.sh b/bin/importgettext.sh
index a63ac00..5a91e6b 100755
--- a/bin/importgettext.sh
+++ b/bin/importgettext.sh
@@ -15,7 +15,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 require INSTALL_PATH.'program/include/clisetup.php';
 
 if ($argc < 2) {
@@ -56,10 +56,11 @@
 
 EOF;
 
-	$output = sprintf($header, $lang, $varname.'.inc', date('Y'), $texts['_translator'], $varname);
+	$author = preg_replace('/\s*<Unknown>/i', '', $texts['_translator']);
+	$output = sprintf($header, $lang, $varname.'.inc', date('Y'), $author, $varname);
 
 	foreach ($texts as $label => $value) {
-	    if (is_array($value)) { var_dump($outfn, $label, $value); exit; }
+		if (is_array($value)) { var_dump($outfn, $label, $value); exit; }
 		if ($label[0] != '_' && strlen($value))
 			$output .= sprintf("\$%s['%s'] = '%s';\n", $varname, $label, strtr(addcslashes($value, "'"), array("\r" => '', "\n" => '\n')));
 	}
@@ -124,6 +125,7 @@
 				foreach ($dests as $dest) {
 					list($file, $label) = explode(':', $dest);
 					$out[$file][$label] = $msgstr;
+					$out[$file]['_translator'] = $translator;
 				}
 			}
 

--
Gitblit v1.9.1