From 032c48df60c295181b39888d56d0a1cb1c1b8d96 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 16 Feb 2011 17:54:31 +0000 Subject: [PATCH] Finish grammar corrections, more strings and cleanups --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/lib/ui.py | 9 +++---- openlp/core/ui/exceptionform.py | 24 +++++++++---------- openlp/core/ui/mainwindow.py | 12 ++++++---- openlp/core/ui/printserviceorderdialog.py | 4 ++-- openlp/core/ui/serviceitemeditdialog.py | 5 ++-- openlp/core/ui/shortcutlistform.py | 3 ++- openlp/core/ui/themewizard.py | 2 +- openlp/core/ui/wizard.py | 7 +++--- openlp/plugins/alerts/forms/alertdialog.py | 3 +-- openlp/plugins/alerts/lib/alertstab.py | 3 +-- .../plugins/bibles/forms/bibleimportform.py | 7 +++--- openlp/plugins/bibles/lib/osis.py | 4 ++-- .../plugins/custom/forms/editcustomdialog.py | 9 +++---- openlp/plugins/songs/forms/editsongform.py | 6 ++--- openlp/plugins/songs/forms/songexportform.py | 7 +++--- openlp/plugins/songs/forms/songimportform.py | 12 ++++------ .../songs/forms/songmaintenancedialog.py | 5 ++-- openlp/plugins/songs/lib/mediaitem.py | 3 +-- openlp/plugins/songs/lib/songimport.py | 6 ++--- openlp/plugins/songs/lib/ui.py | 2 ++ 21 files changed, 64 insertions(+), 71 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 6f446619e..2fb100f30 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -475,7 +475,7 @@ class MediaManagerItem(QtGui.QWidget): if not self.listView.selectedIndexes() and not self.remoteTriggered: QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', - 'You must select one or more items')) + 'You must select one or more items.')) else: log.debug(u'%s Add requested', self.plugin.name) serviceItem = self.parent.serviceManager.getServiceItem() diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 1e11133f4..e77ad2f10 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -52,6 +52,8 @@ class UiStrings(object): EmptyField = translate('OpenLP.Ui', 'Empty Field') Error = translate('OpenLP.Ui', 'Error') Export = translate('OpenLP.Ui', 'Export') + FontSizePtUnit = translate('OpenLP.Ui', 'pt', + 'Abbreviated font pointsize unit') Image = translate('OpenLP.Ui', 'Image') Import = translate('OpenLP.Ui', 'Import') LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) @@ -59,33 +61,32 @@ class UiStrings(object): LiveBGError = translate('OpenLP.Ui', 'Live Background Error') LivePanel = translate('OpenLP.Ui', 'Live Panel') Load = translate('OpenLP.Ui', 'Load') - MediaManager = translate('OpenLP.Ui', 'Media Manager') New = translate('OpenLP.Ui', 'New') + NewService = translate('OpenLP.Ui', 'New Service') NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular') NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') OLPV1 = translate('OpenLP.Ui', 'openlp.org 1.x') - NewService = translate('OpenLP.Ui', 'New Service') OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') OpenService = translate('OpenLP.Ui', 'Open Service') Preview = translate('OpenLP.Ui', 'Preview') PreviewPanel = translate('OpenLP.Ui', 'Preview Panel') + PrintServiceOrder = translate('OpenLP.Ui', 'Print Service Order') 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') S = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds') + SaveAndPreview = translate('OpenLP.Ui', 'Save && Preview') Search = translate('OpenLP.Ui', 'Search') SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') SelectEdit = translate('OpenLP.Ui', 'You must select an item to edit.') SaveService = translate('OpenLP.Ui', 'Save Service') Service = translate('OpenLP.Ui', 'Service') - ServiceManager = translate('OpenLP.Ui', 'Service Manager') StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s')) Theme = translate('OpenLP.Ui', 'Theme', 'Singular') Themes = translate('OpenLP.Ui', 'Themes', 'Plural') - ThemeManager = translate('OpenLP.Ui', 'Theme Manager') Version = translate('OpenLP.Ui', 'Version') def add_welcome_page(parent, image): diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index cb3cc4ef4..023bb6b36 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -35,24 +35,24 @@ from PyQt4 import Qt, QtCore, QtGui try: from PyQt4.phonon import Phonon - phonon_version = Phonon.phononVersion() + PHONON_VERSION = Phonon.phononVersion() except ImportError: - phonon_version = u'-' + PHONON_VERSION = u'-' try: import chardet - chardet_version = chardet.__version__ + CHARDET_VERSION = chardet.__version__ except ImportError: - chardet_version = u'-' + CHARDET_VERSION = u'-' try: import enchant - enchant_version = enchant.__version__ + ENCHANT_VERSION = enchant.__version__ except ImportError: - enchant_version = u'-' + ENCHANT_VERSION = u'-' try: import sqlite - sqlite_version = sqlite.version + SQLITE_VERSION = sqlite.version except ImportError: - sqlite_version = u'-' + SQLITE_VERSION = u'-' from openlp.core.lib import translate, SettingsManager from openlp.core.lib.mailto import mailto @@ -85,14 +85,14 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): 'Platform: %s\n')) % platform.platform() libraries = u'Python: %s\n' % platform.python_version() + \ u'Qt4: %s\n' % Qt.qVersion() + \ - u'Phonon: %s\n' % phonon_version + \ + u'Phonon: %s\n' % PHONON_VERSION + \ u'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \ u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \ u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \ u'lxml: %s\n' % etree.__version__ + \ - u'Chardet: %s\n' % chardet_version + \ - u'PyEnchant: %s\n' % enchant_version + \ - u'PySQLite: %s\n' % sqlite_version + u'Chardet: %s\n' % CHARDET_VERSION + \ + u'PyEnchant: %s\n' % ENCHANT_VERSION + \ + u'PySQLite: %s\n' % SQLITE_VERSION if platform.system() == u'Linux': if os.environ.get(u'KDE_FULL_SESSION') == u'true': system = system + u'Desktop: KDE SC\n' diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 2ef1f834f..30afe4d13 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -312,9 +312,12 @@ class Ui_MainWindow(object): self.SettingsLanguageMenu.setTitle(translate('OpenLP.MainWindow', '&Language')) self.HelpMenu.setTitle(translate('OpenLP.MainWindow', '&Help')) - self.mediaManagerDock.setWindowTitle(UiStrings.MediaManager) - self.serviceManagerDock.setWindowTitle(UiStrings.ServiceManager) - self.themeManagerDock.setWindowTitle(UiStrings.ThemeManager) + self.mediaManagerDock.setWindowTitle( + translate('OpenLP.MainWindow', 'Media Manager')) + self.serviceManagerDock.setWindowTitle( + translate('OpenLP.MainWindow', 'Service Manager')) + self.themeManagerDock.setWindowTitle( + translate('OpenLP.MainWindow', 'Theme Manager')) self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New')) self.FileNewItem.setToolTip(UiStrings.NewService) self.FileNewItem.setStatusTip(UiStrings.CreateService) @@ -337,8 +340,7 @@ class Ui_MainWindow(object): 'Save the current service under a new name.')) self.FileSaveAsItem.setShortcut( translate('OpenLP.MainWindow', 'Ctrl+Shift+S')) - self.printServiceOrderItem.setText( - translate('OpenLP.MainWindow', 'Print Service Order')) + self.printServiceOrderItem.setText(UiStrings.PrintServiceOrder) self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow', 'Print the current Service Order.')) self.printServiceOrderItem.setShortcut( diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index f8db4d1c0..22f8e9292 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit +from openlp.core.lib.ui import UiStrings class Ui_PrintServiceOrderDialog(object): def setupUi(self, printServiceOrderDialog): @@ -116,8 +117,7 @@ class Ui_PrintServiceOrderDialog(object): QtCore.QMetaObject.connectSlotsByName(printServiceOrderDialog) def retranslateUi(self, printServiceOrderDialog): - printServiceOrderDialog.setWindowTitle( - translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) + printServiceOrderDialog.setWindowTitle(UiStrings.PrintServiceOrder) self.previewLabel.setText( translate('OpenLP.ServiceManager', 'Preview:')) self.printSlideTextCheckBox.setText(translate( diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index 0f9ddb4ac..ef7e99a5f 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ +from openlp.core.lib.ui import create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set class Ui_ServiceItemEditDialog(object): @@ -41,8 +41,7 @@ class Ui_ServiceItemEditDialog(object): self.dialogLayout.addWidget(self.listWidget, 0, 0) self.buttonLayout = QtGui.QVBoxLayout() self.buttonLayout.setObjectName(u'buttonLayout') - self.deleteButton = create_delete_push_button( - serviceItemEditDialog, UiStrings.Service.toLower()) + self.deleteButton = create_delete_push_button(serviceItemEditDialog) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() self.upButton, self.downButton = create_up_down_push_button_set( diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 0de4bea7f..240bbf93c 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -101,7 +101,8 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): else: shortcutText = action.shortcut().toString() alternateText = u'' - actionItem = QtGui.QTreeWidgetItem([actionText, shortcutText, alternateText]) + actionItem = QtGui.QTreeWidgetItem( + [actionText, shortcutText, alternateText]) actionItem.setIcon(0, action.icon()) item.addChild(actionItem) item.setExpanded(True) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 281e216d3..fc25e11fa 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -470,7 +470,7 @@ class Ui_ThemeWizard(object): self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.footerSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.footerSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.alignmentPage.setTitle( translate('OpenLP.ThemeWizard', 'Text Formatting Details')) self.alignmentPage.setSubTitle( diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 7e9511c33..2960607e4 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -55,8 +55,9 @@ class WizardStrings(object): SSP = u'SongShow Plus' WoW = u'Words of Worship' # These strings should need a good reason to be retranslated elsewhere. + FinishedImport = translate('OpenLP.Ui', 'Finished import.') FormatLabel = translate('OpenLP.Ui', 'Format:') - Header = u'%s' + HeaderStyle = u'%s' Importing = translate('OpenLP.Ui', 'Importing') ImportingType = unicode(translate('OpenLP.Ui', 'Importing "%s"...')) ImportSelect = translate('OpenLP.Ui', 'Select Import Source') @@ -67,6 +68,7 @@ class WizardStrings(object): 'importer, you will need to install the "python-sqlite" ' 'module.') OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) + PercentSymbolFormat = unicode(translate('OpenLP.Ui', '%p%')) Ready = translate('OpenLP.Ui', 'Ready.') StartingImport = translate('OpenLP.Ui', 'Starting import...') YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify at ' @@ -78,11 +80,10 @@ class OpenLPWizard(QtGui.QWizard): Generic OpenLP wizard to provide generic functionality and a unified look and feel. """ - def __init__(self, parent, plugin, name, image, direction): + def __init__(self, parent, plugin, name, image): QtGui.QWizard.__init__(self, parent) self.plugin = plugin self.setObjectName(name) - self.direction = direction self.openIcon = build_icon(u':/general/general_open.png') self.deleteIcon = build_icon(u':/general/general_delete.png') self.finishButton = self.button(QtGui.QWizard.FinishButton) diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 11596b700..93f7ead06 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -66,8 +66,7 @@ class Ui_AlertDialog(object): self.saveButton.setIcon(build_icon(u':/general/general_save.png')) self.saveButton.setObjectName(u'saveButton') self.manageButtonLayout.addWidget(self.saveButton) - self.deleteButton = create_delete_push_button(alertDialog, - self.parent.nameStrings[u'singular'].toLower()) + self.deleteButton = create_delete_push_button(alertDialog) self.deleteButton.setEnabled(False) self.manageButtonLayout.addWidget(self.deleteButton) self.manageButtonLayout.addStretch() diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 8c1538e4d..ac7316df2 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -109,8 +109,7 @@ class AlertsTab(SettingsTab): translate('AlertsPlugin.AlertsTab', 'Background color:')) self.FontSizeLabel.setText( translate('AlertsPlugin.AlertsTab', 'Font size:')) - self.FontSizeSpinBox.setSuffix( - translate('AlertsPlugin.AlertsTab', 'pt')) + self.FontSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.TimeoutLabel.setText( translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) self.TimeoutSpinBox.setSuffix(UiStrings.S) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index b3b7aeb7e..83e7065ac 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -88,7 +88,7 @@ class BibleImportForm(OpenLPWizard): self.manager = manager self.web_bible_list = {} OpenLPWizard.__init__(self, parent, bibleplugin, u'bibleImportWizard', - u':/wizards/wizard_importbible.bmp', UiStrings.Import) + u':/wizards/wizard_importbible.bmp') def setupUi(self, image): """ @@ -363,7 +363,7 @@ class BibleImportForm(OpenLPWizard): """ self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) - self.titleLabel.setText(WizardStrings.Header % + self.titleLabel.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui', 'Welcome to the Bible Import Wizard')) self.informationLabel.setText( translate('BiblesPlugin.ImportWizardForm', @@ -768,8 +768,7 @@ class BibleImportForm(OpenLPWizard): 'bible. Please note, that verses will be downloaded on\n' 'demand and thus an internet connection is required.')) else: - self.progressLabel.setText(translate( - 'BiblesPlugin.ImportWizardForm', 'Finished import.')) + self.progressLabel.setText(WizardStrings.FinishedImport) else: self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 4a001987d..d21227090 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -69,7 +69,7 @@ class OSISBible(BibleDB): self.q1_regex = re.compile(r'') self.q2_regex = re.compile(r'') self.trans_regex = re.compile(r'(.*?)') - self.divineName_regex = re.compile( + self.divine_name_regex = re.compile( r'(.*?)') self.spaces_regex = re.compile(r'([ ]{2,})') filepath = os.path.join( @@ -161,7 +161,7 @@ class OSISBible(BibleDB): verse_text = self.q1_regex.sub(u'"', verse_text) verse_text = self.q2_regex.sub(u'\'', verse_text) verse_text = self.trans_regex.sub(u'', verse_text) - verse_text = self.divineName_regex.sub(u'', verse_text) + verse_text = self.divine_name_regex.sub(u'', verse_text) verse_text = verse_text.replace(u'', u'')\ .replace(u'', u'').replace(u'', u'')\ .replace(u'', u'').replace(u'', u'')\ diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index e63c057d0..8746d5548 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import StringContent, build_icon, translate +from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set @@ -66,9 +66,7 @@ class Ui_CustomEditDialog(object): self.editAllButton = QtGui.QPushButton(customEditDialog) self.editAllButton.setObjectName(u'editAllButton') self.buttonLayout.addWidget(self.editAllButton) - self.deleteButton = create_delete_push_button(customEditDialog, - customEditDialog.parent.getString( - StringContent.Name)[u'singular'].toLower()) + self.deleteButton = create_delete_push_button(customEditDialog) self.deleteButton.setEnabled(False) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() @@ -126,5 +124,4 @@ class Ui_CustomEditDialog(object): translate('CustomPlugin.EditCustomForm', 'The&me:')) self.creditLabel.setText( translate('CustomPlugin.EditCustomForm', '&Credits:')) - self.previewButton.setText( - translate('CustomPlugin.EditCustomForm', 'Save && Preview')) + self.previewButton.setText(UiStrings.SaveAndPreview) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 9874b7952..6a8946c78 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -35,6 +35,7 @@ from openlp.core.lib.ui import UiStrings, add_widget_completer, \ from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.lib import SongXML, VerseType from openlp.plugins.songs.lib.db import Book, Song, Author, Topic +from openlp.plugins.songs.lib.ui import SongStrings from editsongdialog import Ui_EditSongDialog log = logging.getLogger(__name__) @@ -95,8 +96,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): QtCore.SIGNAL(u'theme_update_list'), self.loadThemes) self.previewButton = QtGui.QPushButton() self.previewButton.setObjectName(u'previewButton') - self.previewButton.setText( - translate('SongsPlugin.EditSongForm', 'Save && Preview')) + self.previewButton.setText(UiStrings.SaveAndPreview) self.buttonBox.addButton( self.previewButton, QtGui.QDialogButtonBox.ActionRole) QtCore.QObject.connect(self.buttonBox, @@ -598,7 +598,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def onCopyrightInsertButtonTriggered(self): text = self.copyrightEdit.text() pos = self.copyrightEdit.cursorPosition() - sign = translate('SongsPlugin.EditSongForm', '\xa9') + sign = SongStrings.CopyrightSymbol text = text[:pos] + sign + text[pos:] self.copyrightEdit.setText(text) self.copyrightEdit.setFocus() diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 231e9ff19..202150394 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -57,7 +57,7 @@ class SongExportForm(OpenLPWizard): The songs plugin. """ OpenLPWizard.__init__(self, parent, plugin, u'songExportWizard', - u':/wizards/wizard_exportsong.bmp', UiStrings.Export) + u':/wizards/wizard_exportsong.bmp') self.stop_export_flag = False QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_export) @@ -164,7 +164,7 @@ class SongExportForm(OpenLPWizard): """ self.setWindowTitle( translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard')) - self.titleLabel.setText(WizardStrings.Header % + self.titleLabel.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui', 'Welcome to the Song Export Wizard')) self.informationLabel.setText( translate('SongsPlugin.ExportWizardForm', 'This wizard will help to' @@ -193,8 +193,7 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.ExportWizardForm', 'Please wait while your songs are exported.')) self.progressLabel.setText(WizardStrings.Ready) - self.progressBar.setFormat( - translate('SongsPlugin.ExportWizardForm', '%p%')) + self.progressBar.setFormat(WizardStrings.PercentSymbolFormat) def validateCurrentPage(self): """ diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index aa65501b3..eef0a7004 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -56,7 +56,7 @@ class SongImportForm(OpenLPWizard): The songs plugin. """ OpenLPWizard.__init__(self, parent, plugin, u'songImportWizard', - u':/wizards/wizard_importsong.bmp', UiStrings.Import) + u':/wizards/wizard_importsong.bmp') def setupUi(self, image): """ @@ -207,7 +207,7 @@ class SongImportForm(OpenLPWizard): """ self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) - self.titleLabel.setText(WizardStrings.Header % + self.titleLabel.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui', 'Welcome to the Song Import Wizard')) self.informationLabel.setText( translate('SongsPlugin.ImportWizardForm', @@ -305,8 +305,7 @@ class SongImportForm(OpenLPWizard): translate('SongsPlugin.ImportWizardForm', 'Please wait while your songs are imported.')) self.progressLabel.setText(WizardStrings.Ready) - self.progressBar.setFormat( - translate('SongsPlugin.ImportWizardForm', '%p%')) + self.progressBar.setFormat(WizardStrings.PercentSymbolFormat) # Align all QFormLayouts towards each other. width = max(self.formatLabel.minimumSizeHint().width(), self.openLP2FilenameLabel.minimumSizeHint().width()) @@ -367,7 +366,7 @@ class SongImportForm(OpenLPWizard): if self.genericFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one document or ' + 'You need to specify at least one document or ' 'presentation file to import from.')) self.genericAddButton.setFocus() return False @@ -693,8 +692,7 @@ class SongImportForm(OpenLPWizard): filenames=self.getListOfFiles(self.songShowPlusFileListWidget) ) if importer.do_import(): - self.progressLabel.setText( - translate('SongsPlugin.SongImportForm', 'Finished import.')) + self.progressLabel.setText(WizardStrings.FinishedImport) else: self.progressLabel.setText( translate('SongsPlugin.SongImportForm', diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index d17442b4c..0316ab42b 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import build_icon from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib.ui import SongStrings @@ -145,8 +145,7 @@ class Ui_SongMaintenanceDialog(object): QtCore.QMetaObject.connectSlotsByName(songMaintenanceDialog) def retranslateUi(self, songMaintenanceDialog): - songMaintenanceDialog.setWindowTitle( - translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance')) + songMaintenanceDialog.setWindowTitle(SongStrings.SongMaintenance) self.listItemAuthors.setText(SongStrings.Authors) self.listItemTopics.setText(SongStrings.Topics) self.listItemBooks.setText(SongStrings.SongBooks) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 6e0c9537d..9666a9351 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -137,8 +137,7 @@ class SongMediaItem(MediaManagerItem): def retranslateUi(self): self.searchTextLabel.setText(u'%s:' % UiStrings.Search) self.searchTextButton.setText(UiStrings.Search) - self.maintenanceAction.setText( - translate('SongsPlugin.MediaItem', 'Song Maintenance')) + self.maintenanceAction.setText(SongStrings.SongMaintenance) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 7f0e622bd..79379106d 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -81,8 +81,6 @@ class SongImport(QtCore.QObject): self.versecounts = {} self.copyright_string = unicode(translate( 'SongsPlugin.SongImport', 'copyright')) - self.copyright_symbol = unicode(translate( - 'SongsPlugin.SongImport', '\xa9')) def stop_import(self): """ @@ -137,12 +135,12 @@ class SongImport(QtCore.QObject): def process_verse_text(self, text): lines = text.split(u'\n') if text.lower().find(self.copyright_string) >= 0 \ - or text.lower().find(self.copyright_symbol) >= 0: + or text.lower().find(SongStrings.CopyrightSymbol) >= 0: copyright_found = False for line in lines: if (copyright_found or line.lower().find(self.copyright_string) >= 0 or - line.lower().find(self.copyright_symbol) >= 0): + line.lower().find(SongStrings.CopyrightSymbol) >= 0): copyright_found = True self.add_copyright(line) else: diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 85d609762..65f473e63 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -38,7 +38,9 @@ class SongStrings(object): Authors = translate('OpenLP.Ui', 'Authors', 'Plural') AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. + CopyrightSymbol = translate('OpenLP.Ui', '\xa9', 'Copyright symbol.') SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') + SongMaintenance = translate('OpenLP.Ui', 'Song Maintenance') Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural')