locale being overridden #587
Comments
I guess that a
would fix this issue, am I right? |
That won't work unfortunately. My understanding from the ZSH documentation is that outside of a function source $ZSH/oh-my-zsh.sh
source /etc/profile.d/locale.sh still results in (for completeness, here's my LANG=en_GB.UTF-8
LC_CTYPE=en_GB.UTF-8
LC_NUMERIC=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE=en_GB.UTF-8
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES=en_GB.UTF-8
LC_PAPER=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=en_GB.UTF-8 and #!/bin/sh
if [ -z "$LANG" ]; then
if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
echo "found $XDG_CONFIG_HOME/locale.conf"
. "$XDG_CONFIG_HOME/locale.conf"
elif [ -n "$HOME" ] && [ -r "$HOME/.config/locale.conf" ]; then
echo "found $HOME/.config/locale.conf"
. "$HOME/.config/locale.conf"
elif [ -r /etc/locale.conf ]; then
echo "found /etc/locale.conf"
. /etc/locale.conf
fi
fi
LANG=${LANG:-C}
export LANG
[ -n "$LC_CTYPE" ] && export LC_CTYPE
[ -n "$LC_NUMERIC" ] && export LC_NUMERIC
[ -n "$LC_TIME" ] && export LC_TIME
[ -n "$LC_COLLATE" ] && export LC_COLLATE
[ -n "$LC_MONETARY" ] && export LC_MONETARY
[ -n "$LC_MESSAGES" ] && export LC_MESSAGES
[ -n "$LC_PAPER" ] && export LC_PAPER
[ -n "$LC_NAME" ] && export LC_NAME
[ -n "$LC_ADDRESS" ] && export LC_ADDRESS
[ -n "$LC_TELEPHONE" ] && export LC_TELEPHONE
[ -n "$LC_MEASUREMENT" ] && export LC_MEASUREMENT
[ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION Again from the docs, it seems all that would be necessary is wrapping that bit of code in |
This has been annoying me too. I get a locale config that I think works, put it in my zshrc, and next time I use it on another similar machine the warnings start up again. |
It would appear I accidentally neglected this bug. Sorry, @wengole! @wengole - Your suggestion of wrapping the locale / icon definitions in an anonymous function is a good one, but unfortunately I don't think it will solve the problem. The icon code points are not reset with every prompt-draw - they are only set once, when P9k initializes. If the locale is wrong, each time P9k goes to ask your font for an icon (i.e., during each prompt draw), I think the font will come back with something crazy. I think what we need to do is find a way to define the locale for P9k, only, for every draw, while not affecting the rest of your terminal. This may mean sticking it in an anonymous function in |
I don't have any meaningful to add. I'm experiencing the same bug. Just wanted to bump the issue (no updates in a year!). |
Due to this bug: Powerlevel9k/powerlevel9k#587
I tried to fix it, it was not really well tested, but here the patch that works for me :
|
OMG. Just stumbled upon this Issue. @bhilburn Good point. Not sure what happens, if you set Good catch @wengole ! Could any of you provide a fix for that? I could have sworn that we already had a fix for that, but obviously (d937441) we never had.. |
@dritter - Happy to hear that you think @wengole's solution will do the job! Additionally, @benjarobin's evidence that wrapping it did indeed worked is great! @benjarobin - Can you submit a PR with that change against |
@bhilburn I am not an user of powerlevel9k, I was just helping an user of Arch Linux. And since I did not test it well, I prefer not to submit a PR. Sorry. |
@benjarobin - Oh! That was very kind of you. Thanks for hopping in! @dritter - I'm going to take @benjarobin's patch and turn it into a PR. |
@bhilburn Let me know if I can help out. |
Hi,
I've just spent a loooong time trying to find the reason my system locale was being overridden to en_US and finally tracked it down to this line: https://github.com/bhilburn/powerlevel9k/blob/master/functions/icons.zsh#L21
This declaration of
local
is not in fact localised see: http://zsh.sourceforge.net/Doc/Release/Functions.html#Anonymous-FunctionsThe text was updated successfully, but these errors were encountered: