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

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
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}"
set_chroot_torbutton_browser_name "${CHROOT}" "${NAME}"
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