12-12-2023, 12:35 PM
Thanks,
WebApplication.Language was the kind of property I was looking for. As I have tested this I have noticed that the property value does not seem persistent. After setting the property the first time for a session, I successfully get the correct language in the generated page, but when I check the property value again in the next server event handler for the session I see that it is empty again. So I ended up adding code like this to make it work:
where HTMLLanguage is a property I added in my base class for our user sessions which is populated with a language code based on settings for the account the session belongs to. This works fine, but I just wanted to check if this is the way it's intended to be used?
WebApplication.Language was the kind of property I was looking for. As I have tested this I have noticed that the property value does not seem persistent. After setting the property the first time for a session, I successfully get the correct language in the generated page, but when I check the property value again in the next server event handler for the session I see that it is empty again. So I ended up adding code like this to make it work:
Code:
procedure TBaseClientServerController.IWServerControllerBaseBeforeRender(
ASession: TIWApplication; AForm: TIWBaseForm; var VNewForm: TIWBaseForm);
begin
if Assigned(ASession) and (ASession.Data is TMyBaseUserSession) then
ASession.Language := TMyBaseUserSession(ASession.Data).HTMLLanguage;
end;where HTMLLanguage is a property I added in my base class for our user sessions which is populated with a language code based on settings for the account the session belongs to. This works fine, but I just wanted to check if this is the way it's intended to be used?

