No logro que Edit salga en lenguaje Español...

HMG en Español

Moderator: Rathinagiri

Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

No logro que Edit salga en lenguaje Español...

Post by Leopoldo Blancas »

Hola a todos...

En el ejemplo que viene Edit.1 no logro que salgan los captiòn de los botones en Español... alguna posible soluciòn?

Gracias
Polo
*------------------------------------------------------------------------------------------------------------------------------------
Hi all ...

The example that comes Edit.1 can not get out the caption of the buttons in Spanish ... any possible solution?

thanks
Polo
#include "hmg.ch"

function Main()

SET EXCLUSIVE OFF // Inactivar para poder Abrir sahred New
*SET LANGUAGE TO ENGLISH
*SET CODEPAGE TO ENGLISH
SET LANGUAGE TO SPANISH
SET CODEPAGE TO SPANISH

REQUEST DBFCDX , DBFFPT

DEFINE WINDOW Win_1 ;
AT 0,0 ;
WIDTH 640 ;
HEIGHT 480 ;
TITLE "EDIT Command Demo" ;
MAIN ;
ON INIT OpenTable() ;
ON RELEASE Closetable() ;
BACKCOLOR GRAY

DEFINE MAIN MENU OF Win_1
POPUP "&File"
ITEM "&Simple Edit test" ACTION EDIT WORKAREA CLIENTES
SEPARATOR
ITEM "E&xit" ACTION Win_1.Release
END POPUP
END MENU

END WINDOW

MAXIMIZE WINDOW Win_1
ACTIVATE WINDOW Win_1

Return Nil

/*-----------------------------------------------------------------------------*/
Procedure OpenTable()

USE CLIENTES VIA "DBFCDX" INDEX CLIENTES NEW

Return Nil
/*-----------------------------------------------------------------------------*/
Procedure CloseTable()

CLOSE CLIENTES

Return Nil
/*-----------------------------------------------------------------------------*/
User avatar
srvet_claudio
Posts: 2223
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: No logro que Edit salga en lenguaje Español...

Post by srvet_claudio »

Parecería ser un bug de Harbour.

Code: Select all

SET LANGUAGE TO SPANISH
MsgInfo (Set(_SET_LANGUAGE))
debería retornar "ES" pero retorna "es.DE850"

Code: Select all

SET LANGUAGE TO FRENCH
MsgInfo (Set(_SET_LANGUAGE))
debería retornar "FR" pero retorna "fr.DE850"

Code: Select all

SET LANGUAGE TO GERMAN
MsgInfo (Set(_SET_LANGUAGE))
debería retornar "DE" pero retorna "de.DEWIN", ......

Mañana creo un patch para contornear este bug (actualmente son las 3:02 a.m. en Uruguay).
Saludos,
Claudio.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: No logro que Edit salga en lenguaje Español...

Post by Leopoldo Blancas »

Gracias por la atenciòn recibida...
Gracias Claudio
0:32 México
Polo
User avatar
IMATECH
Posts: 188
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Re: No logro que Edit salga en lenguaje Español...

Post by IMATECH »

Hi Claudio !


No any bug on Harbour, look at sugested fix below:

viewtopic.php?p=21549&f=2#p21549

*** PORTUGUESE fixed 6 months ago - hmg 3.0.44 :)



Regards
M., Ronaldo

By: IMATECH

Imation Tecnologia
User avatar
danielmaximiliano
Posts: 2646
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: No logro que Edit salga en lenguaje Español...

Post by danielmaximiliano »

IMATECH wrote:Hi Claudio !


No any bug on Harbour, look at sugested fix below:

viewtopic.php?p=21549&f=2#p21549

*** PORTUGUESE fixed 6 months ago - hmg 3.0.44 :)



Regards
Como siempre gracias, habia olvidado ese topico
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
srvet_claudio
Posts: 2223
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: No logro que Edit salga en lenguaje Español...

Post by srvet_claudio »

IMATECH wrote: No any bug on Harbour, look at sugested fix below:

viewtopic.php?p=21549&f=2#p21549
Thanks Ronaldo.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: No logro que Edit salga en lenguaje Español...

Post by Leopoldo Blancas »

Hola a todos...

Ya realice todo lo que dijo nuestro amigo Ronaldo.. y si cuando se hace:

Code: Select all

#include "hmg.ch"
#include "i_lang.ch"

