[pacman-dev] [PATCH] Gettext support in gensync

Andrew Fyfe andrew at neptune-one.net
Mon Apr 2 10:09:23 EDT 2007


Giovanni Scafora wrote:
> Add gettext support to gensync.
> 
> Signed-off-by: Giovanni Scafora <linuxmania at gmail.com>
> 
> diff --git a/scripts/gensync b/scripts/gensync
> index f99cf59..fa88f32 100755
> --- a/scripts/gensync
> +++ b/scripts/gensync
> @@ -20,28 +20,37 @@
>  #   USA.
>  #
> 
> +# gettext initialization"
> +source gettext.sh
> +
> +TEXTDOMAIN=gensync
> +export TEXTDOMAIN
> +TEXTDOMAINDIR='@localedir@'
> +export TEXTDOMAINDIR
> +

Is there any reason why we can't use a common TEXTDOMAIN for all the 
scripts. I think with a little tidying up we'll find that there's a lot 
of standard messages in the scripts, and it would be easier for 
translators to maintain if it was all in the same .mo file.

Also Dan reminded me you can't use $() and $1 in eval_gettext, so to 
make life easier we might want to use printf instead of echo in the 
output functions. eg from abs

     error "$(eval_gettext "invalid root dir: \$rootdir")"
would become
     error "$(gettext "invalid root dir: %s")" $rootdir

and change the output functions to something like
     local msg=$1; shift
     printf "==> ERROR: $msg\n" $*

Andrew




More information about the pacman-dev mailing list