Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No localization in Windows version #2831

Closed
Carmina16 opened this issue Jun 21, 2021 · 18 comments
Closed

No localization in Windows version #2831

Carmina16 opened this issue Jun 21, 2021 · 18 comments
Labels

Comments

@Carmina16
Copy link
Contributor

I've installed Geany, but it doesn't load the localization file unless I specify LANG env var. I have LANGUAGE variable defined, but it doesn't affect Geany unless LANG is also installed.

@elextr
Copy link
Member

elextr commented Jun 21, 2021

"LANG is the normal environment variable for specifying a locale." from

"GNU gettext gives preference to LANGUAGE over LC_ALL and LANG for the purpose of message handling, but you still need to have LANG (or LC_ALL) set to the primary language; this is required by other parts of the system libraries." from

@elextr
Copy link
Member

elextr commented Jun 21, 2021

Even more explicitly:

"Note: The variable LANGUAGE is ignored if the locale is set to ‘C’. In other words, you have to first enable localization, by setting LANG (or LC_ALL) to a value other than ‘C’, before you can use a language priority list through the LANGUAGE variable." also from the second link above.

@elextr elextr added the invalid label Jun 21, 2021
@elextr elextr closed this as completed Jun 21, 2021
@Carmina16
Copy link
Contributor Author

Windows doesn't use environmental variables to specify locales.

@elextr
Copy link
Member

elextr commented Jun 21, 2021

Windows itself may not use those variables, but the libraries that handle translation for Geany use environment variables as I linked above. If those libraries should use something else on windows you can suggest that to the libraries, but Geany is just a user, it has no control over the translation system.

You can set environment variables by searching for "edit environment variable" in the start menu.

@Carmina16
Copy link
Contributor Author

No, the locale support on Windows does not use environmental variables. If you use a C setlocale function on Windows, it obtains the values corresponding to the locale selected by user. Geany for some reason defaults to C.

@elextr
Copy link
Member

elextr commented Jun 22, 2021

To be clear, Geany does not set a locale or read Windows settings.

The locale support in in the POSIX C runtime library does, see here and Geany is a portable POSIX C application, not a windows only application. If neither LANG or LC_ALL are set the default is usually "C" or "POSIX" which is set by Windows explicitly in the Windows libraries, half way down this page it says:

At program startup, the equivalent of the following statement is executed:

setlocale( LC_ALL, "C" );

The use of environment variables happens within the POSIX C language libraries and is not under Geany's control. You could argue that the Windows POSIX C runtime should fall back to the Windows setting, not "C", since its allowed to be implementation defined. But you would have to take that up with Windows or the MSYS folks that provide the POSIX library Geany uses.

@elextr
Copy link
Member

elextr commented Jun 22, 2021

I might add, that since you have set LANGUAGE, just set LANG as well, thats the way it works and its unlikely to change.

@Carmina16
Copy link
Contributor Author

the default is usually "C" or "POSIX" which is set by Windows explicitly in the Windows libraries

Correct, so you call setlocale(LC_ALL,""); to select the default locale.

#1757, #1919 and some others show that Geany should select localization basing on Windows UI language (without fiddling with env variables). Now, it doesn't. So there something was broken along the way, and should be fixed.

@elextr
Copy link
Member

elextr commented Jun 22, 2021

AFAICT #1757 and #1919 all say "set LANG environment variable" with a plethora of suggestions about how to make it less intrusive to do so, but all basically setting those variables before running Geany. Nobody contributed a pull request with those convenience functions back to Geany though, so they don't get distributed.

Geany never followed the Windows IU language setting as far as I know, so it hasn't changed, nothing is broken.

@Carmina16
Copy link
Contributor Author

I can't find how to change the IDE language from Arabic to English, it selected depending my system (Windows here)

No LANG set, the UI is Arabic, not English.

08:12:31: Geany INFO : Geany 1.37, English_United States.1252
15:04:33: Geany INFO : Geany 1.37.1, German_Germany.1252

No LANG set, yet locale is detected and UI language selected appropriately.

It is clear that Geany used the user-selected locale in Windows, until somebody broke it. It is a bug and should be fixed.

@elextr
Copy link
Member

elextr commented Jun 22, 2021

It is clear that Geany used the user-selected locale in Windows, until somebody broke it. It is a bug and should be fixed.

No, as is noted #1919, if LANG is not set, GTK, the GUI library, seems to call setlocale(LC_ALL,""); and use the result to set its built-in elements to that. But that doesn't set the rest of the gettext() system as used by Geany because that was initialised before GTK got started. This resulted in a mixed UI as #1919 discusses. GTK shouldn't try to set locale over the top of the application and in fact GTK4 now provides a call to disable the offending GTK call to setlocale.