function Main()
Local cLang

   SET EXCLUSIVE OFF           // Inactivar para poder Abrir sahred New
   *SET LANGUAGE TO ENGLISH 
   *SET CODEPAGE TO ENGLISH 
   SET LANGUAGE TO SPANISH
   SET CODEPAGE TO SPANISH
   Set ( _SET_LANGUAGE )
   cLang := hb_langname()
   MsgBox(cLang)
El mensaje sale:

Pero el Edit.1 sigue saliendo en Ingles :cry:
Saludos
Polo

*------------------------------------------------------------------------------------------------------------------------------------------

Hi all ...

We do everything in our friend said Ronaldo .. and if when you:

Code: Select all

# include "hmg.ch"
# include "i_lang.ch"

function Main ()
Local clang

    SET EXCLUSIVE OFF / / Inactivate sahred to Open New
    * SET LANGUAGE TO ENGLISH
    * SET CODEPAGE TO ENGLISH
    SPANISH LANGUAGE SET TO
    SPANISH TO SET CODEPAGE
    Set (_SET_LANGUAGE)
    Clang: = hb_langname ()
    MsgBox (Clang)
[/ code]

The message goes:

But Edit.1 keeps coming in English :cry:

Polo
Attachments
Mensaje.png
Mensaje.png (16.96 KiB) Viewed 4600 times
User avatar
srvet_claudio
Posts: 2223
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: No logro que Edit salga en lenguaje Español...

Post by srvet_claudio »

Hola Polo.
Hay que actualizar además las sentencias case cLang == xxx en la funcion InitMessages() (h_ini.prg).
Saludos,
Claudio.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: No logro que Edit salga en lenguaje Español...

Post by Leopoldo Blancas »

Hola Claudio...

No logro hacer este ejemplo... ya encontre el archivo C:/hmg.3.1.1/SOURCE/INI/h_ini.prg y no encuentro la función InitMessages() para modificar los case cLang == xxx o es en otro archivo?
Saludos
Polo

*--------------------------------------------------------------------------------------------------------------------------------------------
Hello Claudio ...

I can not do this example ... and found the file C :/ hmg.3.1.1/SOURCE/INI/h_ini.prg and can not find the InitMessages () [/ b] to modify the == clang case xxx [/ b] or is in another file?
regards
Polo


Code: Select all

/*----------------------------------------------------------------------------

 * INI Files support procedures

 * (c) 2003 Grigory Filatov
 * (c) 2003 Janusz Pora

 This program is free software; you can redistribute it and/or modify it under 
 the terms of the GNU General Public License as published by the Free Software 
 Foundation; either version 2 of the License, or (at your option) any later 
 version. 

 This program is distributed in the hope that it will be useful, but WITHOUT 
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

 You should have received a copy of the GNU General Public License along with 
 this software; see the file COPYING. If not, write to the Free Software 
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (or 
 visit the web site http://www.gnu.org/).

 As a special exception, you have permission for additional uses of the text 
 contained in this file.

 The exception is that, if you link this code with other 
 files to produce an executable, this does not by itself cause the resulting 
 executable to be covered by the GNU General Public License.
 Your use of that executable is in no way restricted on account of linking  
 this code into it.

*/
MEMVAR _HMG_SYSDATA
#include 'hmg.ch'
#include 'common.ch'
#include 'fileio.ch'

