Set localization by code

Stimulsoft Reports.NET discussion
Post Reply
Stéphane
Posts: 74
Joined: Wed Dec 06, 2006 3:45 am
Location: Paris (France)

Set localization by code

Post 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.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Set localization by code

Post 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.
Post Reply