Page 1 of 1

Multi language

Posted: Fri Sep 13, 2013 2:39 pm
by bpd2000
I am creating function for Multi language
Whether logic of attached program is correct or suggest me best one
Regards

Re: Multi language

Posted: Fri Sep 13, 2013 3:37 pm
by esgici
Thank Dave :)

Nice UT8 sample :arrow:

Viva HMG :D

Re: Multi language

Posted: Fri Sep 13, 2013 6:24 pm
by danielmaximiliano
gracias por compartir Dave...

thanks for sharing Dave

Happy day

Re: Multi language

Posted: Sat Sep 14, 2013 7:53 am
by serge_girard
Dave,

Nice!

One thing I learned was not to hardcode user-output-text into your application.
For my own clipper application I made

Code: Select all

 
FUNCTION Lang_Descr (TCode, TLanguage)		&& MESSAGES AND TEXT
/************************************/ 
local n
TDescr  := ''
FOR n = 1 TO nNum_Of_Messages
   IF T_CODE [n] == TCode .AND. T_LANGUAGE [n] == TLanguage
      TDescr  :=  ALLTRIM(T_OMS [n] )
      EXIT
   ENDIF
NEXT n

RETURN(TDescr)

Code: Select all

@ nRow, nCOL GRID Grid_KL002		;
	WIDTH  550	* SCR_PWIDTH		;
	HEIGHT 300			;
	HEADERS {Lang_Descr( "252", cLang_Code ), Lang_Descr( "066", cLang_Code ), Lang_Descr( "067", cLang_Code), Lang_Descr( "253", cLang_Code),     Lang_Descr( "149", cLang_Code), Lang_Descr( "147", cLang_Code)  };
	WIDTHS  {   60* SCR_PWIDTH,               100* SCR_PWIDTH,                 100* SCR_PWIDTH,                100* SCR_PWIDTH,                    100* SCR_PWIDTH,                100* SCR_PWIDTH };
   JUSTIFY {  GRID_JTFY_RIGHT,               GRID_JTFY_RIGHT,                 GRID_JTFY_RIGHT,                GRID_JTFY_RIGHT,                    GRID_JTFY_RIGHT,                GRID_JTFY_RIGHT} ;
	FONT "Arial" SIZE wfont1		;
	BACKCOLOR WFocusColor	;
	FONTCOLOR WFontColor BOLD ;
	ON DBLCLICK Edit_KL003()
The message table looks like this:

Message_Code char 3
Message_Text char 80
Message_Lang char 2

Initially load into 3 arrays: T_CODE, T_LANGUAGE, T_OMS.
Code is translated so ther might be some typo.

Greetings, Serge

Re: Multi language

Posted: Sat Sep 14, 2013 8:35 am
by bpd2000
Thank you all

Re: Multi language

Posted: Sat Sep 14, 2013 8:36 am
by esgici
Hi Serge
serge_girard wrote:...One thing I learned was not to hardcode user-output-text into your application....
Good suggestion, nice sampler code, thanks :)

However, this rule may considered negligible in SS samples, I think.

Happy HMG'ing :D

Re: Multi language

Posted: Sat Sep 14, 2013 8:48 am
by serge_girard
Esgici,

Yes it maybe.

It should be nice to have standard example functions, like login.
So nobody would have to invent the wheel again, only adept to his likes!

When I have more sparetime I will post my login-functions.

Bye,

Serge

Re: Multi language

Posted: Sat Sep 14, 2013 8:56 am
by esgici
serge_girard wrote: It should be nice to have standard example functions, like login.
So nobody would have to invent the wheel again, only adept to his likes!
Agreed :)
When I have more sparetime I will post my login-functions.
We will wait;

happy HMG days :D