language kcm doesn't write env setup script

Bug #1317115 reported by Tim Edwards
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kde-runtime (Ubuntu)
Fix Released
High
Harald Sitter
Trusty
Fix Released
High
Harald Sitter
Utopic
Fix Released
High
Harald Sitter

Bug Description

[Impact]
Language configuration will not write the necessary envrionment setup files to make non kde applications localized unless it is switched into debug mode. This was fixed by moving the related write function call out of the noop kdebug statement to make sure that it is executed regardless of whether the kdebug is turned noop.

[Test Case]

* delete .kde/env/setlocale.sh
* run kdebugdialog
* deselect everything
* run kcmshell4 language
* change a language setting
* apply changes
* make sure .kde/env/setlocale.sh was generated again with the configured settings

[Regression Potential]
none

[Other Info]
n/a

--

The current Kubuntu method of installing support for new languages and changing which language gets highest preference is broken because it only affects KDE applications. The system language (as set by the LANG and LANGUAGE environment variables) isn't changed, and the language support for added languages is incomplete - for example missing localisation packages for Firefox, Libreoffice and spell checkers, among others.

This is a side-effect of the deprecation of the language-selector-kde package, which used to give Kubuntu users the same fuctionality as gnome-language-selector by creating an extra module in KDE System Settings.

The missing functionality should be integrated into the KDE System Settings Locale control module, as mentioned in this comment https://bugs.launchpad.net/ubuntu/+source/language-selector/+bug/1013626/comments/4

To reproduce:
1. Freshly installed Kubuntu 14.04 system. KDE System Settings->Locale->Language.
2. Add language (in my example German). Wait while Locale module installs the necessary packages.
3. Move language (German) to top of the priority list, above the default American English
4. Logout of KDE, log back in

Expected Results:
All necessary language files for both KDE applications (e.g. Dolphin) and non-KDE applications (e.g. Firefox, Libreoffice) is installed. All programs which have German translations available display in German. Environment variables are set so that command line programs also run in German (where translations available), eg:
tim@localhost:~$ ls notthere
ls: Zugriff auf notthere nicht möglich: Datei oder Verzeichnis nicht gefunden

In short - the same effect you'd get by using gnome-language-selector

Actual Results:
Only the language of KDE applications is changed. Firefox, LIbreoffice, command line programs, bash environment vars, and all other programs remain in English. In other words you have a half-half system as far as language support is concerned.

Workaround:
sudo apt-get install gnome-language-selector
gnome-language-selector

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: kde-workspace 4:4.11.8-0ubuntu6
ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
ApportVersion: 2.14.1-0ubuntu3
Architecture: amd64
CurrentDesktop: KDE
Date: Wed May 7 15:01:57 2014
InstallationDate: Installed on 2014-04-29 (7 days ago)
InstallationMedia: Ubuntu-Server 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
PackageArchitecture: all
SourcePackage: kde-workspace
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Tim Edwards (tkedwards) wrote :
Revision history for this message
Tim Edwards (tkedwards) wrote :

BTW the ProcEnviron.txt attached to this bug report is from after I applied the workaround (i.e. used gnome-language-selector) so that's why some of the env vars have been changed

Revision history for this message
Harald Sitter (apachelogger) wrote :

please post the output of the following command

