[Gambas-user] Translating application
Rob Kudla
sourceforge-raindog2 at ...94...
Tue Apr 25 18:11:52 CEST 2006
On Tue April 25 2006 11:28, Leonardo Miliani wrote:
> I would like to follow a more professional way, getting the
> user the ability to choose the interface language using the
> program menu (i.e., Tools/Language and then English/Italian)
> and having the interface language translated "on the run".
> How can I get this?
This is actually a less professional way (reminds me of video
games and early Windows 3.x software, before setting the
language in the operating system was common.)
Nonetheless, the way to do what you want is the same way we did
it back in the early 90's.... put placeholder text in all your
controls (for example, the name of the control or a shortened
version of the text to be displayed) and loop through them
replacing the placeholder with the language-appropriate string
when you display each form or change the setting. You can store
the strings in an ini file or database or whatever you like.
You'll probably want to mark the project as "not translatable" to
avoid any fights between your app and Gambas' own translation
support.... and since, after all, it won't be translatable in
any standard way.
Rob
More information about the User
mailing list