From ffd4d4176091c712c095fbb929afd95ecfb4f47c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 15:11:06 +0000 Subject: [PATCH] Strings including Author Unknown --- openlp/core/lib/ui.py | 1 + openlp/core/ui/slidecontroller.py | 3 +-- openlp/core/ui/starttimedialog.py | 4 ++-- openlp/plugins/alerts/lib/alertstab.py | 3 +-- openlp/plugins/songs/lib/opensongimport.py | 4 ++-- openlp/plugins/songs/lib/songimport.py | 3 +-- openlp/plugins/songs/lib/ui.py | 1 + openlp/plugins/songs/lib/xml.py | 4 +--- 8 files changed, 10 insertions(+), 13 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index f335c165f..f4aa8162e 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -85,6 +85,7 @@ class UiStrings(object): 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') SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) Search = translate('OpenLP.Ui', 'Search') SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 52626f24f..f3bf7ee52 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -191,8 +191,7 @@ class SlideController(QtGui.QWidget): self.delaySpinBox.setMinimum(1) self.delaySpinBox.setMaximum(180) self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox) - self.delaySpinBox.setSuffix(translate('OpenLP.SlideController', - 's')) + self.delaySpinBox.setSuffix(UiStrings.S) self.delaySpinBox.setToolTip(translate('OpenLP.SlideController', 'Delay between slides in seconds')) else: diff --git a/openlp/core/ui/starttimedialog.py b/openlp/core/ui/starttimedialog.py index 8dcc2c9ee..d87df71c4 100644 --- a/openlp/core/ui/starttimedialog.py +++ b/openlp/core/ui/starttimedialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box class Ui_StartTimeDialog(object): def setupUi(self, StartTimeDialog): @@ -65,6 +65,6 @@ class Ui_StartTimeDialog(object): self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:')) self.hourSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'h')) self.minuteSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'm')) - self.secondSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 's')) + self.secondSpinBox.setSuffix(UiStrings.S) self.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:')) self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:')) diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 48a4527ed..8c1538e4d 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -113,8 +113,7 @@ class AlertsTab(SettingsTab): translate('AlertsPlugin.AlertsTab', 'pt')) self.TimeoutLabel.setText( translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) - self.TimeoutSpinBox.setSuffix( - translate('AlertsPlugin.AlertsTab', 's')) + self.TimeoutSpinBox.setSuffix(UiStrings.S) self.PreviewGroupBox.setTitle(UiStrings.Preview) self.FontPreview.setText(UiStrings.OLPV2) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 8c6d283e3..24043d6f0 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -32,6 +32,7 @@ from lxml.etree import Error, LxmlError import re from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) @@ -159,8 +160,7 @@ class OpenSongImport(SongImport): # not a zipfile log.info(u'Direct import %s', filename) self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - 'Importing %s...')) % os.path.split(filename)[-1]) + WizardStrings.ImportingType % os.path.split(filename)[-1]) file = open(filename) self.do_import_file(file) if self.commit: diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index da017d4f5..b56b54b58 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -260,8 +260,7 @@ class SongImport(QtCore.QObject): All fields have been set to this song. Write the song to disk. """ if not self.authors: - self.authors.append(unicode(translate('SongsPlugin.SongImport', - 'Author unknown'))) + self.authors.append(u'Author Unknown') log.info(u'commiting song %s to database', self.title) song = Song() song.title = self.title diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 2a67fce55..d712b9922 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -36,6 +36,7 @@ class SongStrings(object): # These strings should need a good reason to be retranslated elsewhere. Author = translate('OpenLP.Ui', 'Author', 'Singular') Authors = translate('OpenLP.Ui', 'Authors', 'Plural') + AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') Topic = translate('OpenLP.Ui', 'Topic', 'Singular') diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index b96e79961..73c65f7c8 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -377,9 +377,7 @@ class OpenLyrics(object): except AttributeError: pass if not authors: - # Add "Author unknown" (can be translated). - authors.append((unicode(translate('SongsPlugin.XML', - 'Author unknown')))) + authors.append(u'Author Unknown') for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name)