Environment
Posted
#1
(In Topic #1802)
Expert

When are the environment variables loaded?
Hello, I have created a small project and translated it.If I now want to test this translation on my system, I use the console and temporarily change the LANG variable there.
For example:
LANG=de_DE.UTF-8
and then start the Gambas interpreter gbx3.
This works fine, and the German translation of the program is displayed.
However, there is now the option to set the environment under the project properties.
If I set the LANG variable here, it has no effect in the IDE, nor when creating an executable file.
So what is the function of the environment variables that I can set here?
And if I set the default language to German in the options, for example, I don't see any effect either, even though I created this language in the translation.
On the other hand, an other system with the locale set to German displays the correct language.
For me, this is yet another little mystery that once again highlights my lack of knowledge.
Last edit: by Poly
Posted
Administrator

1. I suppose your system has English as locale for you having to do abovePoly said
Hello, I have created a small project and translated it.
If I now want to test this translation on my system, I use the console and temporarily change the LANG variable there.
For example:
LANG=de_DE.UTF-8
and then start the Gambas interpreter gbx3.
This works fine, and the German translation of the program is displayed.
From “Environment ”, October 3rd 2025, 8:24 PM
2. An application will run it in language set in locale, if it has the translations available. So, if you create a distribution package of the application it will show English (I presume you used that as default on your controls) on all systems, except for those having German as language in locale. That is the intended use. The more translations your application has the less it will have to default to English. Simple as that.
No idea, I never messed with languages is this manner in the environmentPoly said
However, there is now the option to set the environment under the project properties.
If I set the LANG variable here, it has no effect in the IDE, nor when creating an executable file.
So what is the function of the environment variables that I can set here?
From “Environment ”, October 3rd 2025, 8:24 PM
Could it be your locale setting simply overrules LANG settings here? I don't know what happens under the hood exactly
The default language in the project properties you mean or what?Poly said
And if I set the default language to German in the options, for example, I don't see any effect either, even though I created this language in the translation.
On the other hand, an other system with the locale set to German displays the correct language.
For me, this is yet another little mystery that once again highlights my lack of knowledge.
From “Environment ”, October 3rd 2025, 8:24 PM
Here you indicate that you have used German on your controls. So, everything, without even a translation provided is default shown in German. Next you would have to add English translations to see English on systems with locale English
So, your application will ALWAYS show German if no English locale because you indicated German is the default language used on controls. Now if you used English on the controls, but set default to German, you are simply messing it up
I think you did use English on your controls, since you said you made a German translation. So, the default language you set thereis the default language used during desing that needs NO translation.
I would advise to use English as default language on your controls, like I do, because more people know English. Add German (or Dutch in my case) as translation, so persons on a German system will get German, all others will default to English (hence using no translation).
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Expert

but somehow the meaning of the IDE's functions is still not entirely clear to me.
I am referring to the function
Properties → Environment.
Here I set the environment variable LANG, exactly as I do in Bash .
LANG = de_DE.UTF-8
However, I read in the documentation that only de_DE is read and the rest is ignored.
So I also tried LANG = de_DE
I thought that setting the environment variable was the same as changing the environment variable in the console and then calling the interpreter (gbx3).
That is not the case.
I would have at least expected the variable set in the IDE to be used when creating an executable file or an installation package.
However, this is not the case.
As a result, I am unclear about the significance of this option, i.e., setting environment variables in the IDE.
As you correctly guessed, I use GambOS with a US localization by default.
However, I have also installed the German locale.
My program is written in English/American by default, including the labels on the controls.
However, I have written a German translation of all terms.
I had expected that if I set “German” as the default language under "Properties → Options", the German translation of the program would be displayed when I launched the program.
But that is not the case either.
So, to test my German file under GambOS, I can only do it via the Bash by entering
LANG=de_DE.UTF-8 and then gbr3.
That's OK, after all, I can test my translation that way, but the meaning of this function in the Properties is still completely unclear to me.
It is true that on a Devuan system with German as the default language, I also get the German translation when starting normally. Of course, this makes sense, but then I honestly don't see the benefit of these setting options via the Properties.
P.S.: Maybe this isn't a general Gambas problem after all, but rather fits into the “Beginners' questions” category. If so, please move it.
Thank you very much.
Posted
Administrator

I understood what you where trying to do and kind of expected what you expected.Poly said
Thank you for your explanation,
but somehow the meaning of the IDE's functions is still not entirely clear to me.
I am referring to the function
Properties → Environment.
Here I set the environment variable LANG, exactly as I do in Bash .
LANG = de_DE.UTF-8
However, I read in the documentation that only de_DE is read and the rest is ignored.
So I also tried LANG = de_DE
I thought that setting the environment variable was the same as changing the environment variable in the console and then calling the interpreter (gbx3).
That is not the case.
I would have at least expected the variable set in the IDE to be used when creating an executable file or an installation package.
However, this is not the case.
As a result, I am unclear about the significance of this option, i.e., setting environment variables in the IDE.
From “Post #12,308”, October 4th 2025, 6:05 PM
As I said, I never used environment in any of my applications, so never really looked at it.
Poly said
As you correctly guessed, I use GambOS with a US localization by default.
However, I have also installed the German locale.
My program is written in English/American by default, including the labels on the controls.
….
From “Post #12,308”, October 4th 2025, 6:05 PM
That was no guess, you gave the right clues
And yes labels and all are English, so you set properties to Default English indicating that is the languages that is used ON the controls, lables etc and thus has NO translation file, since it don't need one.
You very much misunderstand this, it has NOTHING to do with language shown when run, that is determines by locale ONLY.
For German you have created a translation, so a translation file does exist. This will be ONLY used if the locale of the system it is run on is set to German (meaning all the rest, like system menu's etc will be in German)
When multiple languages the default system language will be used, so not German in your case, as I asume all you menu's and all is English while trying to see your German translation. You understand why that won't work
You can reset that order and then your whole environment is German, the IDE will be in German and your executable should run German without needing the environment set. Understand?
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Expert

I think I'm slowly beginning to understand. Thank you very much.When multiple languages the default system language will be used, so not German in your case, as I asume all you menu's and all is English while trying to see your German translation. You understand why that won't work <img alt="" class="top_vertical_alignment" src="https://gambas.one/themes/default/images/cns_emoticons/wink.png" title="" /><br />
You can reset that order and then your whole environment is German, the IDE will be in German and your executable should run German without needing the environment set. Understand?<br />
So I had more of an idealized idea of how it works, but this has not yet been implemented.
OK, that's a pity.
Posted
Administrator

I use a VM with Dutch running for my translations. Just as easy.
But what you do works just as well.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Administrator

You then would need to provide a English translation to get English on systems with locale English, all other systems would get German as default
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Administrator

Next do translations in the desired languages, so if no translation for a language available it will default to English (as that is ON the controls and needs NO translation file)
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Expert

gbWilly said
You would set Properties to Default German if you used German on the actual controls.
You then would need to provide a English translation to get English on systems with locale English, all other systems would get German as default
From “Post #12,312”, October 4th 2025, 6:49 PM
O.K, jetzt habe ich es komplett verstanden.
Ganz lieben Dank, ich hatte da wirklich komplett falsch gedacht.
Posted
Administrator

There is NO not yet implemented, this is ITPoly said
So I had more of an idealized idea of how it works, but this has not yet been implemented.
OK, that's a pity.![]()
From “Post #12,310”, October 4th 2025, 6:46 PM
Translation just follows the standards used on Linux. A language will only be shown if:
A. system is set to that language and
B. a translation file is available in that language.
This standard is followed by all applications you see running on a Linux system, not just Gambas.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Expert

Yes, that makes perfect sense.gbWilly said
Next do translations in the desired languages, so if no translation for a language available it will default to English (as that is ON the controls and needs NO translation file)
From “Post #12,313”, October 4th 2025, 6:52 PM
Thank you very much for this tip.
I will always do it this way in the future.
Posted
Administrator

Poly said
gbWilly said
You would set Properties to Default German if you used German on the actual controls.
You then would need to provide a English translation to get English on systems with locale English, all other systems would get German as default
From “Post #12,312”, October 4th 2025, 6:49 PM
O.K, jetzt habe ich es komplett verstanden.![]()
Ganz lieben Dank, ich hatte da wirklich komplett falsch gedacht.
From “Post #12,314”, October 4th 2025, 6:55 PM
I knew if I would turn things around your German mind would understand it better
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Expert

Now I feel caught out.gbWilly said
This standard is followed by all applications you see running on a Linux system, not just Gambas.
From “Post #12,315”, October 4th 2025, 6:58 PM
But well, I've learned something for eternity again.
Posted
Expert

But I just had a lightbulb moment in the brain, so there was no room left for the translation.
Posted
Administrator

Poly said
Now I feel caught out.gbWilly said
This standard is followed by all applications you see running on a Linux system, not just Gambas.
From “Post #12,315”, October 4th 2025, 6:58 PM
But well, I've learned something for eternity again.
From “Post #12,318”, October 4th 2025, 7:03 PM
You haven't noticed in the guides that there are ways of doing things on Linux I point out in intremezzo's and yellow boxes?
You think Linux would not have a standard of providing itself is many many many languages worldwide?
I try to point these things out in the guides when they start making sense because you need to use them.
It's the 'under the hood' stuff…
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Administrator

Gambas IDE depends on GNU gettext for a reason.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
1 guest and 0 members have just viewed this.


