Page 1 of 1

Force Refresh

Posted: Thu Aug 06, 2015 4:14 pm
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.

Posted: Fri Aug 07, 2015 5:50 am
by isiticov
Just call ChangeLanguage method of TsiLang.

Posted: Mon Nov 02, 2015 12:46 pm
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".

Posted: Wed Nov 04, 2015 2:55 am
by isiticov
Calling ChangeLanguage method (this is the exact name of method) will enforce update of current translations on controls with info from TsiLang.