From 365072c05c79637510324fb47f6a3388368c8665 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 16:02:12 +0000 Subject: [PATCH] SongStrings --- .../songs/forms/songmaintenanceform.py | 30 +++++++------------ openlp/plugins/songs/lib/ui.py | 2 ++ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 218debd7d..41f3e4237 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -215,13 +215,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(author): self.resetAuthors() else: - critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'Could not add your author.')) + critical_error_message_box(SongStrings.CouldNotAdd % + SongStrings.Author.toLower()) else: critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'This author already exists.')) + SongStrings.ThisTypeExists % SongStrings.Author.toLower()) def onTopicAddButtonClick(self): if self.topicform.exec_(): @@ -230,13 +228,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(topic): self.resetTopics() else: - critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'Could not add your topic.')) + critical_error_message_box(SongStrings.CouldNotAdd % + SongStrings.Topic.toLower()) else: critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'This topic already exists.')) + SongStrings.ThisTypeExists % SongStrings.Topic.toLower()) def onBookAddButtonClick(self): if self.bookform.exec_(): @@ -246,13 +242,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(book): self.resetBooks() else: - critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'Could not add your book.')) + critical_error_message_box(SongStrings.CouldNotAdd % + SongStrings.SongBook.toLower()) else: critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'This book already exists.')) + SongStrings.ThisTypeExists % SongStrings.SongBook.toLower()) def onAuthorEditButtonClick(self): author_id = self._getCurrentItemId(self.authorsListWidget) @@ -269,11 +263,9 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): temp_last_name = author.last_name temp_display_name = author.display_name if self.authorform.exec_(False): - author.first_name = unicode( - self.authorform.firstNameEdit.text()) + author.first_name = unicode(self.authorform.firstNameEdit.text()) author.last_name = unicode(self.authorform.lastNameEdit.text()) - author.display_name = unicode( - self.authorform.displayEdit.text()) + author.display_name = unicode(self.authorform.displayEdit.text()) if self.checkAuthor(author, True): if self.manager.save_object(author): self.resetAuthors() diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 3871c80b0..0203c166e 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -38,8 +38,10 @@ 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. + CouldNotAdd = unicode(translate('OpenLP.Ui', 'Could not add your %s.')) SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') + ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.')) Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance'))