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') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background')
ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetBG = translate('OpenLP.Ui', 'Reset Background')
ResetLiveBG = translate('OpenLP.Ui', 'Reset Live 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')) SaveType = unicode(translate('OpenLP.Ui', 'Save %s'))
Search = translate('OpenLP.Ui', 'Search') Search = translate('OpenLP.Ui', 'Search')
SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') 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.setMinimum(1)
self.delaySpinBox.setMaximum(180) self.delaySpinBox.setMaximum(180)
self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox) self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox)
self.delaySpinBox.setSuffix(translate('OpenLP.SlideController', self.delaySpinBox.setSuffix(UiStrings.S)
's'))
self.delaySpinBox.setToolTip(translate('OpenLP.SlideController', self.delaySpinBox.setToolTip(translate('OpenLP.SlideController',
'Delay between slides in seconds')) 'Delay between slides in seconds'))
else: else:

View File

@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate 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): class Ui_StartTimeDialog(object):
def setupUi(self, StartTimeDialog): def setupUi(self, StartTimeDialog):
@ -65,6 +65,6 @@ class Ui_StartTimeDialog(object):
self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:')) self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:'))
self.hourSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'h')) self.hourSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'h'))
self.minuteSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'm')) 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.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:'))
self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:')) self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:'))

View File

@ -113,8 +113,7 @@ class AlertsTab(SettingsTab):
translate('AlertsPlugin.AlertsTab', 'pt')) translate('AlertsPlugin.AlertsTab', 'pt'))
self.TimeoutLabel.setText( self.TimeoutLabel.setText(
translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
self.TimeoutSpinBox.setSuffix( self.TimeoutSpinBox.setSuffix(UiStrings.S)
translate('AlertsPlugin.AlertsTab', 's'))
self.PreviewGroupBox.setTitle(UiStrings.Preview) self.PreviewGroupBox.setTitle(UiStrings.Preview)
self.FontPreview.setText(UiStrings.OLPV2) self.FontPreview.setText(UiStrings.OLPV2)

View File

@ -32,6 +32,7 @@ from lxml.etree import Error, LxmlError
import re import re
from openlp.core.lib import translate from openlp.core.lib import translate
from openlp.core.ui.wizard import WizardStrings
from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib.songimport import SongImport
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -159,8 +160,7 @@ class OpenSongImport(SongImport):
# not a zipfile # not a zipfile
log.info(u'Direct import %s', filename) log.info(u'Direct import %s', filename)
self.import_wizard.incrementProgressBar( self.import_wizard.incrementProgressBar(
unicode(translate('SongsPlugin.ImportWizardForm', WizardStrings.ImportingType % os.path.split(filename)[-1])
'Importing %s...')) % os.path.split(filename)[-1])
file = open(filename) file = open(filename)
self.do_import_file(file) self.do_import_file(file)
if self.commit: 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. All fields have been set to this song. Write the song to disk.
""" """
if not self.authors: if not self.authors:
self.authors.append(unicode(translate('SongsPlugin.SongImport', self.authors.append(u'Author Unknown')
'Author unknown')))
log.info(u'commiting song %s to database', self.title) log.info(u'commiting song %s to database', self.title)
song = Song() song = Song()
song.title = self.title song.title = self.title

View File

@ -36,6 +36,7 @@ class SongStrings(object):
# These strings should need a good reason to be retranslated elsewhere. # These strings should need a good reason to be retranslated elsewhere.
Author = translate('OpenLP.Ui', 'Author', 'Singular') Author = translate('OpenLP.Ui', 'Author', 'Singular')
Authors = translate('OpenLP.Ui', 'Authors', 'Plural') Authors = translate('OpenLP.Ui', 'Authors', 'Plural')
AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown')
SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular')
SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural')
Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topic = translate('OpenLP.Ui', 'Topic', 'Singular')

View File

@ -377,9 +377,7 @@ class OpenLyrics(object):
except AttributeError: except AttributeError:
pass pass
if not authors: if not authors:
# Add "Author unknown" (can be translated). authors.append(u'Author Unknown')
authors.append((unicode(translate('SongsPlugin.XML',
'Author unknown'))))
for display_name in authors: for display_name in authors:
author = self.manager.get_object_filtered(Author, author = self.manager.get_object_filtered(Author,
Author.display_name == display_name) Author.display_name == display_name)