Ubuntu – Can’t change language back to English in Kubuntu 19.04

kdekde5kubuntulanguage

Problem:

In Settings -> Regional Settings, I added language Marathi and Hindi to see how it works and what it translates(I know Marathi, and Hindi). After I rebooted, the language was changed to Marathi. Now, I wanted to revert back to English, as that is the language I am used to in handling the computer. But, as I click on the Add Languages… button, nothing happens, no dialogue box appears. Because of this I am not able to change language to any other except those present as Added Languages.

Steps to reproduce:

Go to Settings -> Regional Settings -> Click Add Languages… -> Add Hindi – हिंदी (or Marathi – मराठी, others might not give same results, don't know) -> Click Apply -> Restart Computer -> Go to तंत्र विन्यास (प्रणाली संयोजना in case of Marathi) -> Regional Settings -> Click Add Languages…

What I have tried:

  1. Where is the LANGUAGE environment variable set?
  2. locale: Reset lost settings
  3. https://stackoverflow.com/questions/27387199/how-to-change-the-language-locale-for-the-ubuntu-terminal
  4. https://websiteforstudents.com/how-to-change-to-your-native-language-on-ubuntu-17-10/
  5. https://www.shellhacks.com/linux-define-locale-language-settings/
  6. Some menus are in Chinese/Japanese!

Additional information:

System Settings is crashing sometimes.

Crash log:

Application: प्रणाली संयोजना (systemsettings5), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f395cdb46c0 (LWP 3574))]

