Bug 201243

Summary: KRunner lost functionalities due to translating two words into one word
Product: [Plasma] krunner Reporter: Martin Flöser <mgraesslin>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: aacid, leviatan1, wilderkde
Priority: HI    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Unspecified   
Latest Commit: Version Fixed In:

Description Martin Flöser 2009-07-23 16:43:36 UTC
Version:            (using KDE 4.2.96)
Installed from:    Ubuntu Packages

Reporting in English although it's for German locale as I think the problem might be a general problem. So when you think it is not a problem of the translation please reassign to appropriate product - I guess plasma.

I had a look at some KRunners today and I noticed that the KRunner keyword "power profile" is translated to one word "Energieprofil" in German. That's in general OK and the keyword is marked with "Note this is a KRunner keyword".

Now I had a look at the code and noticed that there is functionality relying on the fact that the keyword consists of two words (kdebase/workspace/plasma/runners/powerdevil/PowerDevilRunner.cpp line 186 following):
if (term.startsWith(i18nc( "Note this is a KRunner keyword", "power profile"))) {
foreach( const QString &profile, m_availableProfiles ) {
    if ( term.split( ' ' ).count() == 3 ) {
        if ( !profile.startsWith( term.split( ' ' ).at( 2 ) ) ) {
            continue;
        }
    }

So as soon as you start to enter another word it will only list those matching. E.g. "power profile Perfor..." will only list the Performance entry. If I want to do the same in German with "Energieprofil Perf..." the non-matching entries are not hidden as the first check for three parts fail. If I add another word the match works again. E.g: "Energieprofil foo Perf..."

This is rather annoying as the translation removes functionality. Of course the translators cannot know that there is functionality checking for the number of words. Btw. if the translation would be more words the result would be worse.
Comment 1 Pino Toscano 2009-07-23 20:10:58 UTC
Well, IMHO it is more a problem of krunner in general.
Albert?
Comment 2 Albert Astals Cid 2009-07-23 23:08:49 UTC
Man in which mind is this a translation bug?

That's a krunner bug for sure, it's not viable to hardcode the number of words a translation must have
Comment 3 Albert Astals Cid 2009-07-23 23:09:31 UTC
Err, sorry, reassigned to wrong product, reassigning to plasma
Comment 4 francisco_t 2009-08-10 22:16:20 UTC
I have the problem with spanish.

For example the command 'power profile', in spanish 'perfil de energia' doesn't works.

The problem is in kde 4.1, 4.2.4 and 4.3.
Comment 5 Jacopo De Simoi 2010-01-12 00:09:58 UTC
SVN commit 1073303 by jacopods:

Correctly parse strings for non-english locales as well. Thanks to the l10n team for allowing this fix
Bonus fix: also make parsing case insensitive
BUG: 201243
BUG: 208962
CCMAIL: kde-i18n-doc@kde.org


 M  +44 -20    PowerDevilRunner.cpp  
 M  +1 -0      PowerDevilRunner.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1073303
Comment 6 Jacopo De Simoi 2010-01-12 00:12:37 UTC
SVN commit 1073306 by jacopods:

Fix parsing errors in non-english locale + case insensitive match
CCBUG: 201243
CCBUG: 208962    


 M  +44 -20    PowerDevilRunner.cpp  
 M  +1 -0      PowerDevilRunner.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1073306