Opened 8 years ago

Last modified 8 years ago

#3976 accepted defect

Setting the locale via scripting does not work

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone: Future
Component: Interactive Environment Version:
Keywords: Cc:

Description

Running test.mos:

setCommandLineOptions("+locale=en_US"); getErrorString();
loadModel(Modelica); getErrorString();
getInheritedClasses(Modelica.Mechanics.MultiBody.Visualizers.Advanced.Shape); getErrorString();

on a computer with a Swedish locale gives:

IDA-LIU050+adrpo@ida-liu050 MINGW32 ~/dev/OpenModelica/build/bin
$ ./omc.exe test.mos
true
""
true
""
{ModelicaServices.Animation.Shape,Modelica.Utilities.Internal.PartialModelicaServices.Animation.PartialShape}
"[c:/bin/cygwin/home/adrpo/dev/OpenModelica/build/lib/omlibrary/Modelica 3.2.2/Mechanics/MultiBody/Visualizers.mo:1979:8-1980:83:writable] Error: PartialModelicaServices ▒r partiell, namnuppslagning ▒r inte till▒tet i partiella klasser.
"

Running omc +locale=en_US gives me messages in English.

Change History (3)

comment:1 by Adrian Pop, 8 years ago

Owner: changed from somebody to Adrian Pop
Status: newaccepted

comment:2 by Martin Sjölund, 8 years ago

I guess you need to call System.gettextInit again. Usually applications do not allow you to change the locale after it has been initialized though.

comment:3 by Adeel Asghar, 8 years ago

So Should we expose System.gettextInit with new API?

Note: See TracTickets for help on using tickets.