FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour New FiveDBU using the strings API and the new preview
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: New FiveDBU using the strings API and the new preview

Posted: Sun Aug 25, 2013 10:30 AM

Cristobal,

Thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM

Re: New FiveDBU using the strings API and the new preview

Posted: Sun Aug 25, 2013 11:32 AM
Antonio

Aunque tambien habría que añadir esta modificacion:
(Hay que añadir estas cadenas que utilizas en el programa string.prg para que no entre en bucle infinito)

Although it also should add this modification:
(We should add these strings you use in the program string.prg so that no infinite loop)

Code (fw): Select all Collapse
static aStrings := { ;

   ---/---
   { "The string:", "La cadena:"},;                 // Se me habia olvidado copiarlo
   { "defined from: ", "definida en: " },;
   { "is not defined in FWH strings", ;
     "no esta incluida en el diccionario de cadenas de FWH"},;
   { "Please add it to FWH\source\function\strings.prg", ;
     "Por favor, añada esta cadena en FWH\source\function\strings.prg" } ;
  }


Aqui la funcion definitiva:

Here the final function:

Code (fw): Select all Collapse
function FWString( cString )

   local nAt

   if LanguageID() == 1
      return cString
   else
      if ( nAt := AScan( aStrings, { | aString | Upper( aString[ 1 ] ) == Upper( cString ) } ) ) != 0
         if Len( aStrings[ nAt ] ) >= LanguageID()
            return IfNil( aStrings[ nAt ][ LanguageID() ], cString )
         endif
      else
         if '&' $ cString
            cString  := StrTran( cString, '&', '' )
            if ( nAt := AScan( aStrings, { | aString | Upper( aString[ 1 ] ) == Upper( cString ) } ) ) != 0
               if Len( aStrings[ nAt ] ) >= LanguageID()               
                  return '&' + IfNil( aStrings[ nAt ][ LanguageID() ], cString )
               endif
            endif
         endif
      endif
      MsgInfo( FWString("The string:")+'"' + cString + '"' + CRLF + ;
               "defined from: " + ProcName( 1 ) + " line " + ;
               AllTrim( Str( ProcLine( 1 ) ) ) + " in " + ProcFile( 1 ) + CRLF + ;
               FWString("is not defined in FWH strings") + CRLF + ;
               FWString("Please add it to FWH\source\function\strings.prg") )
      AAdd( aMissing, cString )
   endif

return cString
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: New FiveDBU using the strings API and the new preview

Posted: Sun Aug 25, 2013 11:35 AM

Cristobal,

Ya había añadido esas dos cadenas, y tambien he modificado aqui para que indique el idioma en el que falla:

  MsgInfo( FWString( "The string" ) + ': "' + cString + '" ' + ;
           FWString( "for language" ) + " " + ;
           { "EN", "ES", "FR", "PT", "DE", "IT" }[ LanguageID() ] + CRLF + ;
           FWString( "defined from" ) + ": " + ProcName( 1 ) + " " + ;
           FWString( "line" ) + " " + ;
           AllTrim( Str( ProcLine( 1 ) ) ) + " in " + ProcFile( 1 ) + CRLF + ;
           FWString( "is not defined in FWH strings" ) + CRLF + ;
           FWString( "Please add it to FWH\source\function\strings.prg" ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion