summaryrefslogtreecommitdiff
path: root/src/chroot-tools/chcleanup
diff options
context:
space:
mode:
Diffstat (limited to 'src/chroot-tools/chcleanup')
-rwxr-xr-xsrc/chroot-tools/chcleanup12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup
index d2d9a70..fa6a572 100755
--- a/src/chroot-tools/chcleanup
+++ b/src/chroot-tools/chcleanup
@@ -12,18 +12,24 @@ DRYRUN=${DRYRUN:-false}
################################################################################
# Define these here to avoid having dependencies on outside files
+if type gettext &>/dev/null; then
+ _() { gettext "$@"; }
+else
+ _() { echo "$@"; }
+fi
+
msg() {
- local mesg=$1; shift
+ local mesg="$(_ "$1")"; shift
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}
msg2() {
- local mesg=$1; shift
+ local mesg="$(_ "$1")"; shift
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}
error() {
- local mesg=$1; shift
+ local mesg="$(_ "$1")"; shift
printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}