Force Refresh

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
ix07
Posts: 15
Joined: Tue May 26, 2009 4:52 pm

Force Refresh

Post by ix07 »

Is it possible to force a TsiLang component to reapply its translations to the translated component properties?

I have the situation that I am using the DevExpress layout control to save control layouts and this control also stores and loads control captions.

After the loading of a layout all captions are untranslated again and I would like to force a specific TsiLang component to reapply it's translations.

I would prefer not to use the dispatcher for this, because this would reload translations on all connected TsiLang components which would be bad for performance.

Thanks.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Just call ChangeLanguage method of TsiLang.
Best regards,
Igor Siticov.
PvdL
Posts: 11
Joined: Thu Jan 02, 2014 11:58 am

Post by PvdL »

This trick doesn't work in certain situations. I have an application with 7 languages. English is the first (default) one and at startup a *.SIB file is loaded with the latest translations. After that I read from an inifile the latest used language and set Activelanguage to it. In case of English (=1) it doesn't work because setting ActiveLanguage to 1 (=English) doesn't trigger the refresh because the Activelanguage didn't really changed (it was 1 and changed to 1). The workaround now is reading the inifile, change Activelanguage to one higher of lower (if possible) and tha actual language. Would be much nicer just to call something like "Refresh" or "Reload".
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Calling ChangeLanguage method (this is the exact name of method) will enforce update of current translations on controls with info from TsiLang.
Best regards,
Igor Siticov.
Post Reply