make gettext optional in _sudo()

address #355
This commit is contained in:
Jaromil 2019-07-05 08:10:00 +02:00
parent d83e39f1ec
commit 0b9080e0ca

4
tomb
View File

@ -126,8 +126,8 @@ export TEXTDOMAIN=tomb
# Wrap sudo with a more visible message # Wrap sudo with a more visible message
_sudo() { _sudo() {
local sudo_eng="[sudo] Enter password for user ::1 user:: to gain superuser privileges" local msg="[sudo] Enter password for user ::1 user:: to gain superuser privileges"
local msg="$(gettext -s "$sudo_eng")" command -v gettext 1>/dev/null 2>/dev/null && msg="$(gettext -s "$msg")"
msg=${(S)msg//::1*::/$USER} msg=${(S)msg//::1*::/$USER}
sudo -p " sudo -p "
$msg $msg