*-------------------------------------------------------------
FUNCTION BeginIni(name, cIniFile )
*-------------------------------------------------------------
	LOCAL hFile

	* Unused Parameter
	name := Nil
	*

	if AT("\",cIniFile)==0
	    cIniFile := ".\"+cIniFile
	endif

	 If ! File( cIniFile )
	    hFile := FCreate( cIniFile )
	 Else
	    hFile := FOpen( cIniFile, FO_READ + FO_SHARED )
	 EndIf

	 If FError() != 0
	    MsgInfo( "Error opening a file INI. DOS ERROR: " + Str( FError(), 2, 0 ) )
	    Return ""
	 else
	    _HMG_SYSDATA [ 219 ] := cIniFile
	 EndIf

	 FClose( hFile )
Return Nil


// Code GetIni and SetIni based on sorce of Grigory Filatov

Function _GetIni( cSection, cEntry, cDefault, uVar )
    Local cFile, cVar :=''
 
    If !empty(_HMG_SYSDATA [ 219 ])
      if valtype(cDefault) == 'U'
        cDefault:=cVar
      endif
      cFile:=_HMG_SYSDATA [ 219 ]
      cVar := GetPrivateProfileString(cSection, cEntry, xChar( cDefault ), cFile )
    else
      if cDefault != NIL 
          cVar := xChar( cDefault )
      endif 
    endif  
    uVar :=xValue(cVar,ValType( uVar))
Return uVar

Function _SetIni( cSection, cEntry, cValue )
    Local ret:=.f., cFile
    If !empty(_HMG_SYSDATA [ 219 ])
        cFile:= _HMG_SYSDATA [ 219 ]
        ret :=WritePrivateProfileString( cSection, cEntry, xChar(cValue), cFile )
    endif 
Return ret

Function  _DelIniEntry( cSection, cEntry )
    Local ret:=.f., cFile
    If !empty(_HMG_SYSDATA [ 219 ])
        cFile:= _HMG_SYSDATA [ 219 ]
        ret := DelIniEntry( cSection, cEntry, cFile )
    endif 
Return ret

Function  _DelIniSection( cSection )
    Local ret:=.f., cFile
    If !empty(_HMG_SYSDATA [ 219 ])
        cFile:= _HMG_SYSDATA [ 219 ]
        ret := DelIniSection( cSection, cFile )
    endif 
Return ret

*-------------------------------------------------------------
Function _EndIni()
*-------------------------------------------------------------
	_HMG_SYSDATA [ 219 ] :=''
Return Nil



FUNCTION xChar( xValue )
   LOCAL cType := ValType( xValue )
   LOCAL cValue := "", nDecimals := Set( _SET_DECIMALS)
   DO CASE
      CASE cType $  "CM";  cValue := xValue
      CASE cType == "N" ;  cValue := LTrim( Str( xValue, 20, nDecimals ) )
      CASE cType == "D" ;  cValue := DToS( xValue )
      CASE cType == "L" ;  cValue := IIf( xValue, "T", "F" )
      CASE cType == "A" ;  cValue := AToC( xValue )
      CASE cType $  "UE";  cValue := "NIL"
      CASE cType == "B" ;  cValue := "{|| ... }"
      CASE cType == "O";   cValue := "{" + xValue:className + "}"
   ENDCASE
RETURN cValue

FUNCTION xValue( cValue, cType )
   LOCAL xValue
   DO CASE
      CASE cType $  "CM";  xValue := cValue
      CASE cType == "D" ;  xValue := SToD( cValue )
      CASE cType == "N" ;  xValue := Val( cValue )
      CASE cType == "L" ;  xValue := ( cValue == 'T' )
      CASE cType == "A" ;  xValue := CToA( cValue )
      OTHERWISE;           xValue := NIL                     // nil, block, object
   ENDCASE
RETURN xValue


FUNCTION AToC( aArray )
   LOCAL i, nLen := Len( aArray )
   LOCAL cType, cElement, cArray := ""
   FOR i := 1 TO nLen
      cElement := xChar( aArray[ i ] )
      IF ( cType := ValType( aArray[ i ] ) ) == "A"
         cArray += cElement
      ELSE
         cArray += Left( cType, 1) + str( Len( cElement ),4 ) + cElement
      ENDIF
   ENDFOR
RETURN "A" + str( Len( cArray ),4 ) + cArray

FUNCTION CToA( cArray )
   LOCAL cType, nLen, aArray := {}
   cArray := SubStr( cArray, 6 )    // strip off array and length
   WHILE Len( cArray ) > 0
      nLen := Val( SubStr( cArray, 2, 4 ) )
      IF ( cType := Left( cArray, 1 ) ) == "A"
         AAdd( aArray, CToA( SubStr( cArray, 1, nLen + 5 ) ) )
      ELSE
         AAdd( aArray, xValue( SubStr( cArray, 6, nLen ), cType ) )
      ENDIF
      cArray := SubStr( cArray, 6 + nLen )
   END
RETURN aArray

User avatar
srvet_claudio
Posts: 2223
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: No logro que Edit salga en lenguaje Español...

Post by srvet_claudio »

Hi Polo.

The file is: C:\hmg.3.1.1\SOURCE\h_init.prg (line 692).

Best regards,
Claudio.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Post Reply