From 531e50a4174af16d25cfb82ecf6b63c8b12c2a16 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 17:25:51 +0000 Subject: [PATCH 1/5] Fix translation breaking strings --- openlp/core/lib/plugin.py | 38 ++++++++++--------- openlp/core/lib/ui.py | 22 ++--------- openlp/core/ui/mainwindow.py | 9 ++--- openlp/core/ui/servicemanager.py | 14 +++---- openlp/core/ui/thememanager.py | 12 +++--- openlp/plugins/bibles/bibleplugin.py | 16 +++++--- openlp/plugins/custom/customplugin.py | 17 ++++++--- openlp/plugins/images/imageplugin.py | 13 ++++++- openlp/plugins/media/mediaplugin.py | 13 ++++++- .../presentations/presentationplugin.py | 16 +++++++- openlp/plugins/songs/songsplugin.py | 13 ++++++- 11 files changed, 112 insertions(+), 71 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index a073d31ea..a525e70cc 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -335,37 +335,39 @@ class Plugin(QtCore.QObject): """ return self.textStrings[name] - def setPluginTextStrings(self): + def setPluginUiTextStrings(self, tooltips): """ Called to define all translatable texts of the plugin """ ## Load Action ## - self._setSingularTextString(StringContent.Load, - UiStrings.Load, UiStrings.LoadANew) + self.__setNameTextString(StringContent.Load, + UiStrings.Load, tooltips[load]) + ## Import Action ## + self.__setNameTextString(StringContent.Import, + UiStrings.Import, tooltips[import]) ## New Action ## - self._setSingularTextString(StringContent.New, - UiStrings.Add, UiStrings.AddANew) + self.__setNameTextString(StringContent.New, + UiStrings.Add, tooltips[new]) ## Edit Action ## - self._setSingularTextString(StringContent.Edit, - UiStrings.Edit, UiStrings.EditSelect) + self.__setNameTextString(StringContent.Edit, + UiStrings.Edit, tooltips[edit]) ## Delete Action ## - self._setSingularTextString(StringContent.Delete, - UiStrings.Delete, UiStrings.DeleteSelect) + self.__setNameTextString(StringContent.Delete, + UiStrings.Delete, tooltips[delete]) ## Preview Action ## - self._setSingularTextString(StringContent.Preview, - UiStrings.Preview, UiStrings.PreviewSelect) + self.__setNameTextString(StringContent.Preview, + UiStrings.Preview, tooltips[preview]) ## Send Live Action ## - self._setSingularTextString(StringContent.Live, - UiStrings.Live, UiStrings.SendSelectLive) + self.__setNameTextString(StringContent.Live, + UiStrings.Live, tooltips[live]) ## Add to Service Action ## - self._setSingularTextString(StringContent.Service, - UiStrings.Service, UiStrings.AddSelectService) + self.__setNameTextString(StringContent.Service, + UiStrings.Service, tooltips[service]) - def _setSingularTextString(self, name, title, tooltip): + def __setNameTextString(self, name, title, tooltip): """ Utility method for creating a plugin's textStrings. This method makes use of the singular name of the plugin object so must only be called after this has been set. """ - self.textStrings[name] = { u'title': title, u'tooltip': tooltip % - self.getString(StringContent.Name)[u'singular']} + self.textStrings[name] = {u'title': title, u'tooltip': tooltip} diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 400381b0c..48a932ab1 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -41,40 +41,26 @@ class UiStrings(object): # These strings should need a good reason to be retranslated elsewhere. # Should some/more/less of these have an & attached? Add = translate('OpenLP.Ui', '&Add') - AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s.')) - AddSelectService = unicode(translate('OpenLP.Ui', - 'Add the selected %s to the service.')) Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Authors = translate('OpenLP.Ui', 'Authors') - CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.')) + CreateService = translate('OpenLP.Ui', 'Create a new service.') Delete = translate('OpenLP.Ui', '&Delete') - DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) - DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s')) Edit = translate('OpenLP.Ui', '&Edit') - EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s.')) - EditType = unicode(translate('OpenLP.Ui', 'Edit %s')) Error = translate('OpenLP.Ui', 'Error') - ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) Import = translate('OpenLP.Ui', 'Import') - ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) - LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) Live = translate('OpenLP.Ui', 'Live') Load = translate('OpenLP.Ui', 'Load') - LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) New = translate('OpenLP.Ui', 'New') - NewType = unicode(translate('OpenLP.Ui', 'New %s')) + NewService = translate('OpenLP.Ui', 'New Service') OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') - OpenType = unicode(translate('OpenLP.Ui', 'Open %s')) + OpenService = translate('OpenLP.Ui', 'Open Service') Preview = translate('OpenLP.Ui', 'Preview') - PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.')) ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') - SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) - SendSelectLive = unicode(translate('OpenLP.Ui', - 'Send the selected %s live.')) + SaveService = translate('OpenLP.Ui', 'Save Service') Service = translate('OpenLP.Ui', 'Service') StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s')) Theme = translate('OpenLP.Ui', 'Theme') diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4840ef5da..c691c006e 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -319,17 +319,16 @@ class Ui_MainWindow(object): self.themeManagerDock.setWindowTitle( translate('OpenLP.MainWindow', 'Theme Manager')) self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New')) - self.FileNewItem.setToolTip(UiStrings.NewType % UiStrings.Service) - self.FileNewItem.setStatusTip( - UiStrings.CreateANew % UiStrings.Service.toLower()) + self.FileNewItem.setToolTip(UiStrings.NewService) + self.FileNewItem.setStatusTip(UiStrings.CreateService) self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N')) self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open')) - self.FileOpenItem.setToolTip(UiStrings.OpenType % UiStrings.Service) + self.FileOpenItem.setToolTip(UiStrings.OpenService) self.FileOpenItem.setStatusTip( translate('OpenLP.MainWindow', 'Open an existing service.')) self.FileOpenItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+O')) self.FileSaveItem.setText(translate('OpenLP.MainWindow', '&Save')) - self.FileSaveItem.setToolTip(UiStrings.SaveType % UiStrings.Service) + self.FileSaveItem.setToolTip(UiStrings.SaveService) self.FileSaveItem.setStatusTip( translate('OpenLP.MainWindow', 'Save the current service to disk.')) self.FileSaveItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+S')) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 71191fdbf..04a4753e8 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -96,18 +96,14 @@ class ServiceManager(QtGui.QWidget): # Create the top toolbar self.toolbar = OpenLPToolbar(self) self.toolbar.addToolbarButton( - UiStrings.NewType % UiStrings.Service, - u':/general/general_new.png', - UiStrings.CreateANew % UiStrings.Service.toLower(), - self.onNewServiceClicked) + UiStrings.NewService, u':/general/general_new.png', + UiStrings.Create.Service, self.onNewServiceClicked) self.toolbar.addToolbarButton( - UiStrings.OpenType % UiStrings.Service, - u':/general/general_open.png', + UiStrings.OpenService, u':/general/general_open.png', translate('OpenLP.ServiceManager', 'Load an existing service'), self.onLoadServiceClicked) self.toolbar.addToolbarButton( - UiStrings.SaveType % UiStrings.Service, - u':/general/general_save.png', + UiStrings.SaveService, u':/general/general_save.png', translate('OpenLP.ServiceManager', 'Save this service'), self.saveFile) self.toolbar.addSeparator() @@ -469,7 +465,7 @@ class ServiceManager(QtGui.QWidget): save the file. """ fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow, - UiStrings.SaveType % UiStrings.Service, + UiStrings.SaveService, SettingsManager.get_last_dir( self.mainwindow.serviceSettingsSection), translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)'))) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 36abb19c1..8dc895862 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -63,28 +63,28 @@ class ThemeManager(QtGui.QWidget): self.layout.setObjectName(u'layout') self.toolbar = OpenLPToolbar(self) self.toolbar.addToolbarButton( - UiStrings.NewType % UiStrings.Theme, + translate('OpenLP.ThemeManager', 'New Theme'), u':/themes/theme_new.png', - UiStrings.CreateANew % UiStrings.Theme.toLower(), + translate('OpenLP.ThemeManager', 'Create a new theme.'), self.onAddTheme) self.toolbar.addToolbarButton( - UiStrings.EditType % UiStrings.Theme, + translate('OpenLP.ThemeManager', 'Edit Theme'), u':/themes/theme_edit.png', translate('OpenLP.ThemeManager', 'Edit a theme.'), self.onEditTheme) self.deleteToolbarAction = self.toolbar.addToolbarButton( - UiStrings.DeleteType % UiStrings.Theme, + translate('OpenLP.ThemeManager', 'Delete Theme'), u':/general/general_delete.png', translate('OpenLP.ThemeManager', 'Delete a theme.'), self.onDeleteTheme) self.toolbar.addSeparator() self.toolbar.addToolbarButton( - UiStrings.ImportType % UiStrings.Theme, + translate('OpenLP.ThemeManager', 'Import Theme'), u':/general/general_import.png', translate('OpenLP.ThemeManager', 'Import a theme.'), self.onImportTheme) self.toolbar.addToolbarButton( - UiStrings.ExportType % UiStrings.Theme, + translate('OpenLP.ThemeManager', 'Export Theme'), u':/general/general_export.png', translate('OpenLP.ThemeManager', 'Export a theme.'), self.onExportTheme) diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index e3447cfdd..63fb28b67 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -129,9 +129,15 @@ class BiblePlugin(Plugin): u'title': translate('BiblesPlugin', 'Bibles', 'container title') } # Middle Header Bar - ## Import Action ## - self.textStrings[StringContent.Import] = { - u'title': UiStrings.Import, - u'tooltip': translate('BiblesPlugin', 'Import a Bible') + tooltips = { + load: u'' + import: translate('BiblesPlugin', 'Import a Bible') + new: translate('BiblesPlugin', 'Add a new Bible') + edit: translate('BiblesPlugin', 'Edit the selected Bible') + delete: translate('BiblesPlugin', 'Delete the selected Bible') + preview: translate('BiblesPlugin', 'Preview the selected Bible') + live: translate('BiblesPlugin', 'Send the selected Bible live') + service: translate('BiblesPlugin', + 'Add the selected Bible to the service') } - Plugin.setPluginTextStrings(self) + self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 92546cd4f..86f1b20d8 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -106,13 +106,18 @@ class CustomPlugin(Plugin): u'title': translate('CustomsPlugin', 'Custom', 'container title') } # Middle Header Bar - ## Import Action ## - self.textStrings[StringContent.Import] = { - u'title': UiStrings.Import, - u'tooltip': translate('CustomsPlugin', - 'Import a Custom') + tooltips = { + load: translate('CustomsPlugin', 'Load a new Custom') + import: translate('CustomsPlugin', 'Import a Custom') + new: translate('CustomsPlugin', 'Add a new Custom') + edit: translate('CustomsPlugin', 'Edit the selected Custom') + delete: translate('CustomsPlugin', 'Delete the selected Custom') + preview: translate('CustomsPlugin', 'Preview the selected Custom') + live: translate('CustomsPlugin', 'Send the selected Custom live') + service: translate('CustomsPlugin', + 'Add the selected Custom to the service') } - Plugin.setPluginTextStrings(self) + self.setPluginUiTextStrings(tooltips) def finalise(self): """ diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 6b64598fc..59005de4f 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -69,4 +69,15 @@ class ImagePlugin(Plugin): u'title': translate('ImagePlugin', 'Images', 'container title') } # Middle Header Bar - Plugin.setPluginTextStrings(self) + tooltips = { + load: translate('ImagePlugin', 'Load a new Image') + import: u'' + new: translate('ImagePlugin', 'Add a new Image') + edit: translate('ImagePlugin', 'Edit the selected Image') + delete: translate('ImagePlugin', 'Delete the selected Image') + preview: translate('ImagePlugin', 'Preview the selected Image') + live: translate('ImagePlugin', 'Send the selected Image live') + service: translate('ImagePlugin', + 'Add the selected Image to the service') + } + self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index b9db9b8c1..6989e91aa 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -95,4 +95,15 @@ class MediaPlugin(Plugin): u'title': translate('MediaPlugin', 'Media', 'container title') } # Middle Header Bar - Plugin.setPluginTextStrings(self) + tooltips = { + load: translate('MediaPlugin', 'Load a new Media') + import: u'' + new: translate('MediaPlugin', 'Add a new Media') + edit: translate('MediaPlugin', 'Edit the selected Media') + delete: translate('MediaPlugin', 'Delete the selected Media') + preview: translate('MediaPlugin', 'Preview the selected Media') + live: translate('MediaPlugin', 'Send the selected Media live') + service: translate('MediaPlugin', + 'Add the selected Media to the service') + } + self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index c81cdc028..fba332eb0 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -167,4 +167,18 @@ class PresentationPlugin(Plugin): 'container title') } # Middle Header Bar - Plugin.setPluginTextStrings(self) + tooltips = { + load: translate('PresentationPlugin', 'Load a new Presentation') + import: u'' + new: u'' + edit: u'' + delete: translate('PresentationPlugin', + 'Delete the selected Presentation') + preview: translate('PresentationPlugin', + 'Preview the selected Presentation') + live: translate('PresentationPlugin', + 'Send the selected Presentation live') + service: translate('PresentationPlugin', + 'Add the selected Presentation to the service') + } + self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 646e8e86e..abeddfdae 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -228,7 +228,18 @@ class SongsPlugin(Plugin): u'title': translate('SongsPlugin', 'Songs', 'container title') } # Middle Header Bar - Plugin.setPluginTextStrings(self) + tooltips = { + load: u'' + import: u'' + new: translate('SongsPlugin', 'Add a new Song') + edit: translate('SongsPlugin', 'Edit the selected Song') + delete: translate('SongsPlugin', 'Delete the selected Song') + preview: translate('SongsPlugin', 'Preview the selected Song') + live: translate('SongsPlugin', 'Send the selected Song live') + service: translate('SongsPlugin', + 'Add the selected Song to the service') + } + self.setPluginUiTextStrings(tooltips) def finalise(self): """ From 5800d01fa13219c3ad28d323e24f97ec19bdf2d9 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 17:30:41 +0000 Subject: [PATCH 2/5] Don't remove LengthTime --- openlp/core/lib/ui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 48a932ab1..a98e2fb7f 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -49,6 +49,7 @@ class UiStrings(object): Edit = translate('OpenLP.Ui', '&Edit') Error = translate('OpenLP.Ui', 'Error') Import = translate('OpenLP.Ui', 'Import') + LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) Live = translate('OpenLP.Ui', 'Live') Load = translate('OpenLP.Ui', 'Load') New = translate('OpenLP.Ui', 'New') From ba8918a1eaaf001762d26eb2ce9dd015953ef403 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 18:20:59 +0000 Subject: [PATCH 3/5] Fixes --- openlp/core/ui/themeform.py | 3 ++- openlp/core/ui/thememanager.py | 4 ++-- openlp/plugins/bibles/bibleplugin.py | 14 +++++++------- openlp/plugins/custom/customplugin.py | 14 +++++++------- openlp/plugins/images/imageplugin.py | 14 +++++++------- openlp/plugins/media/mediaplugin.py | 14 +++++++------- .../presentations/presentationplugin.py | 18 +++++++++--------- openlp/plugins/songs/songsplugin.py | 14 +++++++------- 8 files changed, 48 insertions(+), 47 deletions(-) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index f86fa0143..ad9e80d66 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -483,7 +483,8 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): Background Image button pushed. """ images_filter = get_images_filter() - images_filter = '%s;;%s (*.*) (*)' % (images_filter, UiStrings.AllFiles) + images_filter = u'%s;;%s (*.*) (*)' % ( + images_filter, UiStrings.AllFiles) filename = QtGui.QFileDialog.getOpenFileName(self, translate('OpenLP.ThemeForm', 'Select Image'), u'', images_filter) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 8dc895862..69028ad76 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -406,8 +406,8 @@ class ThemeManager(QtGui.QWidget): files = QtGui.QFileDialog.getOpenFileNames(self, translate('OpenLP.ThemeManager', 'Select Theme Import File'), SettingsManager.get_last_dir(self.settingsSection), - translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;' - 'Theme v2 (*.otz);;%s (*.*)') % UiStrings.AllFiles) + unicode(translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;' + 'Theme v2 (*.otz);;%s (*.*)')) % UiStrings.AllFiles) log.info(u'New Themes %s', unicode(files)) if files: for file in files: diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 63fb28b67..06fd78b60 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -130,13 +130,13 @@ class BiblePlugin(Plugin): } # Middle Header Bar tooltips = { - load: u'' - import: translate('BiblesPlugin', 'Import a Bible') - new: translate('BiblesPlugin', 'Add a new Bible') - edit: translate('BiblesPlugin', 'Edit the selected Bible') - delete: translate('BiblesPlugin', 'Delete the selected Bible') - preview: translate('BiblesPlugin', 'Preview the selected Bible') - live: translate('BiblesPlugin', 'Send the selected Bible live') + load: u'', + import: translate('BiblesPlugin', 'Import a Bible'), + new: translate('BiblesPlugin', 'Add a new Bible'), + edit: translate('BiblesPlugin', 'Edit the selected Bible'), + delete: translate('BiblesPlugin', 'Delete the selected Bible'), + preview: translate('BiblesPlugin', 'Preview the selected Bible'), + live: translate('BiblesPlugin', 'Send the selected Bible live'), service: translate('BiblesPlugin', 'Add the selected Bible to the service') } diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 86f1b20d8..076f618bc 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -107,13 +107,13 @@ class CustomPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('CustomsPlugin', 'Load a new Custom') - import: translate('CustomsPlugin', 'Import a Custom') - new: translate('CustomsPlugin', 'Add a new Custom') - edit: translate('CustomsPlugin', 'Edit the selected Custom') - delete: translate('CustomsPlugin', 'Delete the selected Custom') - preview: translate('CustomsPlugin', 'Preview the selected Custom') - live: translate('CustomsPlugin', 'Send the selected Custom live') + load: translate('CustomsPlugin', 'Load a new Custom'), + import: translate('CustomsPlugin', 'Import a Custom'), + new: translate('CustomsPlugin', 'Add a new Custom'), + edit: translate('CustomsPlugin', 'Edit the selected Custom'), + delete: translate('CustomsPlugin', 'Delete the selected Custom'), + preview: translate('CustomsPlugin', 'Preview the selected Custom'), + live: translate('CustomsPlugin', 'Send the selected Custom live'), service: translate('CustomsPlugin', 'Add the selected Custom to the service') } diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 59005de4f..7c04f5c7a 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -70,13 +70,13 @@ class ImagePlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('ImagePlugin', 'Load a new Image') - import: u'' - new: translate('ImagePlugin', 'Add a new Image') - edit: translate('ImagePlugin', 'Edit the selected Image') - delete: translate('ImagePlugin', 'Delete the selected Image') - preview: translate('ImagePlugin', 'Preview the selected Image') - live: translate('ImagePlugin', 'Send the selected Image live') + load: translate('ImagePlugin', 'Load a new Image'), + import: u'', + new: translate('ImagePlugin', 'Add a new Image'), + edit: translate('ImagePlugin', 'Edit the selected Image'), + delete: translate('ImagePlugin', 'Delete the selected Image'), + preview: translate('ImagePlugin', 'Preview the selected Image'), + live: translate('ImagePlugin', 'Send the selected Image live'), service: translate('ImagePlugin', 'Add the selected Image to the service') } diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 6989e91aa..68bdbe937 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -96,13 +96,13 @@ class MediaPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('MediaPlugin', 'Load a new Media') - import: u'' - new: translate('MediaPlugin', 'Add a new Media') - edit: translate('MediaPlugin', 'Edit the selected Media') - delete: translate('MediaPlugin', 'Delete the selected Media') - preview: translate('MediaPlugin', 'Preview the selected Media') - live: translate('MediaPlugin', 'Send the selected Media live') + load: translate('MediaPlugin', 'Load a new Media'), + import: u'', + new: translate('MediaPlugin', 'Add a new Media'), + edit: translate('MediaPlugin', 'Edit the selected Media'), + delete: translate('MediaPlugin', 'Delete the selected Media'), + preview: translate('MediaPlugin', 'Preview the selected Media'), + live: translate('MediaPlugin', 'Send the selected Media live'), service: translate('MediaPlugin', 'Add the selected Media to the service') } diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index fba332eb0..7411c2f71 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -168,17 +168,17 @@ class PresentationPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('PresentationPlugin', 'Load a new Presentation') - import: u'' - new: u'' - edit: u'' + load: translate('PresentationPlugin', 'Load a new Presentation'), + import: u'', + new: u'', + edit: u'', delete: translate('PresentationPlugin', - 'Delete the selected Presentation') + 'Delete the selected Presentation'), preview: translate('PresentationPlugin', - 'Preview the selected Presentation') + 'Preview the selected Presentation'), live: translate('PresentationPlugin', - 'Send the selected Presentation live') + 'Send the selected Presentation live'), service: translate('PresentationPlugin', 'Add the selected Presentation to the service') - } - self.setPluginUiTextStrings(tooltips) + } + self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index abeddfdae..e8866e5b0 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -229,13 +229,13 @@ class SongsPlugin(Plugin): } # Middle Header Bar tooltips = { - load: u'' - import: u'' - new: translate('SongsPlugin', 'Add a new Song') - edit: translate('SongsPlugin', 'Edit the selected Song') - delete: translate('SongsPlugin', 'Delete the selected Song') - preview: translate('SongsPlugin', 'Preview the selected Song') - live: translate('SongsPlugin', 'Send the selected Song live') + load: u'', + import: u'', + new: translate('SongsPlugin', 'Add a new Song'), + edit: translate('SongsPlugin', 'Edit the selected Song'), + delete: translate('SongsPlugin', 'Delete the selected Song'), + preview: translate('SongsPlugin', 'Preview the selected Song'), + live: translate('SongsPlugin', 'Send the selected Song live'), service: translate('SongsPlugin', 'Add the selected Song to the service') } From 5e8b8eedf3c5e3ac50da4bf36c03747925fe7b10 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 19:08:18 +0000 Subject: [PATCH 4/5] Strings not variable names\! --- openlp/core/lib/plugin.py | 16 ++++++++-------- openlp/plugins/bibles/bibleplugin.py | 16 ++++++++-------- openlp/plugins/custom/customplugin.py | 18 ++++++++++-------- openlp/plugins/images/imageplugin.py | 16 ++++++++-------- openlp/plugins/media/mediaplugin.py | 16 ++++++++-------- .../presentations/presentationplugin.py | 16 ++++++++-------- openlp/plugins/songs/songsplugin.py | 16 ++++++++-------- 7 files changed, 58 insertions(+), 56 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index a525e70cc..730bb1a36 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -341,28 +341,28 @@ class Plugin(QtCore.QObject): """ ## Load Action ## self.__setNameTextString(StringContent.Load, - UiStrings.Load, tooltips[load]) + UiStrings.Load, tooltips[u'load']) ## Import Action ## self.__setNameTextString(StringContent.Import, - UiStrings.Import, tooltips[import]) + UiStrings.Import, tooltips[u'import']) ## New Action ## self.__setNameTextString(StringContent.New, - UiStrings.Add, tooltips[new]) + UiStrings.Add, tooltips[u'new']) ## Edit Action ## self.__setNameTextString(StringContent.Edit, - UiStrings.Edit, tooltips[edit]) + UiStrings.Edit, tooltips[u'edit']) ## Delete Action ## self.__setNameTextString(StringContent.Delete, - UiStrings.Delete, tooltips[delete]) + UiStrings.Delete, tooltips[u'delete']) ## Preview Action ## self.__setNameTextString(StringContent.Preview, - UiStrings.Preview, tooltips[preview]) + UiStrings.Preview, tooltips[u'preview']) ## Send Live Action ## self.__setNameTextString(StringContent.Live, - UiStrings.Live, tooltips[live]) + UiStrings.Live, tooltips[u'live']) ## Add to Service Action ## self.__setNameTextString(StringContent.Service, - UiStrings.Service, tooltips[service]) + UiStrings.Service, tooltips[u'service']) def __setNameTextString(self, name, title, tooltip): """ diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 06fd78b60..de0ea11f1 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -130,14 +130,14 @@ class BiblePlugin(Plugin): } # Middle Header Bar tooltips = { - load: u'', - import: translate('BiblesPlugin', 'Import a Bible'), - new: translate('BiblesPlugin', 'Add a new Bible'), - edit: translate('BiblesPlugin', 'Edit the selected Bible'), - delete: translate('BiblesPlugin', 'Delete the selected Bible'), - preview: translate('BiblesPlugin', 'Preview the selected Bible'), - live: translate('BiblesPlugin', 'Send the selected Bible live'), - service: translate('BiblesPlugin', + u'load': u'', + u'import': translate('BiblesPlugin', 'Import a Bible'), + u'new': translate('BiblesPlugin', 'Add a new Bible'), + u'edit': translate('BiblesPlugin', 'Edit the selected Bible'), + u'delete': translate('BiblesPlugin', 'Delete the selected Bible'), + u'preview': translate('BiblesPlugin', 'Preview the selected Bible'), + u'live': translate('BiblesPlugin', 'Send the selected Bible live'), + u'service': translate('BiblesPlugin', 'Add the selected Bible to the service') } self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 076f618bc..5a32d4657 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -107,14 +107,16 @@ class CustomPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('CustomsPlugin', 'Load a new Custom'), - import: translate('CustomsPlugin', 'Import a Custom'), - new: translate('CustomsPlugin', 'Add a new Custom'), - edit: translate('CustomsPlugin', 'Edit the selected Custom'), - delete: translate('CustomsPlugin', 'Delete the selected Custom'), - preview: translate('CustomsPlugin', 'Preview the selected Custom'), - live: translate('CustomsPlugin', 'Send the selected Custom live'), - service: translate('CustomsPlugin', + u'load': translate('CustomsPlugin', 'Load a new Custom'), + u'import': translate('CustomsPlugin', 'Import a Custom'), + u'new': translate('CustomsPlugin', 'Add a new Custom'), + u'edit': translate('CustomsPlugin', 'Edit the selected Custom'), + u'delete': translate('CustomsPlugin', 'Delete the selected Custom'), + u'preview': translate('CustomsPlugin', + 'Preview the selected Custom'), + u'live': translate('CustomsPlugin', + 'Send the selected Custom live'), + u'service': translate('CustomsPlugin', 'Add the selected Custom to the service') } self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 7c04f5c7a..2cc0f1d93 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -70,14 +70,14 @@ class ImagePlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('ImagePlugin', 'Load a new Image'), - import: u'', - new: translate('ImagePlugin', 'Add a new Image'), - edit: translate('ImagePlugin', 'Edit the selected Image'), - delete: translate('ImagePlugin', 'Delete the selected Image'), - preview: translate('ImagePlugin', 'Preview the selected Image'), - live: translate('ImagePlugin', 'Send the selected Image live'), - service: translate('ImagePlugin', + u'load': translate('ImagePlugin', 'Load a new Image'), + u'import': u'', + u'new': translate('ImagePlugin', 'Add a new Image'), + u'edit': translate('ImagePlugin', 'Edit the selected Image'), + u'delete': translate('ImagePlugin', 'Delete the selected Image'), + u'preview': translate('ImagePlugin', 'Preview the selected Image'), + u'live': translate('ImagePlugin', 'Send the selected Image live'), + u'service': translate('ImagePlugin', 'Add the selected Image to the service') } self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 68bdbe937..ee413aa8c 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -96,14 +96,14 @@ class MediaPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('MediaPlugin', 'Load a new Media'), - import: u'', - new: translate('MediaPlugin', 'Add a new Media'), - edit: translate('MediaPlugin', 'Edit the selected Media'), - delete: translate('MediaPlugin', 'Delete the selected Media'), - preview: translate('MediaPlugin', 'Preview the selected Media'), - live: translate('MediaPlugin', 'Send the selected Media live'), - service: translate('MediaPlugin', + u'load': translate('MediaPlugin', 'Load a new Media'), + u'import': u'', + u'new': translate('MediaPlugin', 'Add a new Media'), + u'edit': translate('MediaPlugin', 'Edit the selected Media'), + u'delete': translate('MediaPlugin', 'Delete the selected Media'), + u'preview': translate('MediaPlugin', 'Preview the selected Media'), + u'live': translate('MediaPlugin', 'Send the selected Media live'), + u'service': translate('MediaPlugin', 'Add the selected Media to the service') } self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 7411c2f71..ece25e363 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -168,17 +168,17 @@ class PresentationPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('PresentationPlugin', 'Load a new Presentation'), - import: u'', - new: u'', - edit: u'', - delete: translate('PresentationPlugin', + u'load': translate('PresentationPlugin', 'Load a new Presentation'), + u'import': u'', + u'new': u'', + u'edit': u'', + u'delete': translate('PresentationPlugin', 'Delete the selected Presentation'), - preview: translate('PresentationPlugin', + u'preview': translate('PresentationPlugin', 'Preview the selected Presentation'), - live: translate('PresentationPlugin', + u'live': translate('PresentationPlugin', 'Send the selected Presentation live'), - service: translate('PresentationPlugin', + u'service': translate('PresentationPlugin', 'Add the selected Presentation to the service') } self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index e8866e5b0..887ddb7b2 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -229,14 +229,14 @@ class SongsPlugin(Plugin): } # Middle Header Bar tooltips = { - load: u'', - import: u'', - new: translate('SongsPlugin', 'Add a new Song'), - edit: translate('SongsPlugin', 'Edit the selected Song'), - delete: translate('SongsPlugin', 'Delete the selected Song'), - preview: translate('SongsPlugin', 'Preview the selected Song'), - live: translate('SongsPlugin', 'Send the selected Song live'), - service: translate('SongsPlugin', + u'load': u'', + u'import': u'', + u'new': translate('SongsPlugin', 'Add a new Song'), + u'edit': translate('SongsPlugin', 'Edit the selected Song'), + u'delete': translate('SongsPlugin', 'Delete the selected Song'), + u'preview': translate('SongsPlugin', 'Preview the selected Song'), + u'live': translate('SongsPlugin', 'Send the selected Song live'), + u'service': translate('SongsPlugin', 'Add the selected Song to the service') } self.setPluginUiTextStrings(tooltips) From 3c8c87138f873979c84d047d3f39abd75d76ed16 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 19:15:49 +0000 Subject: [PATCH 5/5] Typo --- openlp/core/ui/servicemanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 04a4753e8..623c2d641 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -97,7 +97,7 @@ class ServiceManager(QtGui.QWidget): self.toolbar = OpenLPToolbar(self) self.toolbar.addToolbarButton( UiStrings.NewService, u':/general/general_new.png', - UiStrings.Create.Service, self.onNewServiceClicked) + UiStrings.CreateService, self.onNewServiceClicked) self.toolbar.addToolbarButton( UiStrings.OpenService, u':/general/general_open.png', translate('OpenLP.ServiceManager', 'Load an existing service'),