[or-cvs] r12855: Add Makefile rule for customizing Vidalia language settings (in torpedo/trunk: build-scripts build-scripts/config docs)

sjm217 at seul.org sjm217 at seul.org
Tue Dec 18 20:41:49 UTC 2007


Author: sjm217
Date: 2007-12-18 15:41:48 -0500 (Tue, 18 Dec 2007)
New Revision: 12855

Added:
   torpedo/trunk/build-scripts/patch-language.sh
Modified:
   torpedo/trunk/build-scripts/Makefile
   torpedo/trunk/build-scripts/README
   torpedo/trunk/build-scripts/config/vidalia.conf
   torpedo/trunk/docs/TODO
Log:
Add Makefile rule for customizing Vidalia language settings

Modified: torpedo/trunk/build-scripts/Makefile
===================================================================
--- torpedo/trunk/build-scripts/Makefile	2007-12-18 19:59:50 UTC (rev 12854)
+++ torpedo/trunk/build-scripts/Makefile	2007-12-18 20:41:48 UTC (rev 12855)
@@ -51,11 +51,13 @@
 $(TORBUTTON):
 	wget http://torbutton.torproject.org/dev/releases/$(TORBUTTON)
 
+bundle: package-files patch-language
+
 ## This dummy profile is created just for installing extensions, otherwise Firefox
 ## will output files in the default one
 DUMMYPROFILE=$(DEST)/FirefoxPortable/App/DummyProfile
 
-bundle: install-binaries install-docs $(TORBUTTON)
+package-files: install-binaries install-docs $(TORBUTTON)
 	## Build directory structure
 	rm -fr $(DEST)
 	mkdir -p $(DEST)/App
@@ -77,7 +79,7 @@
 	cp -R $(BINARIES)/* $(DEST)/App
 	## Copy over documentation
 	cp -R $(DOCS)/* $(DEST)/Docs
-	## Install torbutton
+	## Install torbutton (TODO: add -no-remote if Firefox is running?)
 	cp -R $(DEST)/FirefoxPortable/App/DefaultData $(DUMMYPROFILE)
 	$(DEST)/FirefoxPortable/App/firefox/firefox.exe \
          -profile $(DUMMYPROFILE) \
@@ -86,6 +88,11 @@
 	## Write out launcher
 	echo 'start /b .\\App\\vidalia.exe --datadir .\\Data\\Vidalia\\' > $(DEST)/"Tor Browser.bat"
 
+## Set the language for Vidalia
+LANGCODE?=en
+patch-language:
+	./patch-language.sh $(DEST)/Data/Vidalia/vidalia.conf $(LANGCODE)
+
 ## Copy Firefox preferences from a run of FirefoxPortable to be the default
 apply-prefs:
 	cp $(DEST)/FirefoxPortable/Data/profile/prefs.js $(CONFIG_SRC)

Modified: torpedo/trunk/build-scripts/README
===================================================================
--- torpedo/trunk/build-scripts/README	2007-12-18 19:59:50 UTC (rev 12854)
+++ torpedo/trunk/build-scripts/README	2007-12-18 20:41:48 UTC (rev 12855)
@@ -21,6 +21,9 @@
 
 Run "make bundle"
 
+To specify a different language configuration, set $LANGCODE,
+e.g. "LANGCODE=fa make bundle"
+
 To compress it, run "make compress-bundle"
 
 Archived code

Modified: torpedo/trunk/build-scripts/config/vidalia.conf
===================================================================
--- torpedo/trunk/build-scripts/config/vidalia.conf	2007-12-18 19:59:50 UTC (rev 12854)
+++ torpedo/trunk/build-scripts/config/vidalia.conf	2007-12-18 20:41:48 UTC (rev 12855)
@@ -1,5 +1,6 @@
 [General]
 BrowserExecutable=.\\FirefoxPortable\\FirefoxPortable.exe
+LanguageCode=en
 
 [Tor]
 ControlPort=9051

Added: torpedo/trunk/build-scripts/patch-language.sh
===================================================================
--- torpedo/trunk/build-scripts/patch-language.sh	                        (rev 0)
+++ torpedo/trunk/build-scripts/patch-language.sh	2007-12-18 20:41:48 UTC (rev 12855)
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+##
+## Set language code in Vidalia config file
+## Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217>
+##
+
+## Parse command line
+FILENAME=$1
+LANGCODE=$2
+
+## Backup original file
+ORIGFILENAME=$FILENAME.orig
+mv "$FILENAME" "$ORIGFILENAME"
+
+## Replace LanguageCode value with $LANGCODE
+sed -c "s/\\(LanguageCode=\\).*/\\1$LANGCODE/" "$ORIGFILENAME" > "$FILENAME"
\ No newline at end of file

Modified: torpedo/trunk/docs/TODO
===================================================================
--- torpedo/trunk/docs/TODO	2007-12-18 19:59:50 UTC (rev 12854)
+++ torpedo/trunk/docs/TODO	2007-12-18 20:41:48 UTC (rev 12855)
@@ -23,6 +23,10 @@
   Either we could kill firefox.exe directly, or wait until Vidalia
   launches Firefox.
 
+- Check whether Vidalia auto-detects language if not specified. If
+  this is likely to guess right, then maybe we should not specify in
+  the config file.
+
 Firefox modifications
 ---------------------
 



More information about the tor-commits mailing list