Ithinked to create the possibility to have a file type Lang.lng and insert on this all texts
sample :
- Code: Select all Expand view
[Lang]
1=Attention |Atención|Attention|Atenção|Achtung |Attenzione
2=PDF Plugin Error|Error del plugin de PDF|Erreur de plugin du PDF|Erro do plugin do PDF|PDF Plugin Fehler|Errore del plug PDF
3=PDF not saved to send Email|No se ha guardado el PDF a enviar por Email|PDF Non enregistré pour envoi Email|PDF não foi salvo para mandar por email|PDF nicht gespeichert. um E-Mail zu senden|PDF non salvato per inviare e-mail
and then I made this function to load astrings from lang.lng
- Code: Select all Expand view
- #INCLUDE "FiveWin.ch"
#INCLUDE "Xbrowse.ch"
Function test()
Local cIni:=cFilePath(GetModuleFileName( GetInstance() ) ) + "lang.lng"
LOCAL cString :=""
LOCAL aStrings := {}
LOCAL i := 1
LOCAL lContinue := .T.
DO WHILE lContinue = .T.
cString := GetIni( cIni, "LANG", ALLTRIM(STR(i++,4)), "" )
IF .NOT. EMPTY( cString )
AADD( aStrings, { ALLTRIM( StrToken( cString, 1, "|" ) ), ;
ALLTRIM( StrToken( cString, 2, "|" ) ), ;
ALLTRIM( StrToken( cString, 3, "|" ) ), ;
ALLTRIM( StrToken( cString, 4, "|" ) ), ;
ALLTRIM( StrToken( cString, 5, "|" ) ), ;
ALLTRIM( StrToken( cString, 6, "|" ) ) } )
ELSE
lContinue := .F.
ENDIF
ENDDO
IF LEN( aStrings ) = 0
MsgStop( "No languages defined in " + ALLTRIM( cIni ) )
RETURN(.F.)
ELSE
//only for trace
xbrowser aStrings
ENDIF
RETURN (.T.)
//-----------------------------------------------------------------------//
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
then we can have a file into application folder and modify it with a xbrowse
What Do you think about ?