Signed-off-by: Gordian Edenhofer <gordian.edenhofer@gmail.com> --- contrib/updpkgsums.sh.in | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/contrib/updpkgsums.sh.in b/contrib/updpkgsums.sh.in index c571d29..6183e0a 100644 --- a/contrib/updpkgsums.sh.in +++ b/contrib/updpkgsums.sh.in @@ -22,20 +22,34 @@ shopt -s extglob declare -r myname='updpkgsums' declare -r myver='@PACKAGE_VERSION@' +# gettext initialization +export TEXTDOMAIN='pacman' +export TEXTDOMAINDIR='@localedir@' + +# Determine whether we have gettext; make it a no-op if we do not +if ! type -p gettext >/dev/null; then + gettext() { + printf "%s\n" "$@" + } +fi + usage() { - printf "%s (pacman) v%s\n" "${myname}" "${myver}" + printf "%s (pacman) %s\n" "$myname" "$myver" + echo + printf -- "$(gettext "\ +%s will perform an in place update of the checksums in the\n\ +path specified by [build file], defaulting to PKGBUILD in the current\n\ +working directory")\n" "$myname" echo - printf "%s will perform an in place update of the checksums in the\n" "${myname}" - echo "path specified by [build file], defaulting to PKGBUILD in the current" - echo "working directory." + printf -- "$(gettext "Usage: %s [options] [build file]")\n" "$0" echo - printf "Usage: %s [options] [build file]\n" "${myname}" + printf -- "$(gettext "Options:")\n" + printf -- "$(gettext " -h, --help Display this help message and exit")\n" + printf -- "$(gettext " -V, --version Display version information and exit")\n" echo - echo " -h, --help display this help message and exit" - echo " -V, --version display version information and exit" + printf -- "$(gettext "These options can be passed to makepkg:")\n" + printf -- "$(gettext " -m, --nocolor Disable colorized output messages")\n" echo - echo "These options can be passed to makepkg:" - echo " -m, --nocolor disable colorized output messages" } version() { -- 2.10.0