2010/7/27 ольга крыжановская <[email protected]>:
> Finnbarr, thank you for writing this cook book.
>
> I have one major feature request: NLSPATH should be set able at run
> time of the script. I experimented with script localisation and the
> following script but found that neither changing LC_ALL/LC_MESSAGES
> nor NLSPATH will alter the message catalogs being used:
> ===== cut =====
> #!/bin/ksh
>
> NLSPATH=$PWD/locale/%l/%N.cat
>
> name="David"
>
> function mymsg
> {
>        print  "Simple demonstration of  ksh93 message translation"
>        print  "Message locale is: $LC_MESSAGES"
>
>        echo   $"Hello"
>        print  $"Goodbye"
>        printf $"Welcome %s\n" $name
>
>        print  $"This string is not translated because it is not in the
> message catalog"
> }
>
> mymsg
> print "#####"
> LC_ALL=C mymsg
> ===== cut =====
>
> AFAIK there is no need to make the choice of message catalog dynamic
> for LC_ALL/LC_MESSAGES changes but changing or setting NLSPATH
> *within* the script which uses $"..." string literals has it's value
> and practical use, i.e. in cases scripts and their translation
> catalogs are installed not in a standard location.
>
> Glenn, can you change the libast l10n catalog code and allow libast
> based applications and scripts to change NLSPATH at run time, please?

IMO both LC_MESSAGES and NLSPATH are required to be dynamic, if we
still assume that the localisation of a shell function and shell built
in commands like cut, paste should be able to behave like an external
command. As example:
----------------------------------------
unset LC_ALL LANG LC_MESSAGES

function printhello
{
      print $"hello"
}

LC_MESSAGES=fr_FR.utf-8 printhello
LC_MESSAGES=C printhello
LC_MESSAGES=ja_JP.utf-8 printhello
----------------------------------------

shall print:

----------------------------------------
bonjour
hello
こんにちは
----------------------------------------

Irek
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to