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
Error: Unable to read environment locale: exit now. #1886
Comments
Try a useless command |
Thanks for the reply. Well, locale is useful :) running "locale" in Geany gives
running in terminal gives:
That shows, the locale "de.UTF-8" geany picks up from somewhere does not exist on my MacOS installation. in .profile the (overkill) setting of
is not seen by geany, even after restarting it. running locale again gives the same result Question: from where does geany pick up "de.UTF-8“, or rather how to provide geany/gtk with a supported locale? thanks |
Are you running Geany from a shell? I am not a OSXpert, but on linux if you run commands from menus often they don't run in a shell, and then .profile doesn't get read. |
In fact the first line of your debug messages says its a bad locale |
@elextr
No, I am not starting geany from a shell. Just as an app from the GUI. btw, geany itself appears in German - according to my system setup However, starting it from the terminal, I see, amongst other errors, the same GTK-Warning:
the starter is a bash script. That multiple places have a export LANG=.... |
Sorry outside my OSX knowledge, @techee pinged above is the OSX port maintainer, maybe he can help. |
From the starter script
That is a workaround! context now builds the PDF. Should this be needed? |
IIRC this feature was implemented because since a lot of software/documentation is in English it is disconcerting to have to swap brain cells back to the application UI in a different locale, So the feature has a deliberate use-case, its just coincidence it provides you a workaround. |
Of course, it makes sense to set a default en_US locale. Doing that sets my App Gui to English too. That seems to get unset later, and then using "de" instead of "de_DE" creates the mess. |
@elextr Defaulting to English isn't done any more because people then complained Geany isn't in their native language. So now you have to create the "config" file to get English locale as @tracing-home did. @tracing-home How does your "Language and Region" settings looks like? Have a look at mine in the screenshot below and try to execute the same code (which is the code from line 72 of the launcher script): In my case it uses the languages from "Preferred languages", underscore, and the language from the "Region" settings. |
@techee Looking with gets me de_DE as desired locale.
If I then add to the bottom of the startup script:
context can run without a problem. Obviously this is not a solution only a quickfix hack. So the script ultimately deciding that "de" is the correct locale and not "de_DE" causes the trip-up. |
Would you try just
to see what you get? Even with the same settings as yours, I get
and filtering this through the sed seems to do the right thing (Do you use the system |
here it is. essentially the same result. sed seems to be the system one, though I do have homebrew installed.
I wonder what I could have done to the system to get only "de". Actually it is a fairly fresh install. 10.11.6 El Capitain. Asides from a good bit of network blocking (outgoing) it is pretty default. |
@tracing-home Right, I finally had time to install 10.11 into a virtual machine and it really behaves the way you describe. Stupid there are such differences between OS X versions. I'm not the author of the launch scripts, I just made some modifications so I'm not sure what other consequences it would have to swap the order of checking AppleLocale and AppleLanguages. But it seems to work here. Would you try to modify the launch script this way: and let me know if it works for you? |
@techee Thanks for the effort! These kind of changes are indeed stupid! |
@tracing-home Great, thanks for testing. Maybe just if you are planning to use it for now, use the gtk2 variant of the script, otherwise you might run into some problems. The currently distributed Geany binaries are based on gtk2 because gtk3 is quite buggy on macOS. |
Hi....
I am getting a consistent
Unable to read environment locale: exit now.
error when trying to run context with this command (set in the create menu)
mtxrun --autogenerate --script context --autopdf --purge --synctex=-1 "%d/%f"
Executing the same command in a terminal works fine. From TextMate also no problems.
Replacing the actual command with a useless
cat "%d/%f"
produces no errors.
I am on MacOS 10.11.6, LANG=de_DE.UTF-8 shows in terminal, below is the debug info.
I do notice the Gtk warning about locale not supported. If I set LANG=en_US.UTF-8 in .profile the error remains the same. What to do?
22:02:13: Gtk WARNING : Locale not supported by C library. Using the fallback 'C' locale. 22:02:13: Geany INFO : Geany 1.33, C 22:02:13: Geany INFO : GTK 2.24.31, GLib 2.52.2 22:02:13: Geany INFO : System data dir: /Applications/Geany.app/Contents/Resources/share/geany 22:02:13: Geany INFO : User config dir: /Users/martin/.config/geany 22:02:13: Geany INFO : System plugin path: /Applications/Geany.app/Contents/Resources/lib/geany 22:02:13: Geany INFO : Added filetype Arduino (61). 22:02:13: Geany INFO : Added filetype Clojure (62). 22:02:13: Geany INFO : Added filetype CUDA (63). 22:02:13: Geany INFO : Added filetype Cython (64). 22:02:13: Geany INFO : Added filetype Genie (65). 22:02:13: Geany INFO : Added filetype Graphviz (66). 22:02:13: Geany INFO : Added filetype JSON (67). 22:02:13: Geany INFO : Added filetype Scala (68). 22:02:13: Geany INFO : Loaded libvte from libvte.9.dylib 22:02:13: Geany INFO : /Users/martin/Documents/daf-Kurse/ABS/Mathe/Schätzen/textaufgabenweg.tex : LaTeX (UTF-8)
The text was updated successfully, but these errors were encountered: