[Gambas-user] How to write a multilingual application
M. Cs.
mohareve at ...626...
Wed Mar 11 14:39:59 CET 2009
For instant language switching I found a better solution:
System.Language=...
FMain.Delete()
FMain.Raise()
This works fine.
Still, even if I've updated it to version 2.11, which is the most recent
version for Mandriva,
I can't use this in the .rpm package. The installed version doesn't know
what to do.
The code, which works at testing but not as installed from an .rpm :
PUBLIC SUB FirstRun()
DIM trans AS String[]
DIM i AS Integer
DIM x AS String
trans = Dir(".lang")
FOR i = 0 TO trans.Length - 1
IF ((Len(trans[i]) = 5) AND (InStr(trans[i], ".mo") = 0)) THEN // *I need
to clean the list from other files contained in the .lang folder*
x = Mid$(trans[i], 1, 2)
langBox.Add(x)
ENDIF
NEXT
END
PUBLIC SUB langBox_Click()
DIM ezt AS String
DIM what AS Integer
ezt = langBox.Current.Text
what = Message.Question("Do you really want to switch the language to " &
Chr$(34) & ezt & Chr$(34) & " ?", "Yes", "No")
IF what = 1 THEN
System.Language = ezt & "_" & Upper$(ezt)
FMain.Delete()
FMain.Raise()
ENDIF
END
I don't know why. maybe there aren't .lang folder in compiled package?
Csaba
More information about the User
mailing list