STRU - Lists and modifies the structure of the dbfs files
Posted: Wed Sep 26, 2012 12:26 pm
Mr. Esgici, you always are very kind and a gentleman ! Thank you !
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://hmgforum.com/
Code: Select all
SET LANGUAGE TO POLISH
HB_CDPSELECT("PL852")
Code: Select all
SET LANGUAGE TO POLISH
HB_CDPSELECT("PLWIN")
Code: Select all
Case Upper(IDIOMA)="POLISH"
SET LANGUAGE TO POLISH
SET CODEPAGE TO POLISH
HB_CDPSELECT("PL852")
.
.lng files need to be saved as unicode for corrrect screen show
Code: Select all
//*----------------------------------------------------------------------------*
//
// M., Ronaldo: 2012/10/09
//
// Class: Unicode support to Harbour app´s
//
//*----------------------------------------------------------------------------*
STATIC PROCEDURE MR_Set_Lang_and_CP()
/* Terminal and OS codepage */
hb_SetTermCP( hb_cdpTerm() )
Set( _SET_OSCODEPAGE, hb_cdpOS() )
/* Set language for Gui */
hb_langSelect( hb_UserLang(), "UTF8EX" )
hb_cdpSelect( "UTF8EX" )
? hb_langname()
RETURN
//*----------------------------------------------------------------------------*
// PROCEDURE MAIN( ... )
//*----------------------------------------------------------------------------*
PROCEDURE MAIN( ... )
...
*---------------------------------------------------------------------------*
* HMG MESSAGES - PT_BR ( uncomment for test purposes )
*---------------------------------------------------------------------------*
// SET LANGUAGE TO PORTUGUESE
// SET CODEPAGE TO PORTUGUESE
*---------------------------------------------------------------------------*
* UNICODE SUPPORT
*---------------------------------------------------------------------------*
MR_Set_Lang_and_CP()
...
RETURN
//*----------------------------------------------------------------------------*
// HB_GTSYS()
//*----------------------------------------------------------------------------*
PROCEDURE HB_GTSYS()
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850
RETURN
YesChacal.GO wrote:Are you using HMG 3.0.44 ?
Because my files is still in Ansi mode. This function should not translate to Unicode ?Chacal.GO wrote:Why are you using hb_translate ?
I made your sugestion. I saved portuguese.lng in UTF-8 format. But now is with another kind of error. Does not recognize "&"... see error:Just use sources and .lng files saved as Unicode...
Any modern editor support this feature...
Code: Select all
//
// HBMK2 file.prg -gtwin -gui
//
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_UTF8
PROCEDURE Main()
LOCAL cFile
LOCAL cText
/* Set language for Screen */
hb_langSelect( hb_UserLang(), "UTF8EX" )
hb_cdpSelect( "UTF8EX" )
/* Terminal and OS codepage */
// hb_SetTermCP( "UTF8EX" )
hb_SetTermCP( hb_cdpTerm() )
Set( _SET_OSCODEPAGE, hb_cdpOS() )
SETMODE( 62, 164 )
CLS
cFile := 'English.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"EN", "UTF8" ) )
cFile := 'French.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"FRISO", "UTF8" ) )
cFile := 'Italian.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"ITISO", "UTF8" ) )
cFile := 'Polish.lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"PLWIN", "UTF8" ) )
cFile := 'Portuguese.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"PTISO", "UTF8" ) )
cFile := 'Spanish.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"ESISO", "UTF8" ) )
cFile := 'Turkish.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"TRWIN", "UTF8" ) )
RETURN