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

Simplify the chroot browser's code slightly.

parent 046485db
......@@ -111,18 +111,13 @@ setup_chroot () {
set_chroot_browser_name () {
NAME="${1}"
LONG=$(echo ${LANG} | grep -o "^[a-zA-Z_]*")
SHORT=${LONG%%_*}
EXT_DIR="${CHROOT}/${TBB_EXT}"
LOCALE="${2}"
EXT_DIR=${CHROOT}/"${TBB_EXT}"
BRANDING=branding/brand.dtd
if [ -e "${EXT_DIR}/langpack-${LONG}@firefox.mozilla.org.xpi" ]; then
PACK="${EXT_DIR}/langpack-${LONG}@firefox.mozilla.org.xpi"
if [ "${LOCALE}" != en-US ]; then
PACK="${EXT_DIR}/langpack-${LOCALE}@firefox.mozilla.org.xpi"
TOP=browser/chrome
REST=${LONG}/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
REST=${LOCALE}/locale
else
PACK="${CHROOT}/${TBB_INSTALL}/browser/omni.ja"
TOP=chrome
......@@ -186,7 +181,7 @@ configure_chroot () {
${BROWSER_PREFS}
# 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
echo 'user_pref("browser.startup.homepage", "'${START_PAGE}'");' >> \
......
......@@ -111,18 +111,13 @@ setup_chroot () {
set_chroot_browser_name () {
NAME="${1}"
LONG=$(echo ${LANG} | grep -o "^[a-zA-Z_]*")
SHORT=${LONG%%_*}
LOCALE="${2}"
EXT_DIR=${CHROOT}/"${TBB_EXT}"
BRANDING=branding/brand.dtd
if [ -e "${EXT_DIR}/langpack-${LONG}@firefox.mozilla.org.xpi" ]; then
PACK="${EXT_DIR}/langpack-${LONG}@firefox.mozilla.org.xpi"
if [ "${LOCALE}" != en-US ]; then
PACK="${EXT_DIR}/langpack-${LOCALE}@firefox.mozilla.org.xpi"
TOP=browser/chrome
REST=${LONG}/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
REST=${LOCALE}/locale
else
PACK="${CHROOT}/${TBB_INSTALL}/browser/omni.ja"
TOP=chrome
......@@ -182,7 +177,7 @@ configure_chroot () {
echo 'user_pref("extensions.getAddons.showPane", false);' >> "${CLEARNET_PREFS}"
# 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
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