There is a nice feature in bash, about localization (language translation):
TEXTDOMAIN=coreutils LANG=fr_CH.utf8 echo $\"system boot\" démarrage système
OK I think finally got it right.
iprintf() { msg="$2" domain="$1" shift shift imsg=$(gettext -ed "$domain" "$msg" ; echo EOF) imsg="${imsg%EOF}" printf "$imsg" "$@" }
Usage example:
LANG=fr_CH.utf8 iprintf coreutils "If FILE is not specified, use %s. %s as FILE is common.\n\n" foo bar