diff --git a/openlp/core/common/uistrings.py b/openlp/core/common/uistrings.py index 3c8477864..e23fc3f40 100644 --- a/openlp/core/common/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -112,6 +112,7 @@ class UiStrings(object): self.NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') self.NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') self.NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') + self.NoResults = translate('OpenLP.Ui', 'No Search Results') self.OLP = translate('OpenLP.Ui', 'OpenLP') self.OLPV2 = "{name} {version}".format(name=self.OLP, version="2") self.OLPV2x = "{name} {version}".format(name=self.OLP, version="2.4") @@ -139,6 +140,7 @@ class UiStrings(object): self.Settings = translate('OpenLP.Ui', 'Settings') self.SaveService = translate('OpenLP.Ui', 'Save Service') self.Service = translate('OpenLP.Ui', 'Service') + self.ShortResults = translate('OpenLP.Ui', 'Please type more text to use \'Search As You Type\'') self.Split = translate('OpenLP.Ui', 'Optional &Split') self.SplitToolTip = translate('OpenLP.Ui', 'Split a slide into two only if it does not fit on the screen as one slide.') diff --git a/openlp/core/ui/lib/listwidgetwithdnd.py b/openlp/core/ui/lib/listwidgetwithdnd.py index 23bdbcd2d..de601fa13 100644 --- a/openlp/core/ui/lib/listwidgetwithdnd.py +++ b/openlp/core/ui/lib/listwidgetwithdnd.py @@ -26,10 +26,7 @@ import os from PyQt5 import QtCore, QtGui, QtWidgets -from openlp.core.common import Registry, translate - -NO_RESULTS = translate('OpenLP.ListWidgetWithDnD', 'No Search Results') -SHORT_RESULTS = translate('OpenLP.ListWidgetWithDnD', 'Please type more text to use \'Search As You Type\'') +from openlp.core.common import Registry, UiStrings class ListWidgetWithDnD(QtWidgets.QListWidget): @@ -42,7 +39,7 @@ class ListWidgetWithDnD(QtWidgets.QListWidget): """ super().__init__(parent) self.mime_data_text = name - self.no_results_text = NO_RESULTS + self.no_results_text = UiStrings().NoResults def activateDnD(self): """ @@ -60,9 +57,9 @@ class ListWidgetWithDnD(QtWidgets.QListWidget): :return: None """ if search_while_typing: - self.no_results_text = SHORT_RESULTS + self.no_results_text = UiStrings().ShortResults else: - self.no_results_text = NO_RESULTS + self.no_results_text = UiStrings().NoResults super().clear() def mouseMoveEvent(self, event):