[Scilab-Dev] Localization Scilab / Scipad
François Vogel
fvogelnew1 at free.fr
Sun Jul 20 21:31:46 CEST 2008
Enrico Segre said on 30/06/2008 09:44:
> On Sun, 2008-06-29 at 21:40 +0200, Claude Gomez wrote:
>> on 29/06/2008 10:42 Enrico Segre wrote:
>>
>>> Perhaps what you want is that at first run of scilab (no scipad
>>> preference file existing yet) the default scipad language matches that
>>> of scilab?
>> Yes it is exactly the behavior I would like to have.
>
> Then, modulo language sets mapping, that should amount just to a
>
> if { ![info exists lang] }
> { ScilabEval "TCL_SetVar(\"lang\",getlanguage(),\"scipad\") }
>
> at line 226 of SCI/modules/scipad/tcl/defaults.tcl.
I've just had a try on this suggestion.
It doesn't work.
And it doesn't work because in fact we would need to have the lang
variable set immediately, i.e. the Tcl script must wait until
ScilabEval has finished execution.
This means mandatory "sync" "seq" options for ScilabEval.
If I put this:
if {![info exists lang]} {
# general default fallback, in case retrieval from Scilab fails
set lang "en_US"
ScilabEval "TCL_SetVar(\"lang\",getlanguage(),\"scipad\")" "sync"
"seq"
}
}
in defaults.tcl lines 202+, then launching of Scipad just hangs.
Tcl interface...
scipad.sci reads the Tcl code the following way:
TCL_EvalStr("source
"""+SCI+"/modules/scipad/tcl/scipad.tcl""","scipad")
In scipad.tcl, a number of files are sourced, then Tcl main
level code is executed, starting in defaults.tcl.
In defaults.tcl, we have now
ScilabEval{TCL_SetVar\"lang\",getlanguage()... } sync seq
It hangs on this instruction.
Removing the sync, and keeping only the seq it doesn't hang anymore
but it sets the lang variable to the getlanguage() value only after
the full Scipad is sourced, which is too late.
Francois
More information about the dev
mailing list