From 3c096b4d0aba715b2e04665e14fe59d55cb56117 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 15:42:24 +0200 Subject: [PATCH] Fixed translate() function in PresentationPlugin --- openlp/plugins/presentations/lib/mediaitem.py | 21 ++++++++++++------- .../presentations/lib/presentationtab.py | 10 ++++++--- .../presentations/presentationplugin.py | 9 ++++---- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 462d1a924..91dc6aed5 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -61,11 +61,14 @@ class PresentationMediaItem(MediaManagerItem): self.message_listener = MessageListener(self) def initPluginNameVisible(self): - self.PluginNameVisible = translate('MediaItem','Presentation') + self.PluginNameVisible = translate(u'PresentationPlugin.MediaItem', + u'Presentation') def retranslateUi(self): - self.OnNewPrompt = translate('MediaItem','Select Presentation(s)') - self.Automatic = translate('MediaItem','Automatic') + self.OnNewPrompt = translate(u'PresentationPlugin.MediaItem', + u'Select Presentation(s)') + self.Automatic = translate(u'PresentationPlugin.MediaItem', + u'Automatic') fileType = u'' for controller in self.controllers: if self.controllers[controller].enabled: @@ -75,7 +78,8 @@ class PresentationMediaItem(MediaManagerItem): if fileType.find(type) == -1: fileType += u'*%s ' % type self.parent.service_manager.supportedSuffixes(type) - self.OnNewFileMasks = translate('MediaItem','Presentations (%s)' % fileType) + self.OnNewFileMasks = translate(u'PresentationPlugin.MediaItem', + u'Presentations (%s)' % fileType) def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -101,7 +105,8 @@ class PresentationMediaItem(MediaManagerItem): self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget) self.DisplayTypeLabel.setObjectName(u'SearchTypeLabel') self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1) - self.DisplayTypeLabel.setText(translate('MediaItem','Present using:')) + self.DisplayTypeLabel.setText( + translate(u'PresentationPlugin.MediaItem', u'Present using:')) # Add the Presentation widget to the page layout self.PageLayout.addWidget(self.PresentationWidget) @@ -134,8 +139,10 @@ class PresentationMediaItem(MediaManagerItem): (path, filename) = os.path.split(unicode(file)) if titles.count(filename) > 0: QtGui.QMessageBox.critical( - self, translate('MediaItem','File exists'), translate('MediaItem', - 'A presentation with that filename already exists.'), + self, translate(u'PresentationPlugin.MediaItem', + u'File exists'), + translate(u'PresentationPlugin.MediaItem', + u'A presentation with that filename already exists.'), QtGui.QMessageBox.Ok) else: icon = None diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 01854f8e6..89546e039 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -37,7 +37,8 @@ class PresentationTab(SettingsTab): def setupUi(self): self.setObjectName(u'PresentationTab') - self.tabTitleVisible = translate('PresentationTab','Presentations') + self.tabTitleVisible = translate(u'PresentationPlugin.PresentationTab', + u'Presentations') self.PresentationLayout = QtGui.QHBoxLayout(self) self.PresentationLayout.setSpacing(8) self.PresentationLayout.setMargin(8) @@ -88,12 +89,15 @@ class PresentationTab(SettingsTab): self.PresentationLayout.addWidget(self.PresentationRightWidget) def retranslateUi(self): - self.VerseDisplayGroupBox.setTitle(translate('PresentationTab','Available Controllers')) + self.VerseDisplayGroupBox.setTitle( + translate(u'PresentationPlugin.PresentationTab', + u'Available Controllers')) for key in self.controllers: controller = self.controllers[key] checkbox = self.PresenterCheckboxes[controller.name] checkbox.setText( - u'%s %s' % (controller.name, translate('PresentationTab','available'))) + u'%s %s' % (controller.name, + translate(u'PresentationPlugin.PresentationTab', u'available'))) def load(self): for key in self.controllers: diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 8ebf19250..036e8fc42 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -108,9 +108,10 @@ class PresentationPlugin(Plugin): return False def about(self): - about_text = translate('PresentationPlugin','Presentation Plugin
Delivers ' - 'the ability to show presentations using a number of different ' - 'programs. The choice of available presentation programs is ' - 'available to the user in a drop down box.') + about_text = translate(u'PresentationPlugin.PresentationPlugin', + u'Presentation Plugin
Delivers ' + u'the ability to show presentations using a number of different ' + u'programs. The choice of available presentation programs is ' + u'available to the user in a drop down box.') return about_text