I would suggest using the same approach that is used within internationalized applications. Look up the strings based on the locale. It would look something like this:

if [ -f ${DIRECTORY}/script-strings-${LANG}.sh ]; then
  . ${DIRECTORY}/script-strings-${LANG}.sh
else
  . ${DIRECTORY}/script-strings-${DEFAULT_LANG}.sh
fi

# ...

grep $GREP_STRING_1 files

You will still need to localize the script for each language, but you have moved the localization out of the script logic.

Amarendra Godbole wrote:

So my question is: how to deal with such scenarios? An immediate
solution that strikes me is to use the if loop, something like
this: (pseudocode)
if LANG = jp; then
  grep '<<japanese string>>'
else
  grep '<<english string>>'
endif

--
D. Dale Gulledge, Sr. Programmer,
[EMAIL PROTECTED]
C, C++, Perl, Unix (QNX, AIX, Linux), Oracle, Java,
Internationalization (i18n), Lisp, HTML, CGI.

--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to