Commit 3c3fb818 authored by Tails developers's avatar Tails developers

Optimize startup of I2P browser a bit.

We don't have to fix the name in all branding files, only for the
locale we're actually gonna use.
parent b08dbb3f
......@@ -110,7 +110,11 @@ run_chroot_browser () {
set_chroot_torbutton_browser_name () {
local chroot="${1}"
local name="${2}"
local torbutton_dir="${chroot}"/usr/share/xul-ext/torbutton
find "${torbutton_dir}" -name 'brand.dtd' -print0 | \
xargs -0 -r sed -i "s/<"'!'"ENTITY\s\+brand\(Full\|Short\)Name.*$/<"'!'"ENTITY brand\1Name \"${name}\">/"
local locale="${3}"
local torbutton_locale_dir="${chroot}"/usr/share/xul-ext/torbutton/chrome/locale/${locale}
if [ ! -d "${torbutton_locale_dir}" ]; then
# Surprisingly, the default locale is en, not en-US
torbutton_locale_dir="${chroot}"/usr/share/xul-ext/torbutton/chrome/locale/en
fi
sed -i "s/<"'!'"ENTITY\s\+brand\(Full\|Short\)Name.*$/<"'!'"ENTITY brand\1Name \"${name}\">/" "${torbutton_locale_dir}/brand.dtd"
}
......@@ -91,8 +91,6 @@ configure_chroot () {
ln -s "${LANGPACK}" "${BROWSER_EXT}"
done
set_chroot_torbutton_browser_name "${CHROOT}" "${NAME}"
BROWSER_PREF_DIR="${BROWSER_PROFILE}/preferences"
BROWSER_PREFS="${BROWSER_PREF_DIR}/prefs.js"
mkdir -p "${BROWSER_PREF_DIR}"
......@@ -115,6 +113,7 @@ configure_chroot () {
# Set the name (e.g. window title) of the browser
set_chroot_browser_name ${CHROOT} "`gettext \"I2P Browser\"`" "${BEST_LOCALE}"
set_chroot_torbutton_browser_name "${CHROOT}" "${NAME}" "${BEST_LOCALE}"
# Set start page to the router console
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