kapiaba Posted February 12, 2015 Report Share Posted February 12, 2015 FWSetLanguage( nNewLanguage ) // Establece el lenguaje a mostrar en tiempo de ejecuión Alguém está usando? Ao tentar usar me retorna: Unresolved external '_HB_FUN_FWSETLANGUAGE' referenced from Que está faltando, ou é minha versão que não suporta? E em português, qual é o numero? Obg. abs. StephenEt 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 12, 2015 Author Report Share Posted February 12, 2015 É, acho que a minha versão não havia sido implementado ainda. #include "FiveWin.ch" #include "constant.ch" #include "xbrowse.ch" static nLanguage,cIniCalc static oDlgTest Function test() //Dialog Local nBottom := 16.5 Local nRight := 32 Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 ) Local nHeight := nBottom * DLG_CHARPIX_H Local oDlg cIniCalc := cFilePath( GetModuleFileName( GetInstance() ) ) + "Calc.ini" FWAddString( { "+Tax","+Tax", "+Tax", "+Tax", "+Tax", "+Iva" }) FWAddString( { "-Tax","-Tax", "-Tax", "-Tax", "-Tax", "-Iva" }) FWAddString( { "Show","", "", "", "", "Visualizza" }) FWAddString( { "Help","", "", "", "", "Aiuto" }) FWAddString( { "Ribbon","", "", "", "", "Nastro Operazioni" }) FWAddString( { "Options","", "", "", "", "Opzioni" }) FWAddString( { "Preferences","", "", "", "", "Preferenze" }) FWAddString( { "Authors","", "", "", "", "Autori" }) //FWEditStrings() trace to see there are the strings FWSetLanguage( 6 ) // Italian language SavePreferences() // save on ini file LoadPreferences() // read fron ini file DEFINE DIALOG oDlgTest SIZE nWidth, nHeight PIXEL ACTIVATE DIALOG oDlgTest CENTER; on INIt (Load_Buttons(oDlgTest), oDlgTest:SetMenu(BuildMenu() ) ) return nil Function Load_Buttons(oDlgTest) Local nlinea5:=10 Local ncol1:= 8.5 Local ncol5:= 30.5 Local n:= 0 Local oBIvap,oBRes @ n+nlinea5,ncol5 BUTTON oBRes PROMPT ("Change") OF oDlgTest ; SIZE 63,25 ; ACTION Preferences() @ n+ nlinea5,ncol1 BUTTON oBIvap PROMPT FWString( "+Iva" ) OF oDlgtest SIZE 45, 13 ACTION oDlgTest:End() return nil function LoadPreferences() GetIni( cIniCalc, "Lang", "Language", ) return nil function SavePreferences() DEFAULT nLanguage := FWSetLanguage() SetIni( cIniCalc, "Lang", "Language", nLanguage ) return nil //fron fwdbu source function Preferences() local oDlgPref DEFINE DIALOG oDlgPref TITLE FWString( "Preferences" ) SIZE 400, 300 @ 4.6, 1.5 SAY FWString( "Language" ) OF oDlgPref DEFAULT nLanguage := FWSetLanguage() @ 6, 1.2 COMBOBOX nLanguage ; ITEMS { FWString( "English" ), FWString( "Spanish" ), FWString( "French" ),; FWString( "Portuguese" ), FWString( "German" ) , FWString( "Italian" ) } ; OF oDlgPref SIZE 180, 150 ; ON CHANGE ( FWSetLanguage( nLanguage ), oDlgtest:SetMenu( BuildMenu() ) ) @ 7, 7 BUTTON FWString( "&Ok" ) OF oDlgPref SIZE 45, 13 ; ACTION ( SavePreferences(), oDlgPref:End() ) @ 7, 18 BUTTON FWString( "&Cancel" ) OF oDlgPref SIZE 45, 13 ACTION oDlgPref:End() ACTIVATE DIALOG oDlgPref CENTERED return nil Function BuildMenu() Local oMenu MENU oMenu MENUITEM fwstring("Visualizza") MENU MENUITEM fwstring("Nastro Operazioni") ACTION NIL ENDMENU MENUITEM "&?" MENU MENUITEM fwstring("Aiuto") ACTION HelpIndex() SEPARATOR MENUITEM fwstring("Opzioni") ACTION NIL MENUITEM fwstring("Preferenze") Action NIL SEPARATOR MENUITEM fwstring("Autori") ACTION NIL ENDMENU ENDMENU RETURN (oMenu) STATIC FUNCTION SetIni( cIni, cSection, cEntry, xVar ) LOCAL oIni // DEFAULT cIni := oApp:cIniFile INI oIni FILE cIni SET SECTION cSection ; ENTRY cEntry ; TO xVar ; OF oIni ENDINI RETURN nil //------------------------------------------------------------------// STATIC FUNCTION GetIni( cIni, cSection, cEntry, xDefault ) LOCAL oIni LOCAL xVar := xDefault //DEFAULT cIni := oApp:cIniFile INI oIni FILE cIni GET xVar ; SECTION cSection ; ENTRY cEntry ; DEFAULT xDefault ; OF oIni ENDINI RETURN xVar Quote Link to comment Share on other sites More sharing options...
rochinha Posted February 13, 2015 Report Share Posted February 13, 2015 Amiguinhos, Recurso interessante e neste caso seria necessário um único .PRG contendo string de mensagens e labels do aplicativo em várias linguas. Kapiaba O melhor ainda seria voce utilizar o salvamento de strings em .RC e uma .DLL para cada lingua. Um SET RECOURCES TO ... resolveria em tempo de execução. Dentro de seu aplicativo voce não mais colocaria strings de mensagens e labels o que economizaria na compilação. Cada string teria um identificador unico que poderia se referir a variavel unica contendo a string internacionalizada. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 13, 2015 Author Report Share Posted February 13, 2015 Que azar, por um mês... kkkkkkkkkkkkkkkkkkkkk mifu!! João, It was implemented in FWH 13.07 regards, saludos Antonio Linares www.fivetechsoft.com Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.