Commit 7db7449a authored by Tails developers's avatar Tails developers
Browse files

gettext:ize unsafe-browser.

parent 3661a29a
#!/bin/sh
CMD=$(basename ${0})
. gettext.sh
TEXTDOMAIN=${CMD}
export TEXTDOMAIN
SQUASH=/live/image/live/filesystem.squashfs
ROFS=/live/rofs
CONF_DIR=/var/lib/unsafe-browser
......@@ -35,10 +41,10 @@ cleanup () {
}
error () {
local cli_text="${0}: error: ${@}"
local cli_text="${CMD}: `gettext \"error\"`: ${@}"
local dialog_text="${@}
Unsafe Browser will exit now."
`gettext \"Unsafe Browser will exit now.\"`"
echo "${cli_text}" >&2
zenity --error --title "" --text "${dialog_text}"
exit 1
......@@ -46,15 +52,15 @@ Unsafe Browser will exit now."
warning () {
local text="${@}"
echo "${0}: warning: ${text}" >&2
echo "${CMD}: `gettext \"warning\"`: ${text}" >&2
zenity --warning --title "" --text "${text}"
}
verify_start () {
# Make sure the user really wants to start the browser
local dialog_msg="<b>Do you really want to launch the Unsafe Browser?</b>
local dialog_msg="<b>`gettext \"Do you really want to launch the Unsafe Browser?\"`</b>
All activity within the Unsafe Browser will <b>not</b> be anonymous. Only use the the Unsafe Browser if necessary, for example if you have to login or register in order to activate your Internet connection."
`gettext \"All activity within the Unsafe Browser will <b>not</b> be anonymous. Only use the the Unsafe Browser if necessary, for example if you have to login or register in order to activate your Internet connection.\"`"
if ! zenity --question --title "" --text "${dialog_msg}"; then
exit 0
fi
......@@ -72,7 +78,8 @@ setup_chroot () {
mount -t tmpfs tmpfs ${COW} && \
mount -t aufs -o noatime,noxino,dirs=${COW}=rw:${ROFS}=rr+wh aufs ${CHROOT} && \
mount -t proc proc ${CHROOT}/proc && \
mount --bind /dev ${CHROOT}/dev || error "Failed to setup chroot"
mount --bind /dev ${CHROOT}/dev || \
error "`gettext \"Failed to setup chroot.\"`"
}
configure_chroot () {
......@@ -127,7 +134,7 @@ fi
# Some stupid captive portals may allow DNS to any host, but chances are
# that only the portal's DNS would forward to the login page.
if [ -z "${IP4_NAMESERVERS}" ]; then
error "No DNS server was obtained through DHCP or manually configured in NetworkManager."
error "`gettext \"No DNS server was obtained through DHCP or manually configured in NetworkManager.\"`"
fi
verify_start
......
......@@ -16,9 +16,13 @@ refresh_translations () {
mkdir -p "${sharedir}"
xgettext --language="${proglang}" --from-code=UTF-8 \
-o "${pot}" \
"config/chroot_local-includes/usr/local/bin/${prog}"
for dir in bin sbin ; do
progpath="config/chroot_local-includes/usr/local/${dir}/${prog}"
if [ -e "${progpath}" ]; then
xgettext --language="${proglang}" --from-code=UTF-8 \
-o "${pot}" "${progpath}"
fi
done
for locale in $AMNESIA_SUPPORTED_LANGUAGES ; do
po="${locale_basedir}/${locale}/LC_MESSAGES/${prog}.po"
......@@ -33,3 +37,7 @@ refresh_translations () {
for prog in gpgApplet tails-security-check tails-htp-notify-user tails-virt-notify-user ; do
refresh_translations $prog Perl
done
for prog in unsafe-browser ; do
refresh_translations $prog Shell
done
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