Consultor Eletrônico



Kbase P65250: CURRENT-LANGUAGE not affecting current but the next coming r
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   06/02/2004
Status: Unverified

FACT(s) (Environment):

Webspeed 3.1x

SYMPTOM(s):

CURRENT-LANGUAGE not affecting current but the next coming request.

CAUSE:

When you change the value of the CURRENT-LANGUAGE statement, you affect all the text phrases in the r-code that Progress subsequently runs. Any r-code that is already on the run-time stack still runs with the previous CURRENT-LANGUAGE setting. Also, CURRENT-LANGUAGE is a global value. If you return to a previously running piece of r-code from the place where you changed the CURRENT-LANGUAGE, the value of CURRENT-LANGUAGE is the changed value, not the language with which the "old" r-code is running.

FIX:

Use a dispacher procedure to change CURRENT-LANGUAGE for your client session.
For example:
- trans.p will be the dispacher by doing:
DEF VAR vc AS CHAR.
vc = get-field( 'Lang' ).
IF vc = '' OR vc = ? THEN vc = "English".
CURRENT-LANGUAGE = vc.
RUN pagex.p.
- pagex.p will be the translated page ( French, English( default) )
{&out} "Good morning".
You can call English version with:
http://localhost/scritps/cgiip.exe/trans.p?Lang=English
Call French version with:
http://localhost/scritps/cgiip.exe/trans.p?Lang=French