[Gambas-user] Translate user interface

wig wig at ...1809...
Mon Jun 30 10:09:29 CEST 2014


> Hello
>
> I'm use Gambas in english, no problem ... but in  Brazil any users ask me
> how to translate the Gambas Interface to portuguese, It's incredible my
> dear, but I don't know how can I do this.
> If you have a little time to help me, please  .... send me a little
> tutorial. And I put the instructions in our site.
>
> Thanks for all
>
> Thomé
> www.brgambas.com
>

Deyson Thome:

As the Gambas interface is written in Gambas itself, translate just like
any Gambas project:

- check project properties, Options: Project is translatable: YES
(keep default language as is)
- ps: in a new project you would tick the option "Internationalisation" to
get translatable activated.

- Menu Project, Translate (flags icon) gives Project translation screen.
- In the left column you see the existing language.  Choose "New" button,
that gives you a list of languages, choose e.g. Portuguese (Brazil).
- You see the list of untranslated texts, choose one.
- You see the lower empty box without title or tooltip; put the
translation there.  Save often.
- to check the translation to work, run the project on a
Portuguese-installed desktop.  Gambas uses the language of the
environment.  To see yours, in the Gambas console, type

? system.language

gives me:
en_US.UTF-8

- For your own projects, you can let the user select the language, and
keep it in a setting, eg "General/Language".  At start of your app, call
it with
System.Language = Settings["General/Language"]

It will only be active for the windows (form) opened afterwards, so you
might want to call it before any forms are opened.  I use MMain as startup
class, do initialisations, then call FMain from there.

As far as I know, the translations themselves are stored as *.po and/or
*.mo files in the .lang directory (at least in gb2).


success,
WiG






More information about the User mailing list