Customer section

Forum index » Precision Language Suite » Frames don't react to OnLanguageChanged

GoSane

Number of posts: 21
Rank: User

Profile of user
Response

Posted: 02.12.2017 [16:04]

Hello,

I have a form with several frames. Each frame has a TplsController. When the form opens, everything is correctly translated but when I change language with LanguageManager.LanguageCode:='en'; from the main menu, the Frames' TPlsController do not see the change (everything not in frames is updated correctly). How can I make the frames react immediately to the change ?

Thanks,

JC

admin

Number of posts: 557
Rank: admin •••

Profile of user
Response

Posted: 02.12.2017 [16:58]

Hello.

You have to call frame's plsController.LangForm method explicitly from withing form's plsController.LanguageChanged event handler. For example:

Code:

procedure TForm1.plsController1LanguageChanged(Sender: TObject);
var
i, j: Integer;
begin
for i := 0 to ComponentCount - 1 do
if Components[i] is TFrame then
begin
for j := 0 to TFrame(Components[i]).ComponentCount - 1 do
if TFrame(Components[i]).Components[j] is TplsController then
begin
TplsController(TFrame(Components[i]).Components[j]).LangManager.LangForm(TFrame(Components[i]));
break;
end;
end;
end;



Hope this helps!

Roman

GoSane

Number of posts: 21
Rank: User

Profile of user
Response

Posted: 02.12.2017 [22:45]

Thanks a lot Roman, it works perfectly.

New post to this topic

[.bold.]TEXT[./bold.]  [.italic.]TEXT[./italic.]  [.code.] TEXT [./code.]  [.quote.] TEXT [./quote.]

Number of topics: 373 • Number of posts: 1244 • Number of registered users: 62

Copyright © 2008-2021  Precision software & consulting. All rights reserved.
Send your comments to www pages.
Contact   |   RSS
Precision software & consulting
Narodnich mucedniku 447
738 01  Frydek-Mistek
Czech Republic