Strings including Author Unknown

This commit is contained in:
Jon Tibble 2011-02-13 15:11:06 +00:00
parent 530c5e4f87
commit ffd4d41760
8 changed files with 10 additions and 13 deletions

View File

@ -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.')

View File

@ -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:

View File

@ -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:'))

View File

@ -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)

View File

@ -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:

View File

@ -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

View File

@ -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')

View File

@ -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)