[Gambas-user] Project language is always en_US

Martin mbelmonte at belmotek.net
Fri Oct 7 17:39:17 CEST 2022


El 7/10/22 a las 11:39, bb escribió:
> I had to resort to setting
> all the LC variables known on this planet (and others) to make it aware
> that I was in AU and NOT USA!

what is G*dAwf&l?

Are you talking about having to change the Linux desktop configuration? 
If so, which one exactly?
You know you can use the locale command right?

in the gambas code, searching with grep where the word en_US exists I 
found that the file gbx_local.c has a function that searches in the 
local configuration for the system language but as it does not find it, 
it puts en_US.

In my case that I use a GTK desktop (Manjaro XFCE) the locale command 
does not return parameter in the ALL= key (which is what gbx_local.c 
looks for).
Maybe changing a little bit this C function can correct the issue.

const char *LOCAL_get_lang(void)
{
	char *lang;

	if (!_lang)
	{
		lang = getenv("LC_ALL"); */Here maybe use lang = getenv("LANG")/*
		if (!lang)
			lang = getenv("LANG");
		if (!lang || !*lang)
			lang = "en_US";
		_lang = STRING_new_zero(lang);
	}

	return _lang;
}

This is my system locale configuration
LANG=es_ES.utf8
LC_CTYPE="es_ES.utf8"
LC_NUMERIC=es_ES.UTF-8
LC_TIME=es_ES.UTF-8
LC_COLLATE="es_ES.utf8"
LC_MONETARY=es_ES.UTF-8
LC_MESSAGES="es_ES.utf8"
LC_PAPER=es_ES.UTF-8
LC_NAME=es_ES.UTF-8
LC_ADDRESS=es_ES.UTF-8
LC_TELEPHONE=es_ES.UTF-8
LC_MEASUREMENT=es_ES.UTF-8
LC_IDENTIFICATION=es_ES.UTF-8
LC_ALL=



More information about the User mailing list