SOURCES: mozilla-thunderbird.sh - @LIBDIR at -aware MOZILLA_FIVE_HOME...

qboosh qboosh at pld-linux.org
Fri Mar 3 20:57:29 CET 2006


Author: qboosh                       Date: Fri Mar  3 19:57:29 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- @LIBDIR at -aware MOZILLA_FIVE_HOME, add -UILocale (like in firefox)

---- Files affected:
SOURCES:
   mozilla-thunderbird.sh (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/mozilla-thunderbird.sh
diff -u SOURCES/mozilla-thunderbird.sh:1.1 SOURCES/mozilla-thunderbird.sh:1.2
--- SOURCES/mozilla-thunderbird.sh:1.1	Sun Oct 17 02:54:01 2004
+++ SOURCES/mozilla-thunderbird.sh	Fri Mar  3 20:57:24 2006
@@ -1,20 +1,54 @@
 #!/bin/sh
 # based on script by (c) vip at linux.pl, wolf at pld-linux.org
 
-MOZILLA_FIVE_HOME=/usr/lib/mozilla-thunderbird
+MOZILLA_FIVE_HOME="@LIBDIR@/mozilla-thunderbird"
+
+MOZARGS=
+MOZLOCALE="$(/usr/bin/locale | grep "^LC_MESSAGES=" | \
+		sed -e "s|LC_MESSAGES=||g" -e "s|\"||g" )"
+for MOZLANG in $(echo $LANGUAGE | tr ":" " ") $MOZLOCALE; do
+	eval MOZLANG="$(echo $MOZLANG | sed -e "s|_\([^.]*\).*|-\1|g")"
+
+	if [ -f $MOZILLA_FIVE_HOME/chrome/$MOZLANG.jar ]; then
+		MOZARGS="-UILocale $MOZLANG"
+		break
+	fi
+done
+
+if [ -z "$MOZARGS" ]; then
+	# try harder
+	for MOZLANG in $(echo $LANGUAGE | tr ":" " ") $MOZLOCALE; do
+		eval MOZLANG="$(echo $MOZLANG | sed -e "s|_.*||g")"
+
+		LANGFILE=$(echo ${MOZILLA_FIVE_HOME}/chrome/${MOZLANG}*.jar \
+				| sed 's/\s.*//g' )
+		if [ -f "$LANGFILE" ]; then
+			MOZLANG=$(basename "$LANGFILE" | sed 's/\.jar//')
+			MOZARGS="-UILocale $MOZLANG"
+			break
+		fi
+	done
+fi
+
+if [ -n "$MOZARGS" ]; then
+	THUNDERBIRD="$MOZILLA_FIVE_HOME/thunderbird $MOZARGS"
+else
+	THUNDERBIRD="$MOZILLA_FIVE_HOME/thunderbird"
+fi
+
 if [ "$1" == "-remote" ]; then
-	/usr/lib/mozilla-thunderbird/thunderbird "$@"
+	$THUNDERBIRD "$@"
 else
-	PING=`/usr/lib/mozilla-thunderbird/thunderbird -remote 'ping()' 2>&1 >/dev/null`
+	PING=`$THUNDERBIRD -remote 'ping()' 2>&1 >/dev/null`
 	if [ -n "$PING" ]; then
-		/usr/lib/mozilla-thunderbird/thunderbird "$@"
+		$THUNDERBIRD "$@"
 	else
 		case "$1" in
 		    -compose|-editor)
-			/usr/lib/mozilla-thunderbird/thunderbird -remote 'xfeDoCommand (composeMessage)'
+			$THUNDERBIRD -remote 'xfeDoCommand (composeMessage)'
 			;;
 		    *)
-			/usr/lib/mozilla-thunderbird/thunderbird -remote 'xfeDoCommand (openInbox)'
+			$THUNDERBIRD -remote 'xfeDoCommand (openInbox)'
 			;;
 		esac
 	fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/mozilla-thunderbird.sh?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list