Operating System - Linux
1753266 Members
5319 Online
108792 Solutions
New Discussion юеВ

Re: character output in different languages (shell script)

 
Billa-User
Regular Advisor

character output in different languages (shell script)

hello,

i have to change a lot of shell scripts (sh,ksh) for one reason :

the character output in a script should be done in different languages.

for example:

echo "this is a test"

and "this is a test" should be printed out in a other language,which i choice, for an example: german ("das ist ein test"), italian and so.

i saw a tool "gettext" , is it useable for this ?

also should work

echo "this is a test of Variable $Var"

regards
2 REPLIES 2
Ivan Krastev
Honored Contributor

Re: character output in different languages (shell script)

In start of scripts set language and include language files, depending of choise.

For exaple:

if $LANG == ENG {
. english.text
}

and after that just echo, print variables - echo $MSG1.

In the file english.text MSG1='this is a test'
in file german.text MSG1='das ist ein test' and so on.


regards,
ivan
James R. Ferguson
Acclaimed Contributor

Re: character output in different languages (shell script)

Hi:

The GNU 'gettext' package is available for HP-UX from the Porting Center. The manpages and README file offers some insights for your undertaking (should you decide that this is worth the effort).

http://hpux.cs.utah.edu/hppd/hpux/Gnu/gettext-0.17/

Regards!

...JRF...