Bug 200592 - Molecular editor dropdown for style not working correctly in German locale
Summary: Molecular editor dropdown for style not working correctly in German locale
Status: RESOLVED FIXED
Alias: None
Product: kalzium
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Kalzium Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-17 21:04 UTC by roglon
Modified: 2009-07-25 18:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description roglon 2009-07-17 21:04:31 UTC
Version:           2.2.98 (using KDE 4.2.96)
OS:                Linux
Installed from:    SuSE RPMs

When I set LANG to en_US.UTF-8 and start kalzium the molecular editor gives me four choices for display style: Balls and sticks, Sticks, Van der Waals, Wireframe. All of them seem to switch the molecules as expected.

But when I use LANG = de_DE.UTF-8 (German, my normal setting) and start kalzium the dropdown is not working any more. The three choices are now named: "Kugeln und Stäbe", "Stäbe", "Van der Waals-Radius", "Draht". 
Only "Kugeln und Stäbe" (Balls and sticks) and "Van der Waals" are working fine. "Stäbe" and "Draht" are both displaying other things as expected. "Draht" (Wireframe) displays the same as "Balls and sticks" and "Stäbe" displays a strange mixture.

Maybe the textual content of the dropdown is used to distinguish which mode to use and assumes that English language is used?
Comment 1 roglon 2009-07-17 21:05:47 UTC
Sorry for fat follow up, but forget to mention that "display" in my report means "display in the 3D window of the molecule", not display of the dropdown itself!
Comment 2 Marcus D. Hanwell 2009-07-20 17:54:39 UTC
I committed a fix in SVN revision 999926 - can you apply that patch and confirm that this works for you? There has been a lot of work in the Avogadro library to improve i18n support, but the display style selection code was not using the new functions that are i18n safe.
Comment 3 roglon 2009-07-20 21:23:35 UTC
Hi, I used SVN revision 1000056 of complete project and build kalzium according to instructions. With LANG in English it is working fine (as before) but with LANG = German it is not working. Strangly the handling in the Molecule window is now changed (left mouse is now right and vice versa?). But now to the localization problem:

"Kugeln und Stäbe" is working as expected (as before)
"Stäbe" (Sticks) is working as expected (unlike before!)
"Van der Waals-Radius" is only showing the symbols/names, but no molecule graphics anymore (unlike before, when it was working)
"Draht" (Wireframe) is only showing the symbols/names, but no molecule graphics anymore

If you want I can upload screenshots.
Comment 4 Marcus D. Hanwell 2009-07-20 22:07:41 UTC
I am not sure what happened with the mouse handling - I did not make any changes to that code. The code uses the index of the combo box to select the display type, as far as I can see with my recent changes two untranslated strings are getting compared, e.g. if (engine->identifier() == "Van der Waals Spheres"). The identifier function is not translated, the names function is.

We could add some debug output for the console to see if that can narrow down the issue. I would like to get this fixed for the 4.3 release if possible. I will see if I can get the German translations installed on my system to test this out locally. Thanks for reporting the issue and testing my patch so quickly.
Comment 5 roglon 2009-07-20 22:34:12 UTC
As there is some debugging output on the console allready, I can provide you with what I saw when Molecule viewer is startet with English locale:

Found Engine:  "Dynamic Ball and Stick"  -  "Renders primitives using Balls (atoms) and Sticks (bonds).  Includes demonstration of dynamic rendering based on distance from camera"
Found Engine:  "Label"  -  "Renders primitive labels"
Found Engine:  "Sphere"  -  "Renders atoms as spheres"
Found Engine:  "Stick"  -  "Renders as Cylinders"
Found Engine:  "Wireframe"  -  "Wireframe rendering"
"libnavigatetool-kalzium.so"
Found Tool:  "Navigate"  -  "Navigation Tool"
OpenGL extension GL_ARB_texture_rectangle is present.


And with German locale:

Found Engine:  "Dynamic Ball and Stick"  -  "Renders primitives using Balls (atoms) and Sticks (bonds).  Includes demonstration of dynamic rendering based on distance from camera"
Found Engine:  "Label"  -  "Renders primitive labels"
Found Engine:  "Kugel"  -  "Renders atoms as spheres"
Found Engine:  "Stick"  -  "Renders as Cylinders"
Found Engine:  "Draht"  -  "Wireframe rendering"
"libnavigatetool-kalzium.so"
Found Tool:  "Navigieren"  -  "Navigation Tool"
OpenGL extension GL_ARB_texture_rectangle is present.

So 2x the engine->name() is the same ("Label" and "Stick") and 2x its different.
Comment 6 Marcus D. Hanwell 2009-07-20 23:08:25 UTC
The labels look wrong to me - it looks like you are linking to an old libavogadro, or loading stale plugins. Try ldd `which kalzium` to verify what libavogadro-kalzium is being linked to. They look like really old engine names/descriptions.
Comment 7 roglon 2009-07-20 23:31:00 UTC
The command "ldd `which kalzium` | grep avogadro" gave me

libavogadro-kalzium.so.0 => /usr/lib/libavogadro-kalzium.so.0 (0xb770c000)

with changing numbers in the "()"

and this library was compiled and installed with current SVN version of kalzium when I did the test:

