Kbase P60114: How to change CURRENT-LANGUAGE on the Appserver?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  19/12/2003 |
|
Status: Unverified
GOAL:
How to change CURRENT-LANGUAGE on the Appserver?
GOAL:
How to use the CURRENT-LANGUAGE statement to change a session language.
FACT(s) (Environment):
Progress 9.x
FIX:
The Appserver is a Progress client session, so changing the current language setting is exactly the same as for a GUI client session.
In this example a persistent procedure is created that displays the current language setting. This is translated from English into Dutch using Tranman and then the .r code is placed in the Appserver working directory. The code is as follows:
/* proclib.p */
DEF VAR wi-count AS INT INITIAL 0.
PROCEDURE proc1:
DEF VAR a AS CHARACTER INITIAL "Monday" NO-UNDO.
wi-count = wi-count + 1.
MESSAGE "PROCLIB : wi-count " + STRING(wi-count,"9") + " " +
CURRENT-LANG VIEW-AS ALERT-BOX.
MESSAGE a VIEW-AS ALERT-BOX.
END.
A Second procedure is then used to call the above internal procedure proc1 as follows:
/* main.p */
DEF VAR h_proc AS HANDLE.
CURRENT-LANGUAGE = "Dutch".
RUN proclib.p PERSISTENT SET h_proc.
RUN proc1 IN h_proc.
DELETE PROCEDURE h_proc.
CURRENT-LANGUAGE = "English".
RUN proclib.p PERSISTENT SET h_proc.
RUN proc1 IN h_proc.
DELETE PROCEDURE h_proc.
Finally this is run from the GUI client with:
/* callproc.p */
DEFINE VARIABLE hAppsrv AS HANDLE NO-UNDO.
CREATE SERVER hAppsrv.
hAppsrv:CONNECT("-AppService asbroker5 -S 5162").
RUN main.p ON hAppsrv.
hAppsrv:DISCONNECT().
DELETE OBJECT hAppsrv.