On Tue, Apr 25, 2006 at 05:08:29PM +0200, Carlos E. R. wrote:
> Of course, that's true. I don't know if it is possible to
> "internationallise" an script, ie, translate its messages.
Sure it is. Check the language settings and then do with that what you
like. Either in the script or outside of it.
MY_LANG=`locale|grep LANG|awk -F= '{print $NF}'`
Then use:
en_US_MESSAGE1="This is message 1"
nl_BE_MESSAGE1="Dit is bericht 1"
...
For the real message you can then use:
echo "${MY_LANG}_MESSAGE1"
You can even make it easier and use
MESSAGE1=${MY_LANG}_MESSAGE1
You will need some extra testing, go back to a default and so on, but in
general it is not that hard to do.
Using an external file might be easier:
MY_LANG=`locale|grep LANG|awk -F= '{print $NF}'`
then use
. ${MY_LANG}.po
There you have
en_US.po : MESSAGE1="This is message 1"
nl_BE.po : MESSAGE1="Dit is bericht 1"
In the script you then use:
echo $MESSAGE1
I am sure other people will have much better solutions. It is just a prove
of concept.
> Often in SuSE scripts are self-documented, with comments. It would be very
> dificult to maintain that kind of documentation in diferent languages. In
> those cases, the translation has to be separate.
Those are remarks, not so much documentation.
I am talking about documentation for the user. You are talking about
documentation for the developer. Again an whole other issue.
Please stop sidestepping the issue.
This is as far as I can see how the discussion is going:
+ I would like to have better user documentation
- Write it
+ Well, actually I would like user documents translations
- Well, translate it
+ Well, actually I would developer comments translated
...
So again please rephrase what you want and what you do not want.
houghi
--
Nutze die Zeit. Sie ist das Kostbarste, was wir haben, denn es
ist unwiederbringliche Lebenszeit. Leben ist aber mehr als Werk
und Arbeit, und das Sein wichtiger als das Tun
- Johannes Müller-Elmau
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]