lrwxrwxrwx 1 root root      28 2009-07-20 21:12 /usr/lib/libavogadro-kalzium.so.0 -> libavogadro-kalzium.so.0.0.1
-rwxr-xr-x 1 root root 4678949 2009-07-20 21:12 /usr/lib/libavogadro-kalzium.so.0.0.1

Ok, the low version number of 0.0.1 indicates that the library may be not so fresh. But where should I look for newer version?
Comment 8 Marcus D. Hanwell 2009-07-20 23:57:50 UTC
It should be libavogadro-kalzium.so.0.9.3, and that would be installed in whatever CMAKE_INSTALL_PREFIX you defined, inside the library directory. Inside that library directory there would also be an avogadro-kalzium directory containing all the plugins. I have all of my SVN stuff in /usr/kde/live prefix for example. This depends upon your build environment. Did you compile and install into the /usr hierarchy? I think it would default to /usr/local unless you changed it.
Comment 9 roglon 2009-07-21 17:21:38 UTC
Yes, I gave CMAKE_INSTALL_PREFIX=/usr to the cmake.
Now I tried complete fresh compile with CMAKE_INSTALL_PREFIX=/usr/local/test and the library seems to be the same (with low version number). In /usr/local/test/lib/ there is still 0.0.1 version of libavogadro-kalzium.so. This version gets installed when I do a "make install" in build/libkdeedu. I have no idea at moment how I could get the 0.9.3 version of the lib.
Comment 10 Marcus D. Hanwell 2009-07-22 19:06:03 UTC
I have no idea, libavogadro-kalzium is in the kalzium source directory, not libkdeedu. I do not get any such library when I do a make install in libkdeedu. At a guess I think you have some stale files somewhere in your source/build directories. I am unable to reproduce what you are seeing here.
Comment 11 roglon 2009-07-23 21:50:48 UTC
I deleted all files and folders of my recent install tries (sources and install folders) and checked out the complete sources again from SVN revision 1001619. 
Build everything from scratch according to instructions and it is still the same low version. I took closer look and you are right: The lib is not installed from "libkdeedu", it is from kalziums subfolder as you said. 
I did "make" in kalzium/libavogadro-kalzium and "make install" and it is still 0.0.1. I do not find the failure for this. Sorry for not beeing able to help on this, but I am clueless at moment about this.


--snip--
Install the project...
-- Install configuration: "debugfull"
-- Up-to-date: /usr/local/test/lib/libavogadro-kalzium.so.0.0.1
-- Up-to-date: /usr/local/test/lib/libavogadro-kalzium.so.0
-- Up-to-date: /usr/local/test/lib/libavogadro-kalzium.so
-- Up-to-date: /usr/local/test/lib/avogadro-kalzium/engines/libbsdyengine-kalzium.so
-- Up-to-date: /usr/local/test/lib/avogadro-kalzium/engines/liblabelengine-kalzium.so
-- Up-to-date: /usr/local/test/lib/avogadro-kalzium/engines/libwireengine-kalzium.so
-- Up-to-date: /usr/local/test/lib/avogadro-kalzium/engines/libsphereengine-kalzium.so
-- Up-to-date: /usr/local/test/lib/avogadro-kalzium/engines/libstickengine-kalzium.so
-- Up-to-date: /usr/local/test/lib/avogadro-kalzium/tools/libnavigatetool-kalzium.so
kalzium/libavogadro-kalzium>
Comment 12 Marcus D. Hanwell 2009-07-23 22:00:42 UTC
Are you possibly checking out a branch or something? what URL does svn info give you in the kalzium source directory? What svn checkout command are you using?
Comment 13 roglon 2009-07-23 23:19:08 UTC
Hmm. if "branch(es)" is bad, than I may have a wrong repository checkout (checkout with svn co svn://anonsvn.kde.org/home/kde/branches/KDE/4.0/kdeedu):

URL: svn://anonsvn.kde.org/home/kde/branches/KDE/4.0/kdeedu/kalzium
Repository Root: svn://anonsvn.kde.org/home/kde
Comment 14 Marcus D. Hanwell 2009-07-23 23:39:05 UTC
Yeah, that is an ancient branch for the 4.0.x releases. You need to checkout and compile trunk, most distros are shipping KDE 4.2, and 4.3 has just been branched. The http://techbase.kde.org/Getting_Started page provides links to getting set up, and what to checkout. Most distros also provide live builds if you know where to look for them.

I think the commit I made will have fixed your issue, but it is in trunk. No further 4.0.x or 4.1.x releases will be made. I will see about getting this into the 4.3 branch for the release of KDE 4.3.
Comment 15 roglon 2009-07-24 20:29:07 UTC
Shame on me.
I now checked out with svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdeedu Revision 1001993 and (heureka) now (a) the version of libavogadro-kalzium.so is as expected, (b) mouse buttons are also working as expected and finally (c)

your fix seems to have fixed the problem I reported. All dropdowns are working fine now in German localisation and in English as expected. I tested many variations and all worked like it should in my eyes.

Sorry for confusing branches and trunk and resulting in senseless loss of time!
And thanks for fixing one of my favourite apps :o)
Comment 16 Marcus D. Hanwell 2009-07-25 18:36:51 UTC
Backported to the 4.3 branch in commit 1002310. This will make it into the 4.3 release. Thanks for reporting the issue and testing my fix, I am glad we could establish this was corrected in time to get it in for the 4.3 release.