[pacman-dev] [PATCH] Gettext support in abs
Add gettext support to abs Signed-off-by: Giovanni Scafora <linuxmania@gmail.com> diff --git a/scripts/abs b/scripts/abs index 2ec4322..af01cd5 100755 --- a/scripts/abs +++ b/scripts/abs @@ -1,5 +1,13 @@ #!/bin/bash +# gettext initialization" +source gettext.sh + +TEXTDOMAIN=abs +export TEXTDOMAIN +TEXTDOMAINDIR='@localedir@' +export TEXTDOMAINDIR + CONFDIR="/etc/abs" CONNMODE="m" @@ -9,14 +17,15 @@ CONNMODE="m" [ -f ~/.abs.conf ] && source ~/.abs.conf usage() { - echo "Arch Build System -- synchronization utility" - echo "usage: $0 [-p] [repository1 [repository2 ...]]" + echo "$(gettext "Arch Build System -- synchronization utility")" + abs=$0 + echo "$(eval_gettext "usage: \$abs [-p] [repository1 [repository2 ...]]")" echo - echo "abs will synchronize PKGBUILD scripts from the CVS repository" - echo "into $ABSROOT. You can follow different package trees by" - echo "editing /etc/abs/supfile.* files. If no argument is given, abs " - echo "will synchronize from supfiles specified in /etc/abs/abs.conf." - echo "If -p is specified, the connection is opened in passive mode." + echo "$(gettext "abs will synchronize PKGBUILD scripts from the CVS repository")" + echo "$(eval_gettext "into \$ABSROOT. You can follow different package trees by")" + echo "$(gettext "editing /etc/abs/supfile.* files. If no argument is given, abs ")" + echo "$(gettext "will synchronize from supfiles specified in /etc/abs/abs.conf.")" + echo "$(gettext "If -p is specified, the connection is opened in passive mode.")" } update() { @@ -43,11 +52,11 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then fi if [ ! -d "$ABSROOT" ]; then - echo "abs: $ABSROOT does not exist (or is not a directory)" + echo "$(eval_gettext "abs: \$ABSROOT does not exist (or is not a directory)")" exit 1 fi if [ ! -w "$ABSROOT" ]; then - echo "abs: no write permissions in $ABSROOT" + echo "$(eval_gettext "abs: no write permissions in \$ABSROOT")" exit 1 fi @@ -56,7 +65,7 @@ if [ "$(type -p cvsup)" ]; then elif [ "$(type -p csup)" ]; then CVSUP="csup" else - echo "abs: missing CVS synchronization utility. Install cvsup or csup." + echo "$(gettext "abs: missing CVS synchronization utility. Install cvsup or csup.")" exit 1 fi -- 1.5.0.6 -- Giovanni Scafora Arch Linux Trusted User (voidnull) http://www.archlinux.org linuxmania@gmail.com
participants (1)
-
Giovanni Scafora