Thread 7 (Thread 0x7f393b5ef700 (LWP 3583)):
#0  __GI___libc_read (nbytes=16, buf=0x7f393b5eeb20, fd=18) at ../sysdeps/unix/sysv/linux/read.c:26
#1  __GI___libc_read (fd=18, buf=0x7f393b5eeb20, nbytes=16) at ../sysdeps/unix/sysv/linux/read.c:24
#2  0x00007f395f16a410 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f395f1236cf in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f395f123ba0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f395f123d1c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007f3961944063 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007f39618ef5bb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f396173a2c6 in QThread::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007f3960a5cef5 in ?? () from /lib/x86_64-linux-gnu/libQt5Qml.so.5
#10 0x00007f396173b612 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007f395fbbb182 in start_thread (arg=<optimized out>) at pthread_create.c:486
#12 0x00007f39613ceb1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7f3946909700 (LWP 3582)):
#0  0x00007f395f16e809 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007f395f123b00 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f395f123d1c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f3961944063 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007f39618ef5bb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f396173a2c6 in QThread::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f3960a5cef5 in ?? () from /lib/x86_64-linux-gnu/libQt5Qml.so.5
#7  0x00007f396173b612 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f395fbbb182 in start_thread (arg=<optimized out>) at pthread_create.c:486
#9  0x00007f39613ceb1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7f3950a27700 (LWP 3580)):
#0  0x00007f39613c2729 in __GI___poll (fds=0x7f3940004a30, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f395f123bf6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f395f123d1c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f3961944063 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007f39618ef5bb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f396173a2c6 in QThread::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f3960a5cef5 in ?? () from /lib/x86_64-linux-gnu/libQt5Qml.so.5
#7  0x00007f396173b612 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f395fbbb182 in start_thread (arg=<optimized out>) at pthread_create.c:486
#9  0x00007f39613ceb1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7f3953cb5700 (LWP 3578)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x560f3a7f1b2c) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x560f3a7f1ad8, cond=0x560f3a7f1b00) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x560f3a7f1b00, mutex=0x560f3a7f1ad8) at pthread_cond_wait.c:655
#3  0x00007f39582fc36b in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007f39582fc0d7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007f395fbbb182 in start_thread (arg=<optimized out>) at pthread_create.c:486
#6  0x00007f39613ceb1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7f395a806700 (LWP 3577)):
#0  __GI___libc_read (nbytes=16, buf=0x7f395a805b10, fd=7) at ../sysdeps/unix/sysv/linux/read.c:26
#1  __GI___libc_read (fd=7, buf=0x7f395a805b10, nbytes=16) at ../sysdeps/unix/sysv/linux/read.c:24
#2  0x00007f395f16a410 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f395f1236cf in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f395f123ba0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f395f123d1c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007f3961944063 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007f39618ef5bb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f396173a2c6 in QThread::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007f3961bbc565 in ?? () from /lib/x86_64-linux-gnu/libQt5DBus.so.5
#10 0x00007f396173b612 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007f395fbbb182 in start_thread (arg=<optimized out>) at pthread_create.c:486
#12 0x00007f39613ceb1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f395bd33700 (LWP 3576)):
#0  0x00007f39613c2729 in __GI___poll (fds=0x7f395bd32c68, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f395fb78917 in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f395fb7a53a in xcb_wait_for_event () from /lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f395c7066a8 in ?? () from /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#4  0x00007f396173b612 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f395fbbb182 in start_thread (arg=<optimized out>) at pthread_create.c:486
#6  0x00007f39613ceb1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7f395cdb46c0 (LWP 3574)):
[KCrash Handler]
#6  0x0000560f42a72ff0 in ?? ()
#7  0x00007f396191f718 in QObject::connect(QObject const*, char const*, QObject const*, char const*, Qt::ConnectionType) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f3960901f9c in ?? () from /lib/x86_64-linux-gnu/libQt5Qml.so.5
#9  0x00007f39609022db in QV4::QObjectWrapper::wrap_slowPath(QV4::ExecutionEngine*, QObject*) () from /lib/x86_64-linux-gnu/libQt5Qml.so.5
#10 0x00007f396097f88c in QV4::ExecutionEngine::fromVariant(QVariant const&) () from /lib/x86_64-linux-gnu/libQt5Qml.so.5
#11 0x00007f39608e02e5 in QV4::QQmlContextWrapper::virtualGet(QV4::Managed const*, QV4::PropertyKey, QV4::Value const*, bool*) () from /lib/x86_64-linux-gnu/libQt5Qml.so.5
#12 0x00007f396088648d in QV4::ExecutionContext::getProperty(QV4::String*) () from /lib/x86_64-linux-gnu/libQt5Qml.so.5
#13 0x00007f3960986d40 in QV4::Runtime::method_loadName(QV4::ExecutionEngine*, int) () from /lib/x86_64-linux-gnu/libQt5Qml.so.5
#14 0x00007f39397e80d8 in ?? ()
#15 0x0000000000000000 in ?? ()
[Inferior 1 (process 3574) detached]

Any help is highly appreciated!

Best Answer

Root cause:

When we add language via System Settings > Regional Settings, it is added as KDE Plasma's (Desktop Environment's) Language and not System Language. Hence, though System Language shows English (run locale in terminal), we still see our desktop in the language specified in Regional Settings.

This is also the reason why using

  1. sudo locale-gen en_US.UTF-8 or
  2. sudo localectl set-locale LANG=en_US.utf8 or
  3. Putting export LANG=en_US.utf8 in ~/.bashrc and running source ~/.bashrc

doesn't effect the language setting set in Regional Setting.

Solution:

Go to ~/.config/plasma-locale-settings.sh, open it and ensure it contains following:

# Generated script, do not edit
# Exports language-format specific env vars from startkde.
# This script has been generated from kcmshell5 formats.
# It will automatically be overwritten from there.
# I am from India, hence en_IN, shouldn't matter much
export LANG=en_IN
export LANGUAGE=en_US

then, go to ~/.config/plasma-localerc, open it and ensure it contains following:

[Formats]
LANG=en_IN

[Translations]
LANGUAGE=en_US

Shutdown the computer and start again. You should be back on English. If not, do let me know by comment :)

Related Question