kasmtech / workspaces-issues

19 stars 4 forks source link

[Bug] - Configured language preference is ignored #442

Open nielsbasjes opened 1 year ago

nielsbasjes commented 1 year ago

Describe the bug In Chrome I have configured that Dutch is my preferred language. image

The effect (which is how it should happen) is that my browser sends out the Accept-Language header with the value nl-NL,nl;q=0.9,en-US;q=0.8,en;q=0.7 to all websites. The Kasm web UI shows everything in Dutch (which is correct).

For Kasm I personally prefer English so I change the setting in my Kasm profile from Auto to Engels: Verenigde Staten van America (which is US English as written in Dutch).

After I logout and login again the above setting is still there, yet the entire UI is still in Dutch.

To Reproduce Steps to reproduce the behavior:

  1. Open Chrome and in the Settings go to Preferred languages and make Dutch the preferred one (i.e. top of the list).
  2. Go to a Kasm web UI and login.
  3. The Kasm web UI should be in Dutch now.
  4. Go to the Kasm settings and change the preferred language from Auto to something else (which is not Dutch). A green popup is shown that it was successfully changed.
  5. Logout and login again (which I'm not sure if that should be needed).
  6. The Kasm web UI is still in Dutch which is incorrect.

Expected behavior

  1. If set to automatic the UI should follow what is specified (and available) by looking at the Accept-Language header. This seems to work.
  2. If set to an explicit language then that should be used. This is not happening.

Screenshots image

Workspaces Version 1.14.0

Workspaces Installation Method Single Server

Client Browser (please complete the following information):

Workspace Server Information (please provide the output of the following commands):

root@kasm:~# uname -a

Linux kasm 5.15.0-82-generic #91-Ubuntu SMP Mon Aug 14 14:14:14 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

root@kasm:~# cat /etc/os-release

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
root@kasm:~# sudo docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  compose: Docker Compose (Docker Inc., v2.5.0)

Server:
 Containers: 8
  Running: 8
  Paused: 0
  Stopped: 0
 Images: 18
 Server Version: 20.10.21
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 
 runc version: 
 init version: 
 Security Options:
  apparmor
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.0-82-generic
 Operating System: Ubuntu 22.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 11.66GiB
 Name: kasm
 ID: M66B:SDXK:B726:LAOU:5L75:QUN7:SXSL:BXO5:KN6R:B55N:JWXF:OQVU
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

root@kasm:~# sudo docker ps | grep kasm

0129047e6694   kasmweb/nginx:1.25.1       "/docker-entrypoint.…"   31 minutes ago   Up 31 minutes             80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   kasm_proxy
807cd7151279   kasmweb/agent:1.14.0       "/bin/sh -c '/usr/bi…"   31 minutes ago   Up 31 minutes (healthy)   4444/tcp                                        kasm_agent
82abc8cba456   kasmweb/kasm-guac:1.14.0   "/dockerentrypoint.sh"   31 minutes ago   Up 31 minutes (healthy)                                                   kasm_guac
b3a60f1bd444   kasmweb/manager:1.14.0     "/bin/sh -c '/usr/bi…"   31 minutes ago   Up 31 minutes (healthy)   8181/tcp                                        kasm_manager
88493bfc6444   kasmweb/share:1.14.0       "/bin/sh -c '/usr/bi…"   31 minutes ago   Up 31 minutes (healthy)   8182/tcp                                        kasm_share
1703a824c9ac   postgres:12-alpine         "docker-entrypoint.s…"   31 minutes ago   Up 31 minutes (healthy)   5432/tcp                                        kasm_db
69df2a0c7a38   kasmweb/api:1.14.0         "/bin/sh -c '/usr/bi…"   32 minutes ago   Up 31 minutes (healthy)   8080/tcp                                        kasm_api
c7c3f9208167   redis:5-alpine             "docker-entrypoint.s…"   32 minutes ago   Up 31 minutes             6379/tcp                                        kasm_redis

Additional context I have just updated my existing 1.10.0 installation to 1.14.0 using the commandline script for this purpose. This worked perfectly.

nielsbasjes commented 1 year ago

FYI: My current workaround (this only works because I'm the only user).

1) In /opt/kasm/current/www/locales/translate.js make the entire array of countryCodes empty. 2) In /opt/kasm/current/www/locales/ remove all subdirectories except /en/.

j-travis commented 1 year ago

Thank you for the feedback. The dropdown in the profile sections is for changing the language settings of the container sessions when they are created. There is no option to set the UI language, its all automatic. We will be looking at allowing users to change the UI language instead.

There is an option for forcing the UI to a particular language (e.g https://my.kasm.server/?lng=en) https://kasmweb.com/docs/latest/user_guide/translations.html

nielsbasjes commented 1 year ago

Thanks for pointing me to this documentation. This effectively makes this an invalid bug report. Sorry about that. Please close or leave open (as feature request for making the selection) you see as most useful for you.