By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 741 - Locale mixup between TDE and KDE
Summary: Locale mixup between TDE and KDE
Status: RESOLVED DUPLICATE of bug 675
Alias: None
Product: TDE
Classification: Unclassified
Component: tdebase (show other bugs)
Version: 3.5.13 [Trinity]
Hardware: All All
: P5 minor
Assignee: Francois Andriot
URL:
Depends on:
Blocks:
 
Reported: 2011-12-10 15:32 CST by Francois Andriot
Modified: 2012-01-11 13:11 CST (History)
3 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
Fix directories location in startkde (3.53 KB, patch)
2011-12-11 11:45 CST, Francois Andriot
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Andriot 2011-12-10 15:32:45 CST
Hello, I'm running Fedora 16 here, I have the following software installed:
- TDE 3.5.13 + French translations, all under /opt/trinity
- KDE 4 + French translations, all under /usr

TDE runs flawlessly BUT I noticed that applications are incompletly or badly translated, only when KDE4 is installed. If KDE4 is uninstalled, the TDE translations are fine.

For example, using konsole. I've got 2 translation files, one for TDE and another for KDE4:
/opt/trinity/share/locale/fr/LC_MESSAGES/konsole.mo
/usr/share/locale/fr/LC_MESSAGES/konsole.mo


strac'ing the konsole gives the following output (only lines containing 'konsole.mo' are shown):

access("/home/albator/.trinity/share/locale/fr_FR.UTF-8/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/share/locale/fr_FR.UTF-8/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/opt/trinity/share/locale/fr_FR.UTF-8/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/home/albator/.trinity/share/locale-bundle/fr_FR.UTF-8/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/home/albator/.trinity/share/locale/fr/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/share/locale/fr/LC_MESSAGES/konsole.mo", R_OK) = 0
stat("/usr/share/locale/fr/LC_MESSAGES/konsole.mo", {st_mode=S_IFREG|0644, st_size=31236, ...}) = 0
access("/home/albator/.trinity/share/locale/fr_FR.UTF-8/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/share/locale/fr_FR.UTF-8/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/opt/trinity/share/locale/fr_FR.UTF-8/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/home/albator/.trinity/share/locale-bundle/fr_FR.UTF-8/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/home/albator/.trinity/share/locale/fr_FR/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/share/locale/fr_FR/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/opt/trinity/share/locale/fr_FR/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/home/albator/.trinity/share/locale-bundle/fr_FR/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/home/albator/.trinity/share/locale/fr/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/share/locale/fr/LC_MESSAGES/konsole.mo", R_OK) = 0
stat("/usr/share/locale/fr/LC_MESSAGES/konsole.mo", {st_mode=S_IFREG|0644, st_size=31236, ...}) = 0
access("/home/albator/.trinity/share/locale/fr/LC_MESSAGES/konsole.mo", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/share/locale/fr/LC_MESSAGES/konsole.mo", R_OK) = 0
stat("/usr/share/locale/fr/LC_MESSAGES/konsole.mo", {st_mode=S_IFREG|0644, st_size=31236, ...}) = 0
open("/usr/share/locale/fr/LC_MESSAGES/konsole.mo", O_RDONLY) = 10

So, we see that for each language variant ('fr_FR.UTF-8', then 'fr'), it looks for 'konsole.mo' under '/usr/share' first, then '/opt/trinity/share'.
The same is true with 'kdelibs;mo' and 'kio.mo'.

My XDG environment variables are below:
$ env|grep XDG
XDG_SESSION_ID=2
XDG_CONFIG_DIRS=:/opt/trinity/etc/xdg/:/etc/xdg/:/opt/trinity/etc/xdg/:/etc/xdg/
XDG_DATA_DIRS=:/opt/trinity/share/:/usr/share/:/opt/trinity/share/:/usr/share/
XDG_RUNTIME_DIR=/run/user/albator

So, I see no mistake in the environment. Why does TDE always tries "/usr/share" prior to its own directory ? (at least for translations)
Comment 1 Francois Andriot 2011-12-11 11:04:44 CST
Ho no, it looks like it's caused by the KDEDIRS variable.
$ echo $KDEDIRS
/usr:/opt/trinity/:/usr/:/opt/trinity/:/usr/


I thought this one was only used in 'startkde' to guess the KDEDIR variable (in my case /opt/trinity).
$ echo $KDEDIR
/opt/trinity


I guess I'll have to patch (again) the startkde script to ensure that the KDEDIRS variable begins with $KDEDIR .
Comment 2 Francois Andriot 2011-12-11 11:45:47 CST
Created attachment 224 [details]
Fix directories location in startkde

It looks like a last minute change messed up a bit the startkde 3.5.13 script: string replacements from 'kde3' to 'trinity' gave duplicate and/or incorrect path checking.

This patch suppresses useless tests and ensures that $KDEDIR is put in front of KDEDIRS variable.
Please note that this patch is valid under RHEL/Fedora because there are scripts under /etc/profile.d/ that sets KDE4 variables and XDG variables BEFORE the Trinity startkde script is called. So we do not have to set standard path, like '/usr/share' or '/etc/xdg'.
Comment 3 Darrell 2011-12-16 19:22:08 CST
The patch duplicates efforts in bug 675. KDEDIRS must be in the path before KDEDIR because that is how the variable functions correctly. The KDEDIRS variable must be defined by end-users and not upstream. KDEDIRS is a user defined variable and never should be hard-coded in startkde.

The conflicts noted in this bug report with KDE4 were noted in bug report 675. In bug report 675 the startkde script was patched to remove the KDEDIRS declaration as well as adding some tests before setting other environment variables.

Slackware also uses /etc/profile.d scripts to establish environment variables. Those scripts currently are problematic for TDE users because the variables must exist in a multi-user multi-desktop environment. These problems likely will disappear with the renaming project because environment variables will be renamed too. For example, KDEDIR will be renamed to TDEDIR and KDEDIRS to TDEDIRS. Thereafter there will be no conflict with KDE4 environment variables.

The trick until then is to use KDEDIRS only with directories related to TDE and not other desktops.
Comment 4 Francois Andriot 2011-12-17 16:14:56 CST
Hello, in fact, the attached patch does not solve totally the problem.

It looks like the '/etc/profile.d/kde.sh' script, which sets KDEDIRS, is installed by some KDE4 configuration package.

There are cases where KDE4 applications and/or Gnome applications are installed, but not the KDE4 configuration package. So KDEDIRS does not contain /usr when TDE start ups.

In that case, non-TDE applications (firefox ...) are not visible in the TDE start menu, which is, in my opinion, a problem.

Also, I do not understand why KDEDIR should be guessed from KDEDIRS, since KDEDIRS can contain anything, including bad directories.
In my opinion, it should be the contrary: KDEDIR should always be hardcoded to where TDE is actually installed, and KDEDIRS should be guessed/built by some scripts.
Comment 5 Darrell 2011-12-17 17:44:11 CST
The problem with KDEDIRS will be resolved when the renaming project completes and all environment variables change names, such as KDEDIR to TDEDIR and KDEDIRS to TDEDIRS. There is no easy way to stop other apps from setting the KDEDIRS variable, but the new proposed startkde script in bug report 675 no longer hard-codes that variable.

Until the renaming project is complete, possibly the proposed new startkde script can test whether KDEDIRS is already set. If set, test whether the variable includes KDE4 folders or KDE3 folders and if true, unset the variable.

The alleged problem with non TDE apps not appearing in the menu is solved by using the Menu Updating tool in the T-Menu/System.
Comment 6 Francois Andriot 2011-12-18 03:12:08 CST
Yes, I've already understood the KDEDIRS/TDEDIRS renaming the first time you wrote that, there is no need to repeat in every comment. I also read the mailing list BTW.

For now, if the KDEDIRS variable is used/required by TDE 3.5.13, why should'nt the startup script modify it to the correct value for TDE ?

If you unset KDEDIRS or remove /usr from it, you lose not only the start menu items, but all the translations (and other shared stuffs) for KDE4 applications launched within TDE environment.
And I guess it has others side-effects that I've not seen yet.

About the start menu: I'm using TDE for corporate users. I won't deploy a "broken" configuration (not seeing all apps in start menu), then telling my users "hey, you can fix it yourself by opening a tool and clicking on some items". In fact, I'm not even sure that users are allowed to use the start menu editor ...
Everything *must* work out of the box (at least for newly created user profiles).

So, I think the "best workaround" for TDE 3.5.13 is to always add /opt/trinity first in KDEDIRS.
Comment 7 Darrell 2011-12-18 11:00:32 CST
You can handle KDEDIRS any way you want. The variable is intended to be user-defined. :) To satisfy my own preferences I have been modifying startkde for many years. :)

