From 7f62d865ae7384f4c4bd489e2682ba52fabb7b62 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 11 Sep 2013 10:52:43 -0400 Subject: chroot-tools: internationalize --- src/chroot-tools/chcleanup | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/chroot-tools/chcleanup') 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 } -- cgit v1.2.3