cat ~/.kde/env/*

affects: kde-workspace (Ubuntu) → libkubuntu (Ubuntu)
Revision history for this message
Harald Sitter (apachelogger) wrote :

Oh, and please do the following:

- revert language-selector changes

- create new user
- login
- hit alt+f2
- type kdebugdialog
- hit enter
- enable everything, apply and close
- from a terminal run:
> systemsettings &> log
- go to locale->language
- move german to the right hand list
- move german up to the top of the list
- apply and close
- in the home folder there should be a file called 'log', please attach it to this bug report

after that run the previous command again

cat ~/.kde/env/*

Changed in libkubuntu (Ubuntu):
status: New → Incomplete
Revision history for this message
Tim Edwards (tkedwards) wrote :

In the home dir of the original tim user (after undoing the gnome-language-selector changes but with the KDE Locale module changes still applied):
No KDE env directory:
tim@localhost:~$ cat ~/.kde/env/*
cat: /home/tim/.kde/env/*: No such file or directory
tim@localhost:~$ find ~/.kde/ | grep env
tim@localhost:~$

Revision history for this message
Tim Edwards (tkedwards) wrote :

I followed your instructions exactly using a newly created user test. Still no kde/env directories, log from running systemsettings attached:
test@localhost:~$ cat ~/.kde/env/*
cat: /home/test/.kde/env/*: No such file or directory
test@localhost:~$ find /home/test/.kde/ | grep -i env
test@localhost:~$

This is in a VM I'm using to test 14.04 before installing it on my laptop. So there's no problem with testing stuff, installing debug or test packages or anything like that.

Revision history for this message
Harald Sitter (apachelogger) wrote :

Mh, please run kdebugdialog again and enable everything, then fetch a new log. (it seems systemsettings wasn't registered as category right after login).

Revision history for this message
Harald Sitter (apachelogger) wrote :

That is to say, if you want to start with a complete new user again... simply go to 'systemsettings -> locale -> language' before running kdebugdialog to enable everything.

Revision history for this message
Tim Edwards (tkedwards) wrote :

I started systemsettings and browsed into locale->language before starting kdebugdialog and enabling everything this time. I'm not sure if the log has got anything useful but here's the log, seems to have at least registered that Locale was opened.

Revision history for this message
Harald Sitter (apachelogger) wrote :

Still nothing useful inside. Did you close systemsettings after you enabled everything in kdebugdialog? Otherwise the setting changes from kdebugdialog won't apply.

Revision history for this message
Tim Edwards (tkedwards) wrote :

Yes, I did that. Just to be sure I've tried a 3rd time:
Run systemsettings
Start kdebugdialog (with system settings still open), uncheck 'disable debug output', Select all, Apply, Ok
close system settings
systemsettings &>log
go to locale->language
move german to the right hand list
move german up to the top of the list
apply and close

log file attached

I don't think the locale module is crashing or failing to run part of its process. AFAICT it's just go extremely limited functionality and so doesn't replace the deprecated language-selector-kde. It's a bit like if the KDE System Settings Printer config only configured printers for KDE apps, and Firefox and Libreoffice or the lp* tools couldn't see the printers it created.

Revision history for this message
Harald Sitter (apachelogger) wrote :

Right then, lets do this a different way because kdebugdialog decides to be very dumb for some reason.

- new user

- run kcmshell4 language
- close it
- run kdebugdialog
- in the search type kcmshell
- make sure kcmshell is found, if not, apply and close, run kcmshell again, rinse and repeat until kdebugdialog actually lists kcmshell

- enable everything in kdebugdialog
- make sure kcmshell is checked
- apply & close

- run
> kcmshell4 langauge &> log

- do the actual configuration
- attach log

do note, that the log should contain lines containing "KCMLocale::", if not don't bother uploading it will be useless again. this method should create a viable log though, as it's exactly what I just did.

Revision history for this message
Harald Sitter (apachelogger) wrote :

nevermind, I found the issue

Changed in libkubuntu (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → High
assignee: nobody → Harald Sitter (apachelogger)
affects: libkubuntu (Ubuntu) → kde-runtime (Ubuntu)
description: updated
summary: - KDE Locale module support for changing language is incomplete
+ language kcm doesn't write env setup script
Changed in kde-runtime (Ubuntu Trusty):
status: New → Triaged
importance: Undecided → High
Changed in kde-runtime (Ubuntu Utopic):
status: Triaged → In Progress
Changed in kde-runtime (Ubuntu Trusty):
assignee: nobody → Harald Sitter (apachelogger)
Changed in kde-runtime (Ubuntu Trusty):
status: Triaged → Fix Committed
status: Fix Committed → Won't Fix
status: Won't Fix → In Progress
Changed in kde-runtime (Ubuntu Utopic):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kde-runtime - 4:4.13.0-0ubuntu3

---------------
kde-runtime (4:4.13.0-0ubuntu3) utopic; urgency=medium

  * Update kubuntu_langpack_install.diff from git clone. Make sure that
    writeEnv is called independent of kdebug as kdebug lines would not get
    executed unless debug is actually enabled at runtime LP: #1317115
 -- Harald Sitter <email address hidden> Thu, 08 May 2014 17:30:15 +0200

Changed in kde-runtime (Ubuntu Utopic):
status: Fix Committed → Fix Released
Revision history for this message
Scott Kitterman (kitterman) wrote : Please test proposed package

Hello Tim, or anyone else affected,

Accepted kde-runtime into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/kde-runtime/4:4.13.0-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in kde-runtime (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Tim Edwards (tkedwards) wrote :

Thanks for your help with this but unfortunately I don't think the fix has worked.
I started off by clearing the test user's home dir and copying in just what's in /etc/skel. Then System Settings->Locale, add German, put German as top priority. Logout, log back in.

Result is that even KDE seems half German/half English (whereas before the patch KDE was fully in German). See screenshots attached.

As for other programs, FIrefox is in German, but Libreoffice, Gimp and bash shell are not.

test@localhost:~$ cat .kde/env/*
export LANG=de_GB.UTF-8
export LANGUAGE=de:en
export LC_NUMERIC=de_GB.UTF-8
export LC_TIME=de_GB.UTF-8
export LC_MONETARY=de_GB.UTF-8
export LC_PAPER=de_GB.UTF-8
export LC_IDENTIFICATION=de_GB.UTF-8
export LC_NAME=de_GB.UTF-8
export LC_ADDRESS=de_GB.UTF-8
export LC_TELEPHONE=de_GB.UTF-8
export LC_MEASUREMENT=de_GB.UTF-8

Revision history for this message
Harald Sitter (apachelogger) wrote :

You need to set your country accordingly.

Revision history for this message
Tim Edwards (tkedwards) wrote :

That fixed it!

I also installed a 3rd language (Spanish) as an extra test, and after adding the language and chaging the country, logout/login and everything was consistently in Spanish. Then set it back to English(UK) and everything's consistent in that too.

Thanks again for fixing the bug!

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kde-runtime - 4:4.13.0-0ubuntu1.1

---------------
kde-runtime (4:4.13.0-0ubuntu1.1) trusty; urgency=medium

  * Update kubuntu_langpack_install.diff from git clone. Make sure that
    writeEnv is called independent of kdebug as kdebug lines would not get
    executed unless debug is actually enabled at runtime LP: #1317115
 -- Harald Sitter <email address hidden> Thu, 08 May 2014 17:34:53 +0200

Changed in kde-runtime (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of the Stable Release Update for kde-runtime has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.