Bug 276023

Summary: JJ: untranslatable search queries "genre:Rock OR genre:Pop" and "tracknumber:1"
Product: [Applications] amarok Reporter: Alexander Potashev <aspotashev>
Component: Playlists/Dynamic PlaylistsAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: lfranchi, matej, ralf-engels
Priority: NOR Keywords: junior-jobs
Version: 2.6-git   
Target Milestone: 2.7   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 2:7
Sentry Crash Report:

Description Alexander Potashev 2011-06-19 08:56:35 UTC
Version:           2.4-GIT (using KDE 4.6.4) 
OS:                Linux

See src/dynamic/DynamicModel.cpp, lines 921 and 930:
921. playlist->bias()->replace( Dynamic::BiasPtr( new Dynamic::SearchQueryBias( "genre:Rock OR genre:Pop" ) ) );
930. ifElse->appendBias( Dynamic::BiasPtr( new Dynamic::SearchQueryBias( "tracknumber:1" ) ) );

Reproducible: Always
Comment 1 Matěj Laitl 2012-11-24 10:24:30 UTC
Git commit 393f9b340e2f7cfa5531e5eaefa8ba0d85c81671 by Matěj Laitl.
Committed on 23/11/2012 at 18:26.
Pushed by laitl into branch 'master'.

DynamicModel: avoid untranslatable strings

However, "AND" and "OR" in search queries are still untranslatable
(because they wouldn't work otherwise). This is at least documented in
code.
FIXED-IN: 2:7

M  +1    -0    ChangeLog
M  +8    -2    src/dynamic/DynamicModel.cpp

http://commits.kde.org/amarok/393f9b340e2f7cfa5531e5eaefa8ba0d85c81671
Comment 2 Alexander Potashev 2012-11-25 21:15:59 UTC
Why not translating OR and/or AND?
Comment 3 Matěj Laitl 2012-11-26 15:47:24 UTC
(In reply to comment #2)
> Why not translating OR and/or AND?

Because the parser is not i10n - aware enough. Additionally, problems may arise when those are translated, for example AND in Czech can be translated as "A" (too ambiguous) or "A ZÁROVEŇ" (more corrent, but 2-word), so I've decided not to do this now. Note that the GUI to construct the query already uses translated versions of "AND" and "OR".

If you're keen, you can try to do this, we're happy to review and accept patches. Links to the parser are in my commit above.