From e95ee62574d1c3bd4535a36360ca229073baafb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 5 May 2020 18:17:21 +0000 Subject: [PATCH] Fix errors in translatable texts. --- openlp/core/app.py | 2 +- openlp/core/common/i18n.py | 4 ++-- openlp/core/common/json.py | 2 +- openlp/core/lib/db.py | 2 +- openlp/core/projectors/constants.py | 4 ++-- openlp/core/projectors/pjlink.py | 2 +- openlp/core/ui/thememanager.py | 2 +- openlp/core/ui/themeprogressdialog.py | 1 - openlp/core/widgets/widgets.py | 2 +- openlp/plugins/bibles/lib/importers/http.py | 2 +- openlp/plugins/media/forms/mediaclipselectorform.py | 4 ++-- .../plugins/planningcenter/forms/selectplandialog.py | 10 +++++----- .../plugins/planningcenter/forms/selectplanform.py | 6 ++++-- .../plugins/planningcenter/lib/planningcentertab.py | 4 ++-- .../plugins/planningcenter/planningcenterplugin.py | 12 ++++++------ openlp/plugins/presentations/lib/messagelistener.py | 2 +- openlp/plugins/songs/lib/importers/songbeamer.py | 2 +- tests/functional/openlp_core/common/test_settings.py | 2 +- .../openlp_plugins/presentations/test_mediaitem.py | 4 ++-- .../media/forms/test_mediaclipselectorform.py | 2 +- 20 files changed, 36 insertions(+), 35 deletions(-) diff --git a/openlp/core/app.py b/openlp/core/app.py index 11308c853..58dfeeacd 100644 --- a/openlp/core/app.py +++ b/openlp/core/app.py @@ -170,7 +170,7 @@ class OpenLP(QtCore.QObject, LogMixin): 'stored on removable device, that device needs to be made available.\n\nYou may ' 'reset the data location back to the default location, or you can try to make the ' 'current location available.\n\nDo you want to reset to the default data location? ' - 'If not, OpenLP will be closed so you can try to fix the the problem.') + 'If not, OpenLP will be closed so you can try to fix the problem.') .format(path=data_folder_path), QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No), QtWidgets.QMessageBox.No) diff --git a/openlp/core/common/i18n.py b/openlp/core/common/i18n.py index 180215934..80a4083c2 100644 --- a/openlp/core/common/i18n.py +++ b/openlp/core/common/i18n.py @@ -451,8 +451,8 @@ class UiStrings(metaclass=Singleton): self.View = translate('OpenLP.Ui', 'View') self.ViewMode = translate('OpenLP.Ui', 'View Mode') self.Video = translate('OpenLP.Ui', 'Video') - self.WebDownloadText = translate('OpenLP.Ui', 'Web Interface, Download and Install latest Version') - self.ZeroconfErrorIntro = translate('OpenLP.Ui', 'There was a problem avertising OpenLP\'s remote ' + self.WebDownloadText = translate('OpenLP.Ui', 'Web Interface, Download and Install Latest Version') + self.ZeroconfErrorIntro = translate('OpenLP.Ui', 'There was a problem advertising OpenLP\'s remote ' 'interface on the network:') self.ZeroconfGenericError = translate('OpenLP.Ui', 'An unknown error occurred') self.ZeroconfNonUniqueError = translate('OpenLP.Ui', 'OpenLP already seems to be advertising itself') diff --git a/openlp/core/common/json.py b/openlp/core/common/json.py index 0fd834b91..234b09a83 100644 --- a/openlp/core/common/json.py +++ b/openlp/core/common/json.py @@ -31,7 +31,7 @@ class JSONMixin(object): :cvar:`_json_keys` is used to specify the attributes of the subclass that you wish to serialize. :vartype _json_keys: list[str] - :cvar:`_name` set to override the the subclass name, useful if using a `proxy` class + :cvar:`_name` set to override the subclass name, useful if using a `proxy` class :vartype _name: str """ _json_keys = [] diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 95e87550b..93063f916 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -219,7 +219,7 @@ class PathType(types.TypeDecorator): def coerce_compared_value(self, op, value): """ - Some times it make sense to compare a PathType with a string. In the case a string is used coerce the the + Some times it make sense to compare a PathType with a string. In the case a string is used coerce the PathType to a UnicodeText type. :param op: The operation being carried out. Not used, as we only care about the type that is being used with the diff --git a/openlp/core/projectors/constants.py b/openlp/core/projectors/constants.py index 91cd014d5..2d70767f2 100644 --- a/openlp/core/projectors/constants.py +++ b/openlp/core/projectors/constants.py @@ -115,7 +115,7 @@ S_NETWORK_IDLE = 400 S_NETWORK_SENDING = 401 S_NETWORK_RECEIVING = 402 -# Map PJlink errors to local status +# Map PJLink errors to local status PJLINK_ERRORS = { 'ERRA': E_AUTHENTICATION, # Authentication error 'ERR1': E_UNDEFINED, # Undefined command error @@ -417,7 +417,7 @@ STATUS_MSG = { E_LAMP: translate('OpenLP.ProjectorConstants', 'Projector lamp error'), E_NETWORK: translate('OpenLP.ProjectorConstants', 'An error occurred with the network (Possibly someone pulled the plug?)'), - E_NO_AUTHENTICATION: translate('OpenLP.ProjectorConstants', 'PJlink authentication Mismatch Error'), + E_NO_AUTHENTICATION: translate('OpenLP.ProjectorConstants', 'PJLink authentication Mismatch Error'), E_NOT_CONNECTED: translate('OpenLP.ProjectorConstants', 'Projector not connected error'), E_PARAMETER: translate('OpenLP.ProjectorConstants', 'PJLink returned "ERR2: Invalid Parameter"'), E_PREFIX: translate('OpenLP.ProjectorConstants', 'PJLink Invalid prefix character'), diff --git a/openlp/core/projectors/pjlink.py b/openlp/core/projectors/pjlink.py index 0ecb1b53f..d7b615aac 100644 --- a/openlp/core/projectors/pjlink.py +++ b/openlp/core/projectors/pjlink.py @@ -207,7 +207,7 @@ class PJLink(QtNetwork.QTcpSocket): :param poll_time: Time (in seconds) to poll connected projector :param socket_timeout: Time (in seconds) to abort the connection if no response """ - log.debug('PJlink(projector="{projector}", args="{args}" kwargs="{kwargs}")'.format(projector=projector, + log.debug('PJLink(projector="{projector}", args="{args}" kwargs="{kwargs}")'.format(projector=projector, args=args, kwargs=kwargs)) super().__init__() diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index f4a91c307..410a43697 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -56,7 +56,7 @@ class Ui_ThemeManager(object): def setup_ui(self, widget): """ Define the UI - :param widget: The screen object the the dialog is to be attached to. + :param widget: The screen object the dialog is to be attached to. """ # start with the layout self.layout = QtWidgets.QVBoxLayout(widget) diff --git a/openlp/core/ui/themeprogressdialog.py b/openlp/core/ui/themeprogressdialog.py index deb9b471f..076c9f857 100644 --- a/openlp/core/ui/themeprogressdialog.py +++ b/openlp/core/ui/themeprogressdialog.py @@ -72,4 +72,3 @@ class UiThemeProgressDialog(object): :param about_dialog: The QDialog object to translate """ theme_progress_dialog.setWindowTitle(translate('OpenLP.Themes', 'Recreating Theme Thumbnails')) - self.label.setText(translate('OpenLP.Themes', 'TextLabel')) diff --git a/openlp/core/widgets/widgets.py b/openlp/core/widgets/widgets.py index af5a8dc64..c0aaea502 100644 --- a/openlp/core/widgets/widgets.py +++ b/openlp/core/widgets/widgets.py @@ -168,7 +168,7 @@ class ProxyDialog(QtWidgets.QDialog): def accept(self): """ - Reimplement the the accept slot so that the ProxyWidget settings can be saved. + Reimplement the accept slot so that the ProxyWidget settings can be saved. :rtype: None """ self.proxy_widget.save() diff --git a/openlp/plugins/bibles/lib/importers/http.py b/openlp/plugins/bibles/lib/importers/http.py index 70b9415fd..fb01fee86 100644 --- a/openlp/plugins/bibles/lib/importers/http.py +++ b/openlp/plugins/bibles/lib/importers/http.py @@ -810,7 +810,7 @@ def send_error_message(error_type): critical_error_message_box( translate('BiblesPlugin.HTTPBible', 'Download Error'), translate('BiblesPlugin.HTTPBible', 'There was a problem downloading your verse selection. Please check ' - 'your Internet connection, and if this error continues to occur please consider reporting a bug' + 'your Internet connection, and if this error continues to occur, please consider reporting a bug' '.')) elif error_type == 'parse': critical_error_message_box( diff --git a/openlp/plugins/media/forms/mediaclipselectorform.py b/openlp/plugins/media/forms/mediaclipselectorform.py index ac23bf4e2..1e23b1447 100644 --- a/openlp/plugins/media/forms/mediaclipselectorform.py +++ b/openlp/plugins/media/forms/mediaclipselectorform.py @@ -197,9 +197,9 @@ class MediaClipSelectorForm(QtWidgets.QDialog, Ui_MediaClipSelector, RegistryPro self.application.set_normal_cursor() return if not os.path.exists(path): - log.debug('Given path does not exists') + log.debug('Given path does not exist') critical_error_message_box(message=translate('MediaPlugin.MediaClipSelectorForm', - 'Given path does not exists')) + 'Given path does not exist')) self.toggle_disable_load_media(False) self.application.set_normal_cursor() return diff --git a/openlp/plugins/planningcenter/forms/selectplandialog.py b/openlp/plugins/planningcenter/forms/selectplandialog.py index fe4f227dd..81dd1f29c 100644 --- a/openlp/plugins/planningcenter/forms/selectplandialog.py +++ b/openlp/plugins/planningcenter/forms/selectplandialog.py @@ -76,11 +76,11 @@ class Ui_SelectPlanDialog(object): 'Import As New Service')) self.update_existing_button.setText(translate('PlanningCenterPlugin.PlanningCenterForm', 'Refresh Service')) self.update_existing_button.setToolTip(translate('PlanningCenterPlugin.PlanningCenterForm', - 'Refresh Existing Service from Planning Center. \ - This will update song lyrics or item orders that \ - have changed')) + 'Refresh Existing Service from Planning Center. ' + 'This will update song lyrics or item orders that ' + 'have changed')) self.edit_auth_button.setText(translate('PlanningCenterPlugin.PlanningCenterForm', 'Edit Authentication')) - self.edit_auth_button.setToolTip(translate('PlanningCenterPlugin.PlanningCenterForm', 'Edit the Application \ - ID and Secret Code to login to Planning Center Online')) + self.edit_auth_button.setToolTip(translate('PlanningCenterPlugin.PlanningCenterForm', 'Edit the Application ' + 'ID and Secret Code to login to Planning Center Online')) self.song_theme_selection_label.setText(translate('PlanningCenterPlugin.PlanningCenterForm', 'Song Theme')) self.slide_theme_selection_label.setText(translate('PlanningCenterPlugin.PlanningCenterForm', 'Slide Theme')) diff --git a/openlp/plugins/planningcenter/forms/selectplanform.py b/openlp/plugins/planningcenter/forms/selectplanform.py index f4148ef19..c2d15e369 100644 --- a/openlp/plugins/planningcenter/forms/selectplanform.py +++ b/openlp/plugins/planningcenter/forms/selectplanform.py @@ -68,8 +68,10 @@ class SelectPlanForm(QtWidgets.QDialog, Ui_SelectPlanDialog): # check our credentials and connection to the PlanningCenter server organization = self.planning_center_api.check_credentials() if len(organization) == 0: - QtWidgets.QMessageBox.warning(self.parent(), "Authentication Failed", "Authentiation Failed. Check your \ - credentials in OpenLP Settings", QtWidgets.QMessageBox.Ok) + QtWidgets.QMessageBox.warning(self.parent(), 'Authentication Failed', + 'Authentiation Failed. ' + 'Check your credentials in OpenLP Settings.', + QtWidgets.QMessageBox.Ok) return # set the Service Type Dropdown Box from PCO service_types_list = self.planning_center_api.get_service_type_list() diff --git a/openlp/plugins/planningcenter/lib/planningcentertab.py b/openlp/plugins/planningcenter/lib/planningcentertab.py index 189ad7eab..837e8d04a 100644 --- a/openlp/plugins/planningcenter/lib/planningcentertab.py +++ b/openlp/plugins/planningcenter/lib/planningcentertab.py @@ -75,8 +75,8 @@ class PlanningCenterTab(SettingsTab): self.notice_label.setText( translate('PlanningCenterPlugin.PlanningCenterTab', 'Note: ' - 'An Internet connection and a Planning Center Online Account are required in order to \ - import plans from Planning Center Online.') + 'An Internet connection and a Planning Center Online Account are ' + 'required in order to import plans from Planning Center Online.') ) self.instructions_label.setText( translate('PlanningCenterPlugin.PlanningCenterTab', diff --git a/openlp/plugins/planningcenter/planningcenterplugin.py b/openlp/plugins/planningcenter/planningcenterplugin.py index 56bf7c20e..71fcef267 100644 --- a/openlp/plugins/planningcenter/planningcenterplugin.py +++ b/openlp/plugins/planningcenter/planningcenterplugin.py @@ -73,8 +73,8 @@ class PlanningCenterPlugin(Plugin): text=translate('PlanningCenterPlugin', 'Planning Center Service'), visible=False, statustip=translate('PlanningCenterPlugin', - 'Import Planning Center Service Plan \ - from Planning Center Online.'), + 'Import Planning Center Service Plan ' + 'from Planning Center Online.'), triggers=self.on_import_planning_center_triggered ) import_menu.addAction(self.import_planning_center) @@ -102,8 +102,8 @@ class PlanningCenterPlugin(Plugin): PlanningCenter plugin """ return translate('PlanningCenterPlugin', 'PlanningCenter Plugin' - '
The planningcenter plugin provides an interface to import \ - service plans from the Planning Center Online v2 API.') + '
The planningcenter plugin provides an interface to import ' + 'service plans from the Planning Center Online v2 API.') def set_plugin_text_strings(self): """ @@ -124,8 +124,8 @@ class PlanningCenterPlugin(Plugin): # Middle Header Bar tooltips = { 'load': '', - 'import': translate('PlanningCenterPlugin', 'Import All Plan Items \ - into Current Service'), + 'import': translate('PlanningCenterPlugin', 'Import All Plan Items ' + 'into Current Service'), 'new': '', 'edit': '', 'delete': '', diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 22b1a4ce6..a90d5e702 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -35,7 +35,7 @@ log = logging.getLogger(__name__) class Controller(object): """ - This is the Presentation listener who acts on events from the slide controller and passes the messages on the the + This is the Presentation listener who acts on events from the slide controller and passes the messages on the correct presentation handlers. """ log.info('Controller loaded') diff --git a/openlp/plugins/songs/lib/importers/songbeamer.py b/openlp/plugins/songs/lib/importers/songbeamer.py index 56c783690..cb67c5481 100644 --- a/openlp/plugins/songs/lib/importers/songbeamer.py +++ b/openlp/plugins/songs/lib/importers/songbeamer.py @@ -431,5 +431,5 @@ class SongBeamerImport(SongImport): if audio_file_path.is_file(): self.add_media_file(audio_file_path) else: - log.debug('Could not import mediafile "{audio_file_path}" since it does not exists!' + log.debug('Could not import mediafile "{audio_file_path}" since it does not exist!' .format(audio_file_path=audio_file_path)) diff --git a/tests/functional/openlp_core/common/test_settings.py b/tests/functional/openlp_core/common/test_settings.py index fe13ad29c..6c985ebef 100644 --- a/tests/functional/openlp_core/common/test_settings.py +++ b/tests/functional/openlp_core/common/test_settings.py @@ -139,7 +139,7 @@ def test_settings_nonexisting(): """Test the Settings on query for non-existing value""" # GIVEN: A new Settings setup with pytest.raises(KeyError) as cm: - # WHEN reading a setting that doesn't exists + # WHEN reading a setting that doesn't exist Settings().value('core/does not exists') # THEN: An exception with the non-existing key should be thrown diff --git a/tests/functional/openlp_plugins/presentations/test_mediaitem.py b/tests/functional/openlp_plugins/presentations/test_mediaitem.py index 79d93c970..706f969c9 100644 --- a/tests/functional/openlp_plugins/presentations/test_mediaitem.py +++ b/tests/functional/openlp_plugins/presentations/test_mediaitem.py @@ -73,7 +73,7 @@ def test_build_file_mask_string(media_item): def test_clean_up_thumbnails(media_item): """ - Test that the clean_up_thumbnails method works as expected when files exists. + Test that the clean_up_thumbnails method works as expected when files exist. """ # GIVEN: A mocked controller, and mocked os.path.getmtime mocked_disabled_controller = MagicMock() @@ -123,7 +123,7 @@ def test_clean_up_thumbnails_missing_file(media_item): # WHEN: calling clean_up_thumbnails media_item.clean_up_thumbnails(presentation_file, True) - # THEN: doc.presentation_deleted should have been called since the presentation file did not exists. + # THEN: doc.presentation_deleted should have been called since the presentation file did not exist. mocked_doc.assert_has_calls([call.get_thumbnail_path(1, True), call.presentation_deleted()], True) diff --git a/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py b/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py index 6cf75fa00..be424c009 100644 --- a/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py +++ b/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py @@ -99,7 +99,7 @@ def test_click_load_button(form): # THEN: we should get an error assert form.media_path_combobox.currentText() == '/non-existing/test-path.test',\ 'The media path should be the given one.' - mocked_critical_error_message_box.assert_called_with(message='Given path does not exists') + mocked_critical_error_message_box.assert_called_with(message='Given path does not exist') # WHEN: The load button is clicked with a mocked existing path mocked_os_path_exists.return_value = True