[or-cvs] r13517: Add functionality to localize the generic bundle (in torbrowser/trunk/build-scripts: . config)
sjm217 at seul.org
sjm217 at seul.org
Thu Feb 14 22:09:19 UTC 2008
Author: sjm217
Date: 2008-02-14 17:09:18 -0500 (Thu, 14 Feb 2008)
New Revision: 13517
Added:
torbrowser/trunk/build-scripts/patch-firefox-language.sh
Removed:
torbrowser/trunk/build-scripts/config/prefs_fa.js
torbrowser/trunk/build-scripts/config/prefs_zh-cn.js
Modified:
torbrowser/trunk/build-scripts/Makefile
torbrowser/trunk/build-scripts/config/prefs.js
torbrowser/trunk/build-scripts/patch-language.sh
Log:
Add functionality to localize the generic bundle
Modified: torbrowser/trunk/build-scripts/Makefile
===================================================================
--- torbrowser/trunk/build-scripts/Makefile 2008-02-14 21:09:04 UTC (rev 13516)
+++ torbrowser/trunk/build-scripts/Makefile 2008-02-14 22:09:18 UTC (rev 13517)
@@ -51,10 +51,10 @@
## Default rule
##
-bundle: bundle_en
+bundle: bundle_en-US
-all-bundles: bundle_en bundle_de bundle_es-ES bundle_fr bundle_nl \
- bundle_pt-PT bundle_ru bundle zh-CN
+all-bundles: bundle_en-US bundle_de bundle_es-ES bundle_fa-IR \
+ bundle_fr bundle_nl bundle_pt-PT bundle_ru bundle_zh-CN
##
## Cleanup
@@ -63,7 +63,7 @@
clean:
rm -fr $(DEST) generic-bundle.stamp
rm -f *~
- rm -fr $(DEST) $(BINARIES) $(DOCS)
+ rm -fr *.xpi
rm -f "Tor Browser.exe"
##
@@ -143,12 +143,12 @@
## Generic language pack rule
langpack_%.xpi:
- $(WGET) -O $@ http://releases.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.11/win32/xpi/%.xpi
+ $(WGET) -O $@ http://releases.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.11/win32/xpi/$*.xpi
## Persian isn't a supported language by Firefox yet
-langpack_fa.xpi:
+langpack_fa-IR.xpi:
$(WGET) -O $@ https://addons.mozilla.org/en-US/firefox/downloads/file/18157/persian_language_pack-2.0.0.6-fx.xpi
## English comes as default
-langpack_en.xpi:
+langpack_en-US.xpi:
touch $@
## Download Quick Locale Switcher
@@ -160,9 +160,9 @@
##
bundle_%:
- LANGCODE=$* make bundle
+ LANGCODE=$* make bundle-localized
-bundle: generic-bundle.stamp copy-base install-extensions patch-vidalia-language patch-firefox-config
+bundle-localized: generic-bundle.stamp copy-base install-extensions patch-vidalia-language patch-firefox-language
compress-bundle:
cd $(NAME)_$(LANGCODE); $(SEVENZIP) a -sfx7z.sfx $(NAME)_$(LANGCODE).exe $(NAME)
@@ -173,10 +173,11 @@
BUNDLE=$(NAME)_$(LANGCODE)/$(NAME)
DUMMYPROFILE=$(BUNDLE)/FirefoxPortable/App/DummyProfile
-install-extensions:
+install-extensions: $(DEFAULT_EXTENSIONS) langpack_$(LANGCODE).xpi
## Make a dummy profile to stop Firefox creating some large files
cp -R $(BUNDLE)/FirefoxPortable/App/DefaultData $(DUMMYPROFILE)
- for extension in $(DEFAULT_EXTENSIONS) $(EXTENSIONS_DIR)/*; \
+ ## Install default extensions and everything from extensions directory
+ for extension in langpack_$(LANGCODE).xpi $(DEFAULT_EXTENSIONS) $(EXTENSIONS_DIR)/*.xpi; \
do $(BUNDLE)/FirefoxPortable/App/firefox/firefox.exe \
-profile $(DUMMYPROFILE) \
-install-global-extension $$extension; \
@@ -187,10 +188,11 @@
## Set the language for Vidalia
patch-vidalia-language:
## Patch Vidalia
- ./patch-language.sh $(DEST)/Data/Vidalia/vidalia.conf $(LANGCODE)
+ ./patch-language.sh $(BUNDLE)/Data/Vidalia/vidalia.conf $(LANGCODE)
-patch-firefox-config:
- ## TODO
+patch-firefox-language:
+ ## Patch Firefox prefs.js
+ ./patch-firefox-language.sh $(BUNDLE)/FirefoxPortable/App/DefaultData/profile/prefs.js $(LANGCODE)
###
### Utilities
Modified: torbrowser/trunk/build-scripts/config/prefs.js
===================================================================
--- torbrowser/trunk/build-scripts/config/prefs.js 2008-02-14 21:09:04 UTC (rev 13516)
+++ torbrowser/trunk/build-scripts/config/prefs.js 2008-02-14 22:09:18 UTC (rev 13517)
@@ -61,6 +61,7 @@
user_pref("general.appname.override", "Netscape");
user_pref("general.appversion.override", "5.0 (Windows; en-US)");
user_pref("general.platform.override", "Win32");
+user_pref("general.useragent.locale", "BUNDLELOCALE");
user_pref("general.useragent.override", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7");
user_pref("general.useragent.vendor", "");
user_pref("general.useragent.vendorSub", "");
Deleted: torbrowser/trunk/build-scripts/config/prefs_fa.js
===================================================================
--- torbrowser/trunk/build-scripts/config/prefs_fa.js 2008-02-14 21:09:04 UTC (rev 13516)
+++ torbrowser/trunk/build-scripts/config/prefs_fa.js 2008-02-14 22:09:18 UTC (rev 13517)
@@ -1,86 +0,0 @@
-# Mozilla User Preferences
-
-/* Do not edit this file.
- *
- * If you make changes to this file while the application is running,
- * the changes will be overwritten when the application exits.
- *
- * To make a manual change to preferences, you can visit the URL about:config
- * For more information, see http://www.mozilla.org/unix/customizing.html#prefs
- */
-
-user_pref("app.update.auto", false);
-user_pref("app.update.enabled", false);
-user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1198168911);
-user_pref("app.update.lastUpdateTime.background-update-timer", 1198168911);
-user_pref("app.update.lastUpdateTime.blocklist-background-update-timer", 1198168911);
-user_pref("app.update.lastUpdateTime.search-engine-update-timer", 1198168911);
-user_pref("browser.cache.disk.capacity", 0);
-user_pref("browser.cache.disk.enable", false);
-user_pref("browser.download.manager.retention", 0);
-user_pref("browser.download.useDownloadDir", false);
-user_pref("browser.formfill.enable", false);
-user_pref("browser.history_expire_days", 0);
-user_pref("browser.preferences.advanced.selectedTabIndex", 0);
-user_pref("browser.search.suggest.enabled", false);
-user_pref("browser.search.update", false);
-user_pref("browser.send_pings", false);
-user_pref("browser.sessionstore.enabled", false);
-user_pref("browser.shell.checkDefaultBrowser", false);
-user_pref("browser.startup.homepage", "http://check.torproject.org/");
-user_pref("browser.startup.homepage_override.mstone", "rv:1.8.1.11");
-user_pref("dom.storage.enabled", false);
-user_pref("extensions.lastAppVersion", "2.0.0.11");
-user_pref("extensions.torbutton.custom.socks_host", "localhost");
-user_pref("extensions.torbutton.custom.socks_port", 9050);
-user_pref("extensions.torbutton.saved.share_proxy_settings", false);
-user_pref("extensions.torbutton.saved.socks_host", "localhost");
-user_pref("extensions.torbutton.saved.socks_port", 9050);
-user_pref("extensions.torbutton.saved.socks_remote_dns", true);
-user_pref("extensions.torbutton.saved.socks_version", 5);
-user_pref("extensions.torbutton.saved.type", 1);
-user_pref("extensions.torbutton.socks_host", "localhost");
-user_pref("extensions.torbutton.socks_port", 9050);
-user_pref("extensions.torbutton.tor_enabled", true);
-user_pref("extensions.torbutton.use_privoxy", false);
-user_pref("extensions.update.enabled", false);
-user_pref("extensions.update.notifyUser", false);
-user_pref("general.appname.override", "Netscape");
-user_pref("general.appversion.override", "5.0 (Windows; en-US)");
-user_pref("general.platform.override", "Win32");
-user_pref("general.useragent.locale", "fa-IR");
-user_pref("general.useragent.override", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7");
-user_pref("general.useragent.vendor", "");
-user_pref("general.useragent.vendorSub", "");
-user_pref("intl.accept_languages", "en-us, en");
-user_pref("intl.charsetmenu.browser.cache", "ISO-8859-1, UTF-8");
-user_pref("layout.css.report_errors", false);
-user_pref("network.cookie.lifetime.days", 0);
-user_pref("network.cookie.lifetimePolicy", 2);
-user_pref("network.cookie.prefsMigrated", true);
-user_pref("network.dns.disableIPv6", true);
-user_pref("network.protocol-handler.external-default", false);
-user_pref("network.protocol-handler.external.mailto", false);
-user_pref("network.protocol-handler.external.news", false);
-user_pref("network.protocol-handler.external.nntp", false);
-user_pref("network.protocol-handler.external.snews", false);
-user_pref("network.proxy.failover_timeout", 0);
-user_pref("network.proxy.no_proxies_on", "");
-user_pref("network.proxy.socks", "localhost");
-user_pref("network.proxy.socks_port", 9050);
-user_pref("network.proxy.socks_remote_dns", true);
-user_pref("network.proxy.type", 1);
-user_pref("privacy.item.cookies", true);
-user_pref("privacy.item.passwords", true);
-user_pref("privacy.sanitize.didShutdownSanitize", true);
-user_pref("privacy.sanitize.promptOnSanitize", false);
-user_pref("privacy.sanitize.sanitizeOnShutdown", true);
-user_pref("security.enable_java", false);
-user_pref("security.xpconnect.plugin.unrestricted", false);
-user_pref("signon.rememberSignons", false);
-user_pref("urlclassifier.tableversion.goog-black-enchash", "1.40619");
-user_pref("urlclassifier.tableversion.goog-black-url", "1.17072");
-user_pref("urlclassifier.tableversion.goog-white-domain", "1.23");
-user_pref("urlclassifier.tableversion.goog-white-url", "1.371");
-user_pref("xpinstall.whitelist.add", "");
-user_pref("xpinstall.whitelist.add.103", "");
Deleted: torbrowser/trunk/build-scripts/config/prefs_zh-cn.js
===================================================================
--- torbrowser/trunk/build-scripts/config/prefs_zh-cn.js 2008-02-14 21:09:04 UTC (rev 13516)
+++ torbrowser/trunk/build-scripts/config/prefs_zh-cn.js 2008-02-14 22:09:18 UTC (rev 13517)
@@ -1,86 +0,0 @@
-# Mozilla User Preferences
-
-/* Do not edit this file.
- *
- * If you make changes to this file while the application is running,
- * the changes will be overwritten when the application exits.
- *
- * To make a manual change to preferences, you can visit the URL about:config
- * For more information, see http://www.mozilla.org/unix/customizing.html#prefs
- */
-
-user_pref("app.update.auto", false);
-user_pref("app.update.enabled", false);
-user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1198168911);
-user_pref("app.update.lastUpdateTime.background-update-timer", 1198168911);
-user_pref("app.update.lastUpdateTime.blocklist-background-update-timer", 1198168911);
-user_pref("app.update.lastUpdateTime.search-engine-update-timer", 1198168911);
-user_pref("browser.cache.disk.capacity", 0);
-user_pref("browser.cache.disk.enable", false);
-user_pref("browser.download.manager.retention", 0);
-user_pref("browser.download.useDownloadDir", false);
-user_pref("browser.formfill.enable", false);
-user_pref("browser.history_expire_days", 0);
-user_pref("browser.preferences.advanced.selectedTabIndex", 0);
-user_pref("browser.search.suggest.enabled", false);
-user_pref("browser.search.update", false);
-user_pref("browser.send_pings", false);
-user_pref("browser.sessionstore.enabled", false);
-user_pref("browser.shell.checkDefaultBrowser", false);
-user_pref("browser.startup.homepage", "http://check.torproject.org/");
-user_pref("browser.startup.homepage_override.mstone", "rv:1.8.1.11");
-user_pref("dom.storage.enabled", false);
-user_pref("extensions.lastAppVersion", "2.0.0.11");
-user_pref("extensions.torbutton.custom.socks_host", "localhost");
-user_pref("extensions.torbutton.custom.socks_port", 9050);
-user_pref("extensions.torbutton.saved.share_proxy_settings", false);
-user_pref("extensions.torbutton.saved.socks_host", "localhost");
-user_pref("extensions.torbutton.saved.socks_port", 9050);
-user_pref("extensions.torbutton.saved.socks_remote_dns", true);
-user_pref("extensions.torbutton.saved.socks_version", 5);
-user_pref("extensions.torbutton.saved.type", 1);
-user_pref("extensions.torbutton.socks_host", "localhost");
-user_pref("extensions.torbutton.socks_port", 9050);
-user_pref("extensions.torbutton.tor_enabled", true);
-user_pref("extensions.torbutton.use_privoxy", false);
-user_pref("extensions.update.enabled", false);
-user_pref("extensions.update.notifyUser", false);
-user_pref("general.appname.override", "Netscape");
-user_pref("general.appversion.override", "5.0 (Windows; en-US)");
-user_pref("general.platform.override", "Win32");
-user_pref("general.useragent.locale", "zh-CN");
-user_pref("general.useragent.override", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7");
-user_pref("general.useragent.vendor", "");
-user_pref("general.useragent.vendorSub", "");
-user_pref("intl.accept_languages", "en-us, en");
-user_pref("intl.charsetmenu.browser.cache", "ISO-8859-1, UTF-8");
-user_pref("layout.css.report_errors", false);
-user_pref("network.cookie.lifetime.days", 0);
-user_pref("network.cookie.lifetimePolicy", 2);
-user_pref("network.cookie.prefsMigrated", true);
-user_pref("network.dns.disableIPv6", true);
-user_pref("network.protocol-handler.external-default", false);
-user_pref("network.protocol-handler.external.mailto", false);
-user_pref("network.protocol-handler.external.news", false);
-user_pref("network.protocol-handler.external.nntp", false);
-user_pref("network.protocol-handler.external.snews", false);
-user_pref("network.proxy.failover_timeout", 0);
-user_pref("network.proxy.no_proxies_on", "");
-user_pref("network.proxy.socks", "localhost");
-user_pref("network.proxy.socks_port", 9050);
-user_pref("network.proxy.socks_remote_dns", true);
-user_pref("network.proxy.type", 1);
-user_pref("privacy.item.cookies", true);
-user_pref("privacy.item.passwords", true);
-user_pref("privacy.sanitize.didShutdownSanitize", true);
-user_pref("privacy.sanitize.promptOnSanitize", false);
-user_pref("privacy.sanitize.sanitizeOnShutdown", true);
-user_pref("security.enable_java", false);
-user_pref("security.xpconnect.plugin.unrestricted", false);
-user_pref("signon.rememberSignons", false);
-user_pref("urlclassifier.tableversion.goog-black-enchash", "1.40619");
-user_pref("urlclassifier.tableversion.goog-black-url", "1.17072");
-user_pref("urlclassifier.tableversion.goog-white-domain", "1.23");
-user_pref("urlclassifier.tableversion.goog-white-url", "1.371");
-user_pref("xpinstall.whitelist.add", "");
-user_pref("xpinstall.whitelist.add.103", "");
Added: torbrowser/trunk/build-scripts/patch-firefox-language.sh
===================================================================
--- torbrowser/trunk/build-scripts/patch-firefox-language.sh (rev 0)
+++ torbrowser/trunk/build-scripts/patch-firefox-language.sh 2008-02-14 22:09:18 UTC (rev 13517)
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+###
+### Set language code in Firefox config file
+###
+### Copyright 2007-2008 Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/>
+### See LICENSE for licensing information
+###
+### $Id$
+###
+
+## Parse command line
+FILENAME=$1
+LANGCODE=$2
+
+## Backup original file
+ORIGFILENAME=$FILENAME.orig
+mv "$FILENAME" "$ORIGFILENAME"
+
+## Replace LanguageCode value with $LANGCODE
+sed -c "s/BUNDLELOCALE/$LANGCODE/" "$ORIGFILENAME" > "$FILENAME"
Property changes on: torbrowser/trunk/build-scripts/patch-firefox-language.sh
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: torbrowser/trunk/build-scripts/patch-language.sh
===================================================================
--- torbrowser/trunk/build-scripts/patch-language.sh 2008-02-14 21:09:04 UTC (rev 13516)
+++ torbrowser/trunk/build-scripts/patch-language.sh 2008-02-14 22:09:18 UTC (rev 13517)
@@ -17,6 +17,8 @@
case "$MOZLANG" in
'es-ES') LANGCODE='es'
;;
+ 'fa-IR') LANGCODE='fa'
+ ;;
'pt-PT') LANGCODE='pt'
;;
'zh-CN') LANGCODE='zh-cn'
More information about the tor-commits
mailing list