Commit 664d6810 authored by Tails developers's avatar Tails developers
Browse files

Simplify the chroot browser's code slightly.

parent 046485db
...@@ -111,18 +111,13 @@ setup_chroot () { ...@@ -111,18 +111,13 @@ setup_chroot () {
set_chroot_browser_name () { set_chroot_browser_name () {
NAME="${1}" NAME="${1}"
LONG=$(echo ${LANG} | grep -o "^[a-zA-Z_]*") LOCALE="${2}"
SHORT=${LONG%%_*} EXT_DIR=${CHROOT}/"${TBB_EXT}"
EXT_DIR="${CHROOT}/${TBB_EXT}"
BRANDING=branding/brand.dtd BRANDING=branding/brand.dtd
if [ -e "${EXT_DIR}/langpack-${LONG}@firefox.mozilla.org.xpi" ]; then if [ "${LOCALE}" != en-US ]; then
PACK="${EXT_DIR}/langpack-${LONG}@firefox.mozilla.org.xpi" PACK="${EXT_DIR}/langpack-${LOCALE}@firefox.mozilla.org.xpi"
TOP=browser/chrome TOP=browser/chrome
REST=${LONG}/locale REST=${LOCALE}/locale
elif [ -e "${EXT_DIR}/langpack-${SHORT}@firefox.mozilla.org.xpi" ]; then
PACK="${EXT_DIR}/langpack-${SHORT}@firefox.mozilla.org.xpi"
TOP=browser/chrome
REST=${SHORT}/locale
else else
PACK="${CHROOT}/${TBB_INSTALL}/browser/omni.ja" PACK="${CHROOT}/${TBB_INSTALL}/browser/omni.ja"
TOP=chrome TOP=chrome
...@@ -186,7 +181,7 @@ configure_chroot () { ...@@ -186,7 +181,7 @@ configure_chroot () {
${BROWSER_PREFS} ${BROWSER_PREFS}
# Set the name (e.g. window title) of the browser # Set the name (e.g. window title) of the browser
set_chroot_browser_name "`gettext \"I2P Browser\"`" set_chroot_browser_name "`gettext \"I2P Browser\"`" "${BEST_LOCALE}"
# Set start page to the router console # Set start page to the router console
echo 'user_pref("browser.startup.homepage", "'${START_PAGE}'");' >> \ echo 'user_pref("browser.startup.homepage", "'${START_PAGE}'");' >> \
......
...@@ -111,18 +111,13 @@ setup_chroot () { ...@@ -111,18 +111,13 @@ setup_chroot () {
set_chroot_browser_name () { set_chroot_browser_name () {
NAME="${1}" NAME="${1}"
LONG=$(echo ${LANG} | grep -o "^[a-zA-Z_]*") LOCALE="${2}"
SHORT=${LONG%%_*}
EXT_DIR=${CHROOT}/"${TBB_EXT}" EXT_DIR=${CHROOT}/"${TBB_EXT}"
BRANDING=branding/brand.dtd BRANDING=branding/brand.dtd
if [ -e "${EXT_DIR}/langpack-${LONG}@firefox.mozilla.org.xpi" ]; then if [ "${LOCALE}" != en-US ]; then
PACK="${EXT_DIR}/langpack-${LONG}@firefox.mozilla.org.xpi" PACK="${EXT_DIR}/langpack-${LOCALE}@firefox.mozilla.org.xpi"
TOP=browser/chrome TOP=browser/chrome
REST=${LONG}/locale REST=${LOCALE}/locale
elif [ -e "${EXT_DIR}/langpack-${SHORT}@firefox.mozilla.org.xpi" ]; then
PACK="${EXT_DIR}/langpack-${SHORT}@firefox.mozilla.org.xpi"
TOP=browser/chrome
REST=${SHORT}/locale
else else
PACK="${CHROOT}/${TBB_INSTALL}/browser/omni.ja" PACK="${CHROOT}/${TBB_INSTALL}/browser/omni.ja"
TOP=chrome TOP=chrome
...@@ -182,7 +177,7 @@ configure_chroot () { ...@@ -182,7 +177,7 @@ configure_chroot () {
echo 'user_pref("extensions.getAddons.showPane", false);' >> "${CLEARNET_PREFS}" echo 'user_pref("extensions.getAddons.showPane", false);' >> "${CLEARNET_PREFS}"
# Set the name (e.g. window title) of the browser # Set the name (e.g. window title) of the browser
set_chroot_browser_name "`gettext \"Unsafe Browser\"`" set_chroot_browser_name "`gettext \"Unsafe Browser\"`" "${BEST_LOCALE}"
# Set start page to something that explains what's going on # Set start page to something that explains what's going on
echo 'user_pref("browser.startup.homepage", "'${START_PAGE}'");' >> \ echo 'user_pref("browser.startup.homepage", "'${START_PAGE}'");' >> \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment