[Gambas-user] String Translate
Benoît Minisini
gambas at ...1...
Tue Jul 6 19:06:15 CEST 2010
> Hi.
>
> I wonder if it is possible to translate strings enclosed in a module,
> which will be used in two different forms. The point is:
>
> 1. Creation of two forms (Form1 and FMain).
>
> 2. Creating a button on each form.
>
> 3. Creation of a string constant in a module (Module1).
>
> 4. Constant translation into English.
>
> All this in my code looks like this:
>
> 'Code in FMain
>
> PUBLIC SUB Form_Open()
>
> System.Language = "en_US.UTF-8"
> Button1.Caption = texto
>
> END
>
> 'Code in Form1
>
> PUBLIC SUB Form_Open()
>
> Button1.Caption = FMain.texto
>
> END
>
> 'Code in Module1
>
> PUBLIC CONST texto AS String = ("Añadir")
>
>
>
> Is there any way to translate strings that are stored in a module, this
> with the reason of not having to repeat each string on each form.
>
> Regards.
You can do that, of course, but what for? The same string used multiple times
in different classes/modules/forms... will be translated once in the
translation dialog.
--
Benoît Minisini
More information about the User
mailing list