From 63d7e04da6b9482700122037d10ba67296618921 Mon Sep 17 00:00:00 2001 From: Tails developers Date: Tue, 23 Sep 2014 12:29:03 +0200 Subject: [PATCH] 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. --- config/chroot_local-includes/usr/local/sbin/unsafe-browser | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/chroot_local-includes/usr/local/sbin/unsafe-browser b/config/chroot_local-includes/usr/local/sbin/unsafe-browser index f91a88c88d..c146c4dfbd 100755 --- a/config/chroot_local-includes/usr/local/sbin/unsafe-browser +++ b/config/chroot_local-includes/usr/local/sbin/unsafe-browser @@ -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}" -- GitLab