I’ve been following a tutorial from a recent edition of the Linux Journal which teaches how to internationalize Bash scripts. However, I’m having trouble getting it to work on my system (Ubuntu 10.04.) When I get to the part where I’m supposed to call “gettext,” after setting the environment variable TEXTDOMAINDIR, I get:
toby@toby-laptop:~/Desktop/i18n$ gettext -s "Greeting"
Greeting
But it should be printing a message that says “Hello, I can generate a random number between 2 numbers that you provide” instead of just “Greeting.” Can anybody replicate this problem? Any ideas what I’m doing wrong? Thanks!
The author of that tutorial forgot the following step:
which should be performed when step shown as
export TEXTDOMAINDIR=/home/lji/localeis done (substituting the appropriate directory name).You can use
$""instead ofgettext:Note that the Bash manual says that some systems may make use of the variables
$LC_MESSAGES,$TEXTDOMAINand$TEXTDOMAINDIRin different ways.