Bug 276023 - JJ: untranslatable search queries "genre:Rock OR genre:Pop" and "tracknumber:1"
Summary: JJ: untranslatable search queries "genre:Rock OR genre:Pop" and "tracknumber:1"
Alias: None
Product: amarok
Classification: Applications
Component: Playlists/Dynamic Playlists (show other bugs)
Version: 2.6-git
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: 2.7
Assignee: Amarok Developers
Keywords: junior-jobs
Depends on:
Reported: 2011-06-19 08:56 UTC by Alexander Potashev
Modified: 2012-11-26 15:47 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2:7


Note You need to log in before you can comment on or make changes to this bug.
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

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

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.