Hi,
I'm trying to use TSiLang component with Intraweb solution (with D7 Ent.), but I don't understand how to create a Dispatcher. I'm trying to use a DataModule create with User's Session but when user switch Language it raises an exception.
Some Help?
Rhodan
IntraWeb : how to dispatch?
I supose that in IntraWeb applications you won't need dispatcher or you may put it onto your IntraWeb form. But I suggest to use "per form language" settings. Just configure manually your IntraWeb form active language depending on user selection or so on.
Also may be we can build a sample IntraWebn application for this case if you provide us simple specification for your case.
Also may be we can build a sample IntraWebn application for this case if you provide us simple specification for your case.
Hi from Paris,
Why don't use a Dispatcher. It's more simple to use such a component created in User's Session Class.
If not, how to control in a simple way, all IWForm with a siLang component an each?
I'm looking for a similar way to process between Classical Application and Intraweb Application. It's for our translators
Thanks for your answer.
Rhodan
Why don't use a Dispatcher. It's more simple to use such a component created in User's Session Class.
If not, how to control in a simple way, all IWForm with a siLang component an each?
I'm looking for a similar way to process between Classical Application and Intraweb Application. It's for our translators

Thanks for your answer.
Rhodan
Detailled Code
Hi,
this is the code used for my IW Application :
-- unit ServerController-----------------------------------------
-- unit DataModule_User -----------------------------------------
-------------------------------
On an event I set
DM_User.activeLang(2);
LangDispatcher supports 2 languages.
WepApplication starts fine, but an Event an EAccessViolation occurs in my Application on line :
LangDispatcher.ActiveLanguage := Num;
Thanks for your help.
Rhodan
this is the code used for my IW Application :
-- unit ServerController-----------------------------------------
Code: Select all
unit ServerController;
{PUBDIST}
interface
uses
SysUtils, Classes, IWServerControllerBase,
// For OnNewSession Event
IWApplication, IWAppForm, siComp,
DataModule_User;
type
TDMSvrCtler = class(TIWServerControllerBase)
procedure IWServerControllerBaseNewSession(ASession: TIWApplication;
var VMainForm: TIWAppForm);
private
public
end;
// --------- Session Class -------------
TDMUserSession = Class (TComponent)
public
DM_USer : TDM_User;
constructor Create(AOwner: TComponent); override;
End;
implementation
{$R *.dfm}
uses
IWInit;
constructor TDMUserSession.create(AOwner : TComponent);
Begin
DM_User := TDM_User.Create(AOwner);
End;
procedure TDMSvrCtler.IWServerControllerBaseNewSession(
ASession: TIWApplication; var VMainForm: TIWAppForm);
begin
//ASession.Data := TUserSession.Create;
ASession.Data := TDMUserSession.Create(ASession);
end;
end.
Code: Select all
unit DataModule_User;
interface
uses
SysUtils, Classes, siComp;
type
TDM_User = class(TDataModule)
LangDispatcher: TsiLangDispatcher;
private
public
procedure ActiveLang(Num : integer);
end;
var
DM_User: TDM_User;
implementation
{$R *.dfm}
Procedure TDM_User.ActiveLang(Num : integer);
Begin
LangDispatcher.ActiveLanguage := Num;
End;
end.
On an event I set
DM_User.activeLang(2);
LangDispatcher supports 2 languages.
WepApplication starts fine, but an Event an EAccessViolation occurs in my Application on line :

LangDispatcher.ActiveLanguage := Num;
Thanks for your help.
Rhodan
Hello,
We cannot reproduce the problem. Could you send us that project you have tested? Otherwise you can download our small test project from
http://www.sicomponents.com/soft/IW_SiLang.zip and compare with yours.
We cannot reproduce the problem. Could you send us that project you have tested? Otherwise you can download our small test project from
http://www.sicomponents.com/soft/IW_SiLang.zip and compare with yours.
Best regards,
Serghei Gaivan
Serghei Gaivan
Your example works
Hi,
it's annoying, your example works
I'm looking for the source of problem in my code, may be the included TMS Component for IW...
In all case thanks for your great support!
Rhodan
it's annoying, your example works

I'm looking for the source of problem in my code, may be the included TMS Component for IW...
In all case thanks for your great support!
Rhodan