A challenge with KDEDIRS including /usr is on systems with KDE4 installed. When that is the case, the apps located in /usr/share/autostart, which mostly will be KDE4 apps, will start in the TDE environment, which for most people is not wanted.

If you do not have KDE4 installed then including KDEDIRS in startkde probably is doable.

A challenge with hard-coding KDEDIRS in startkde is the people who already have that variable pointed to their own preferred location get clobbered by the startkde script. There are people who do not want KDEDIRS defined at all. Hard-coding is not a good idea because the variable is intended to be user-defined.

People who use distros that support /etc/profile.d get around the problem by defining KDEDIRS there. I don't know a palatable solution for distros that don't use that directory.

The problem with non TDE apps not appearing in the menu probably is an XDG environment variable problem. We probably need to add some more options in the startkde script to ensure those apps get seen by TDE. Yet again the problem of having KDE4 installed will cause the T-menu to get cluttered with KDE4 apps. The TDE devs cleverly devised a way to distinguish TDE and KDE4 apps with the same name, but menu clutter is still the result. If KDE4 is not installed then this is not an issue, but TDE devs can't control or predict when KDE4 is installed and have to presume KDE4 is installed. In a true multi-user environment where users are allowed to choose their desktop environments, KDE4 likely will be installed.

The proposed startkde is just that: proposed. The default startkde that came with 3.5.13 causes problems for many people. The script needs attention and solid testing to be flexible for many distros. Please help with updating the script. I do a lot of TDE usability testing and likely will test any changes you offer with startkde.

If you are using TDE in a enterprise environment, I'm sure most of the devs want to hear your experiences in the mailing list. I'm not a dev, just a packager and all-around usability tester, but I certainly would like to hear your experiences with TDE in that environment.
Comment 8 Timothy Pearson 2012-01-11 13:11:56 CST
Marking as duplicate of bug 675 as KDEDIR* has been renamed to TDEDIR* in R14.0, and the remaining issues mentioned in this report should be addressed in the master startkde update/repairs bug.

*** This bug has been marked as a duplicate of bug 675 ***