After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789515 - Setting different languages on shell and Wayland
Setting different languages on shell and Wayland
Status: RESOLVED WONTFIX
Product: gdm
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-26 10:53 UTC by Arash Mousavi
Modified: 2017-11-15 18:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Arash Mousavi 2017-10-26 10:53:13 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
Comment 1 Arash Mousavi 2017-11-15 15:04:05 UTC
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...
Comment 2 Rui Matos 2017-11-15 15:33:41 UTC
(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.
Comment 3 Arash Mousavi 2017-11-15 17:21:29 UTC
(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
```
Comment 4 Ray Strode [halfline] 2017-11-15 17:54:37 UTC
/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
Comment 5 Arash Mousavi 2017-11-15 18:06:11 UTC
Awesome! Finally I can use Wayland! Thank you very much. It worked like a charm :)