[Gambas-user] Applying translation to a running application

Charlie Reinl Karl.Reinl at ...9...
Tue Sep 23 21:18:22 CEST 2008


Am Dienstag, den 23.09.2008, 12:43 -0500 schrieb M0E Lnx:
> Can anyone think of a way to apply a translation to an application
> that's already running?
> 
> An example would be a wizard that starts out in English, and at the
> first step offers the user to choose their language.
> After the user selects his/her language, the rest of the application
> get translated to the selected language.
> 
> I'm not talking about creating the translations... I already know how
> to do that... This is assuming there is a translated version for the
> listed languages.
> 
> Anybody?
> 
Salut,

one way is, all text to show, is stored in a Databasetable, only the
text which is used before the DB is connected,is burned in, and in
english.

Here a simple form of that Table:
	lang		is GB,FR,DE or so
	token		is an unique token-key
	text		is the text in the language, fix by lang 

So in Form_Open or so you m ake :

PUBLIC SUB Form_Open()
DIM rTest AS Result
rTest = meConn.Handle.Find("tblLang", "token = &1 and lang = &2",
"Label1",myLang)
        Label1.Text = rTest!Text
rTest = meConn.Handle.Find("tblLang", "token = &1 and lang = &2",
"Label2",myLang)
        Label2.Text = rTest!Text
...... and so on .....
END

 Do not forget all other texts use in messages, printouts and so on.
-- 
Amicalment
Charlie





More information about the User mailing list