On Thu, 16 Oct 2003 09:35:21 +0200, "Henk ten Bos"
<he******@xs4all.nl> wrote:
ok, thanks. I looked at this solution, but "hoped" that there was a more
simple one (like include-files). To add and maintain the strings with
resource files is a bit tedious.
There are several ways of skinning this cat
One that has worked well for me is to have a sort of INI file for each
language that contains a 'Lexicon'
Command1.Caption = Lex( "Click Here" )
Lex() is a function that looks for :-
Click Here=Druck Hier
If it does *not* find the English then it adds the English to the Lex
file and returns ... the English
If it is there then it returns the 'other language'
I also provided an editor, so users could do their own translation
If you do not fancy having files hanging around, then I guess you
could append the data to the EXE - or use Resource Strings for release
- in which case you just have one string to read
Another alternative is to write a small App to tinker with the
contents of your .VBP file
Yet another is to have ALL the files in your App but to use
Conditional Compilation eg:
#Const Flag = False
Private Sub Command1_Click()
#If Flag Then
Me.Print "Hullo"
#Else
Me.Print "No Way"
#End If
End Sub
Personally I am not that keen on Conditional Compilation.
Yet another way is to have (say) two Classes that contain the data
Dim L as cLex
Select Case Language
Case enEnglish : Set L = New clexEnglish
Case enGerman : Set L = New clexGerman
....
End Select
Command1.Caption = L.Click_Me
For this you will need to look at the 'Implements' key word
Personally I would go for the Lexicon in a file approach, as I prefer
to be able to read my own code
- and the 'file' can be stored in the EXE for release versions