Commit 63d7e04d authored by Tails developers's avatar Tails developers
Browse files

Fix localization of the Unsafe Browser's name-setting.

It turns out that the branding's name of the browser can differ quite
a bit between different langpacks, e.g. in Arabic it's written in
Arabic, but in languages using latin based it's often "(Mozilla)?
Firefox". Hence we must set the value according to the key, which is
the saner way, instead of simply replacing values.
parent 3caa2763
......@@ -114,23 +114,20 @@ set_chroot_browser_name () {
PACK="${EXT_DIR}/langpack-${LONG}@firefox.mozilla.org.xpi"
TOP=browser/chrome
REST=${LONG}/locale
OLD_NAME="Mozilla Firefox"
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
OLD_NAME="Mozilla Firefox"
else
PACK="${CHROOT}/usr/local/lib/tor-browser/Browser/browser/omni.ja"
TOP=chrome
REST=en-US/locale
OLD_NAME="Tor Browser"
fi
TMP=$(mktemp -d)
# Non-zero exit code due to non-standard ZIP archive.
# The following steps will fail soon if the extraction failed anyway.
unzip -d "${TMP}" "${PACK}" || true
sed -i "s/${OLD_NAME}/${NAME}/" "${TMP}/${TOP}/${REST}/${BRANDING}"
sed -i "s/<"'!'"ENTITY\s\+brand\(Full\|Short\)Name.*$/<"'!'"ENTITY brand\1Name \"${NAME}\">/" "${TMP}/${TOP}/${REST}/${BRANDING}"
rm "${PACK}"
(cd $TMP ; 7z a -tzip "${PACK}" .)
chmod a+r "${PACK}"
......
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