Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit bd321190 authored by Alex Neundorf's avatar Alex Neundorf

Search&Replace: try to fix issues with plural in 18np()

The number of arguments between singular and plural may differ
only by up to one, so build the text together from two
strings...
parent dcdcb854
......@@ -1535,24 +1535,29 @@ void KatePluginSearchView::updateResultsRootItem()
}
}
// since the number of arguments may differ only by one between singular and plural,
// build the string together from two pieces...
QString checkedItemsStr = m_curResults->matches <= 1 ? QString()
: i18np("unused", "%1 checked", checkedItemCount);
switch (m_ui.searchPlaceCombo->currentIndex())
{
case CurrentFile:
root->setData(0, Qt::DisplayRole, i18np("<b><i>One match found in current file</i></b>",
"<b><i>%1 matches (%2 checked) found in current file</i></b>",
m_curResults->matches, checkedItemCount));
root->setData(0, Qt::DisplayRole, i18np("<b><i>One match found in current file</i></b>%2",
"<b><i>%1 matches (%2) found in current file</i></b>",
m_curResults->matches, checkedItemsStr));
break;
case OpenFiles:
root->setData(0, Qt::DisplayRole, i18np("<b><i>One match found in open files</i></b>",
"<b><i>%1 matches (%2 checked) found in open files</i></b>",
m_curResults->matches, checkedItemCount));
root->setData(0, Qt::DisplayRole, i18np("<b><i>One match found in open files</i></b>%2",
"<b><i>%1 matches (%2) found in open files</i></b>",
m_curResults->matches, checkedItemsStr));
break;
case Folder:
root->setData(0, Qt::DisplayRole, i18np("<b><i>One match found in folder %2</i></b>",
"<b><i>%1 matches (%3 checked) found in folder %2</i></b>",
root->setData(0, Qt::DisplayRole, i18np("<b><i>One match found in folder %2</i></b>%3",
"<b><i>%1 matches (%3) found in folder %2</i></b>",
m_curResults->matches,
m_resultBaseDir,
checkedItemCount));
checkedItemsStr));
break;
case Project:
{
......@@ -1560,20 +1565,20 @@ void KatePluginSearchView::updateResultsRootItem()
if (m_projectPluginView) {
projectName = m_projectPluginView->property("projectName").toString();
}
root->setData(0, Qt::DisplayRole, i18np("<b><i>One match found in project %2 (%3)</i></b>",
"<b><i>%1 matches (%4 checked) found in project %2 (%3)</i></b>",
root->setData(0, Qt::DisplayRole, i18np("<b><i>One match found in project %2 (%3)</i></b>%4",
"<b><i>%1 matches (%4) found in project %2 (%3)</i></b>",
m_curResults->matches,
projectName,
m_resultBaseDir,
checkedItemCount));
checkedItemsStr));
break;
}
case AllProjects: // "in Open Projects"
root->setData(0, Qt::DisplayRole, i18np("<b><i>One match found in all open projects (common parent: %2)</i></b>",
"<b><i>%1 matches (%3 checked) found in all open projects (common parent: %2)</i></b>",
root->setData(0, Qt::DisplayRole, i18np("<b><i>One match found in all open projects (common parent: %2)</i></b>%3",
"<b><i>%1 matches (%3) found in all open projects (common parent: %2)</i></b>",
m_curResults->matches,
m_resultBaseDir,
checkedItemCount));
checkedItemsStr));
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment