Page 1 of 1

Set localization by code

Posted: Wed Apr 16, 2008 8:52 am
by Stéphane
Hello,

I want to set the localization by code. So, I use this line in my static constructor of my own Report class :

Code: Select all

StiMainMenuService.GetService(new StiDesigner()).SetLocalization("fr.xml");
StiConfig.Save();
I works on several computers. But, on some computers (and I don't know why), it doesn't work, the selected language is well French but the designer and the preview are in English. We must choose the French language again with the designer in order to work (we click on the French line in the language menu item although this line is already selected).
Is there a better solution to set localization by code ?

Cordially,
Kakone.

Set localization by code

Posted: Wed Apr 16, 2008 11:38 am
by Vital
Hello Kakone,

You can use following code for loading localization from file:

Code: Select all

StiConfig.LoadLocalization("fr.xml");
Next part of code switch localization in designer:

Code: Select all

StiLocalization.Localization = "fr.xml";
StiSettings.Load();
StiSettings.Set("Localization", "FileName", "fr.xml");
StiSettings.Save();
Thank you.