search in plural forms after all
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>
Mon, 19 Aug 2013 15:47:40 +0000 (17:47 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 27 Aug 2013 11:41:48 +0000 (13:41 +0200)
our search is not fuzzy, so for some languages it makes a lot of sense
to search in the plurals, as they may use different grammatical forms.

Task-number: QTBUG-32218
Change-Id: I9ba2e370f9bcc564e707b2339ab0b1e73935c03d
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
src/linguist/linguist/mainwindow.cpp

index 3479ed1..4ffe221 100644 (file)
@@ -1004,16 +1004,16 @@ void MainWindow::findAgain()
                         if (searchItem(DataModel::Comments, m->extraComment()))
                             break;
                     }
-                    // Note: we do not look into plurals on grounds of them not
-                    // containing anything much different from the singular.
-                    if (searchItem(DataModel::Translations, m->translation()))
-                        break;
+                    foreach (const QString &trans, m->translations())
+                        if (searchItem(DataModel::Translations, trans))
+                            goto didfind;
                     if (searchItem(DataModel::Comments, m->translatorComment()))
                         break;
                     found = false;
                     // did not find the search string in this message
                 } while (0);
                 if (found) {
+                  didfind:
                     setCurrentMessage(realIndex, i);
 
                     // determine whether the search wrapped