GNOME Bugzilla – Bug 789515
Setting different languages on shell and Wayland
Last modified: 2017-11-15 18:06:11 UTC
**Background:** Using Gnome on X, I'm able to set the gnome language from it's control panel setting, and then set the shell language differently like this: ``` export LANG en_US.utf8 export LC_ALL en_US.utf8 export LC_CTYPE en_US.utf8 ``` i.e. If I choose Persian in gnome control panel, the interface will be Persian, but I can still use English programs on command line. **What happens:** Using Wayland on gnome, the interface will convert to English while gnome settings still shows Persian, unless I unset all LANG environment variables. **How it should be:** I'm expecting to be able to use different language in Wayland and my shell, as in X. P.S. I'm not sure if this should be reported here on gnome-control-center. I have already reported the same thing on wayland too https://bugs.freedesktop.org/show_bug.cgi?id=103391
Not sure if GNOME has a workflow regarding the reported bugs, but it would be cool if somebody triage them, marks them as "Wont Fix" or just a response...
(In reply to Arash Mousavi from comment #0) > Using Gnome on X, I'm able to set the gnome language from it's control panel > setting, and then set the shell language differently like this: > > ``` > export LANG en_US.utf8 > export LC_ALL en_US.utf8 > export LC_CTYPE en_US.utf8 Where do you do these exports? In any case I believe this is handled in gdm and if not, at least Ray likely knows where it is.
(In reply to Rui Matos from comment #2) > Where do you do these exports? I'm currently use fishshell, so they are exported in `config.fish` (which is like .zshrc or .bashrc) and it's only in my user space. In fish syntax, they look like this: ``` set -gx LANG en_US.utf8 set -gx LC_ALL en_US.utf8 set -gx LC_CTYPE en_US.utf8 ```
/usr/bin/gnome-session does this: if [ "x$XDG_SESSION_TYPE" = "xwayland" ] &&• [ "x$XDG_SESSION_CLASS" != "xgreeter" ] &&• [ -n "$SHELL" ] &&• grep -q "$SHELL" /etc/shells &&• ! (echo "$SHELL" | grep -q "false") &&• ! (echo "$SHELL" | grep -q "nologin"); then• if [ "$1" != '-l' ]; then• exec bash -c "exec -l '$SHELL' -c '$0 -l $*'"• else• shift• fi• This is because some users really really expect their session to get run through a login shell. see bug 736660 You apparently expect the opposite, that the session doesn't get run through a login shell. I don't think there's a way to make everyone happy unfortunately. I think the best answer for you might be to wrap your set calls like so: if status --is-interactive set -gx LANG en_US.utf8 set -gx LC_ALL en_US.utf8 set -gx LC_CTYPE en_US.utf8 end
Awesome! Finally I can use Wayland! Thank you very much. It worked like a charm :)