Page 1 of 1
TreeView translation does not work
Posted: Mon Sep 21, 2009 10:15 am
by Eva
Hi !
I have a form with a TreeView translated with TsiLangTLV.
TsiLangTLV uses LangDispatcher with two languages german and french.
The default language is german.
I set ActiveLanguage from LangDispatcher to french.
All forms work fine but the TreeView isn't translated if applikation is running, it is always in the default language.
Any ideas what's rong?
Thanks
Best Regards
Eva
ps: using SiComponents Version 6.5
Posted: Mon Sep 21, 2009 10:34 am
by isiticov
Hi!
May be you change the content of the tree-view in the code after changing language?
Posted: Mon Sep 21, 2009 11:17 am
by Eva
Hi!
Thanks for the quick response.
The problem is after start the application, not in design.
I check the SIB-File, it contains the new tree-view items.
Any other tips?
Thanks
Eva
Posted: Mon Sep 21, 2009 11:37 am
by isiticov
Yes, I mean that it might be that after changing language at run-time there is some code in your application that dynamically fill content of the tree-view.
Posted: Mon Sep 21, 2009 12:57 pm
by Eva
Yes, you are absolutely right.
The tree-view is depends on the user rigths and is dynamically filled.
Now after fill I call the procedure
siLangTLV1.ChangeLanguage
Is there a better way, what would you suggest?
Thanks
Eva
Posted: Mon Sep 21, 2009 1:12 pm
by isiticov
I wouldn't recommend to use TsiLangTLV on tree-views that contain dynamic content. Because if it is dynamic the translation may appear incorrect since TsiLang just translates items by index. I would recommend you to create a method that will fill content of the tree-view depending on needed conditions and use in this methid TsiLang's GetTextOrDefault() methods for the strings. Lately during run-time I would call this method inside OnChangeLanguage event of TsiLang in order to be sure the UI content is in correct language.
Hope this helps.
Posted: Mon Sep 21, 2009 1:38 pm
by Eva
Thanks for opening my eyes and for your good tips.
I try to realize your suggest.
Thanks
Eva