It is clear that Geany used the user-selected locale in Windows, until somebody broke it. It is a bug and should be fixed.

No, Geany never supported anything but the POSIX environment variables to set its locale. The fact that one of the libraries Geany uses tried to be smart if LANG is not set just shows again that you need to set it, and that was the fix to #1919.

Also note that just because somebody posted something on an issue comment doesn't make it correct, especially when the rest of the comments contradict it.

I can assure you Geany never intentionally followed the Windows locale settings, it has not "broken". In fact #1757 is still open for anyone to contribute better solutions, but other than convenience scripts to set LANG (as used on the OSX port) no solution has been proposed.

@Carmina16
Copy link
Contributor Author

Look at #2765. It is in German, not English. Geany clearly follows the Windows locale settings without any env variables.

@elextr
Copy link
Member

elextr commented Jun 22, 2021

Nothing on #2765 says it is following the Windows locale settings rather than the OP having set LANG

@Carmina16
Copy link
Contributor Author

Wrong. German_Germany.1252 which is seen in the log is a standard Windows locale set without LANG.

The application is in German in German Windows. It is English in my windows. That is a bug.

@elextr
Copy link
Member

elextr commented Jun 22, 2021

If you think something used to work and has been broken you should use git bisect to find when that happened and post a link to the commit.

@eht16
Copy link
Member

eht16 commented Jun 22, 2021

I can't find how to change the IDE language from Arabic to English, it selected depending my system (Windows here)

No LANG set, the UI is Arabic, not English.

08:12:31: Geany INFO : Geany 1.37, English_United States.1252
15:04:33: Geany INFO : Geany 1.37.1, German_Germany.1252

No LANG set, yet locale is detected and UI language selected appropriately.

It is clear that Geany used the user-selected locale in Windows, until somebody broke it. It is a bug and should be fixed.

I don't get what of the above information is from your system and what is copied from elsewhere or do you use German, English and Arabic at the same time?

Anyway, I probably cannot help much here as I don't have access to a Windows system currently. I also don't remember there were changes between 1.37 and 1.37.1 which could explain any language related changes.

Apart from the detail problem here, let's remember that this project is driven by volunteers and reporting a bug or missing feature is fine but demanding support or implementing all wishes is not possible. Especially support for the Windows operating system is difficult. None of the developers and regular contributors is using this operating system.
Furthermore, remember, Windows is a proprietary OS and not free. So it is also harder for people to use it, to develop for it and to support it. Again, this project is driven by volunteers which try to help users as much as they can but there is no claim that any problem can be solved.

You might consider to value the fact there is a Windows build of Geany provided at all. This is just extra work for us, it requires additional resources, it complicates and slows down the release process and it also complicates development of new features in Geany. We did it anyway to help you, the users. I just kindly ask for some sympathy for the work we invest, in our spare time.

@Carmina16
Copy link
Contributor Author

Carmina16 commented Jun 22, 2021

I don't get what of the above information is from your system and what is copied from elsewhere or do you use German, English and Arabic at the same time?

Those are from various Windows logs from this issue tracker to disprove the absurd statement of

Geany never supported anything but the POSIX environment variables to set its locale

and reporting a bug or missing feature is fine but demanding support or implementing all wishes is not possible.

I'm not demanding anything. I gave all the proofs the bug exist, yet it is still closed.

@elextr
Copy link
Member

elextr commented Jun 23, 2021

To perhaps clarify why its closed, and to try to take some heat out of the discussion, if some function is not intended to work, but just happens to do so, its not a bug if it stops working.

Geany never intended to follow the Windows setting, thats why all the advice in the many issues you have referenced is always "set LANG".

So even if somebody posted:

  1. properly documented version information (top few lines of Help->debug messages) of Geany, GTK and Glib and version of Windows where it followed the Windows language settings exactly as if LANG was set, there are many reports of it partly following the Windows setting, but not fully so it needs careful testing, and

  2. same information for the version where it doesn't, and the change between them where it failed

it would still not be classified as a bug for the reason above, but if the change that stopped it working was minimal and had no other side effects it might be able to be reverted if somebody identifies it. That is why I suggested you use git bisect to identify the change.

As @eht16 said, no regular Geany contributors use it on Windows much, so verifying your assertions that it used to work and now doesn't is unlikely to happen here to find what changed or to assume responsibility for guaranteeing that the feature continued to work if it was added.

And making Windows specific changes is unlikely in Geany itself since nobody can test it regularly.

But as noted previously on other similar issues, if somebody contributed a Windows version of the OSX startup program/script that read the Windows setting and set environment variables appropriately before calling Geany then that could probably be added to the Windows distribution (oh, and documented it so users knew how to use it :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants