Fixed translate() function in songsPlugin and songusagePlugin

This commit is contained in:
Frode Woldsund 2010-06-06 16:22:00 +02:00
parent 5e64814133
commit 6e1ef3cc70
26 changed files with 454 additions and 245 deletions

View File

@ -74,7 +74,11 @@ class Ui_AuthorsDialog(object):
QtCore.QMetaObject.connectSlotsByName(AuthorsDialog) QtCore.QMetaObject.connectSlotsByName(AuthorsDialog)
def retranslateUi(self, AuthorsDialog): def retranslateUi(self, AuthorsDialog):
AuthorsDialog.setWindowTitle(translate('AuthorsForm', 'Author Maintenance')) AuthorsDialog.setWindowTitle(
self.DisplayLabel.setText(translate('AuthorsForm', 'Display name:')) translate(u'SongsPlugin.AuthorsForm', u'Author Maintenance'))
self.FirstNameLabel.setText(translate('AuthorsForm', 'First name:')) self.DisplayLabel.setText(
self.LastNameLabel.setText(translate('AuthorsForm', 'Last name:')) translate(u'SongsPlugin.AuthorsForm', u'Display name:'))
self.FirstNameLabel.setText(
translate(u'SongsPlugin.AuthorsForm', u'First name:'))
self.LastNameLabel.setText(
translate(u'SongsPlugin.AuthorsForm', u'Last name:'))

View File

@ -78,24 +78,27 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
def accept(self): def accept(self):
if not self.FirstNameEdit.text(): if not self.FirstNameEdit.text():
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('AuthorsForm','Error'), self, translate(u'SongsPlugin.AuthorsForm', u'Error'),
translate('AuthorsForm','You need to type in the first name of the author.'), translate(u'SongsPlugin.AuthorsForm',
u'You need to type in the first name of the author.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.FirstNameEdit.setFocus() self.FirstNameEdit.setFocus()
return False return False
elif not self.LastNameEdit.text(): elif not self.LastNameEdit.text():
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('AuthorsForm','Error'), self, translate(u'SongsPlugin.AuthorsForm', u'Error'),
translate('AuthorsForm','You need to type in the last name of the author.'), translate(u'SongsPlugin.AuthorsForm',
u'You need to type in the last name of the author.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.LastNameEdit.setFocus() self.LastNameEdit.setFocus()
return False return False
elif not self.DisplayEdit.text(): elif not self.DisplayEdit.text():
if QtGui.QMessageBox.critical( if QtGui.QMessageBox.critical(
self, translate('AuthorsForm','Error'), self, translate(u'SongsPlugin.AuthorsForm', u'Error'),
translate('AuthorsForm','You haven\'t set a display name for the ' translate(u'SongsPlugin.AuthorsForm',
'author, would you like me to combine the first and ' u'You haven\'t set a display name for the '
'last names for you?'), u'author, would you like me to combine the first and '
u'last names for you?'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
) == QtGui.QMessageBox.Yes: ) == QtGui.QMessageBox.Yes:

View File

@ -423,36 +423,60 @@ class Ui_EditSongDialog(object):
EditSongDialog.setTabOrder(self.CommentsEdit, self.ButtonBox) EditSongDialog.setTabOrder(self.CommentsEdit, self.ButtonBox)
def retranslateUi(self, EditSongDialog): def retranslateUi(self, EditSongDialog):
EditSongDialog.setWindowTitle(translate('EditSongForm', 'Song Editor')) EditSongDialog.setWindowTitle(
self.TitleLabel.setText(translate('EditSongForm', 'Title:')) translate(u'SongsPlugin.EditSongForm', u'Song Editor'))
self.AlternativeTitleLabel.setText(translate('EditSongForm', 'Alternative Title:')) self.TitleLabel.setText(
self.LyricsLabel.setText(translate('EditSongForm', 'Lyrics:')) translate(u'SongsPlugin.EditSongForm', u'Title:'))
self.VerseOrderLabel.setText(translate('EditSongForm', 'Verse Order:')) self.AlternativeTitleLabel.setText(
self.VerseAddButton.setText(translate('EditSongForm', 'Add')) translate(u'SongsPlugin.EditSongForm', u'Alternative Title:'))
self.VerseEditButton.setText(translate('EditSongForm', 'Edit')) self.LyricsLabel.setText(
self.VerseEditAllButton.setText(translate('EditSongForm', 'Edit All')) translate(u'SongsPlugin.EditSongForm', u'Lyrics:'))
self.VerseDeleteButton.setText(translate('EditSongForm', 'Delete')) self.VerseOrderLabel.setText(
translate(u'SongsPlugin.EditSongForm', u'Verse Order:'))
self.VerseAddButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Add'))
self.VerseEditButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Edit'))
self.VerseEditAllButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Edit All'))
self.VerseDeleteButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Delete'))
self.SongTabWidget.setTabText( self.SongTabWidget.setTabText(
self.SongTabWidget.indexOf(self.LyricsTab), self.SongTabWidget.indexOf(self.LyricsTab),
translate('EditSongForm', 'Title && Lyrics')) translate(u'SongsPlugin.EditSongForm', u'Title && Lyrics'))
self.AuthorsGroupBox.setTitle(translate('EditSongForm', 'Authors')) self.AuthorsGroupBox.setTitle(
self.AuthorAddButton.setText(translate('EditSongForm', '&Add to Song')) translate(u'SongsPlugin.EditSongForm', u'Authors'))
self.AuthorRemoveButton.setText(translate('EditSongForm', '&Remove')) self.AuthorAddButton.setText(
translate(u'SongsPlugin.EditSongForm', u'&Add to Song'))
self.AuthorRemoveButton.setText(
translate(u'SongsPlugin.EditSongForm', u'&Remove'))
self.MaintenanceButton.setText( self.MaintenanceButton.setText(
translate('EditSongForm', '&Manage Authors, Topics, Books')) translate(u'SongsPlugin.EditSongForm',
self.TopicGroupBox.setTitle(translate('EditSongForm', 'Topic')) u'&Manage Authors, Topics, Books'))
self.TopicAddButton.setText(translate('EditSongForm', 'A&dd to Song')) self.TopicGroupBox.setTitle(
self.TopicRemoveButton.setText(translate('EditSongForm', 'R&emove')) translate(u'SongsPlugin.EditSongForm', u'Topic'))
self.SongBookGroup.setTitle(translate('EditSongForm', 'Song Book')) self.TopicAddButton.setText(
translate(u'SongsPlugin.EditSongForm', u'A&dd to Song'))
self.TopicRemoveButton.setText(
translate(u'SongsPlugin.EditSongForm', u'R&emove'))
self.SongBookGroup.setTitle(
translate(u'SongsPlugin.EditSongForm', u'Song Book'))
self.SongTabWidget.setTabText( self.SongTabWidget.setTabText(
self.SongTabWidget.indexOf(self.AuthorsTab), self.SongTabWidget.indexOf(self.AuthorsTab),
translate('EditSongForm', 'Authors, Topics && Book')) translate(u'SongsPlugin.EditSongForm', u'Authors, Topics && Book'))
self.ThemeGroupBox.setTitle(translate('EditSongForm', 'Theme')) self.ThemeGroupBox.setTitle(
self.ThemeAddButton.setText(translate('EditSongForm', 'Add a Theme')) translate(u'SongsPlugin.EditSongForm', u'Theme'))
self.CopyrightGroupBox.setTitle(translate('EditSongForm', 'Copyright Information')) self.ThemeAddButton.setText(
self.CopyrightInsertButton.setText(translate('EditSongForm', u'\xa9')) translate(u'SongsPlugin.EditSongForm', u'Add a Theme'))
self.CCLILabel.setText(translate('EditSongForm', 'CCLI Number:')) self.CopyrightGroupBox.setTitle(
self.CommentsGroupBox.setTitle(translate('EditSongForm', 'Comments')) translate(u'SongsPlugin.EditSongForm', u'Copyright Information'))
self.CopyrightInsertButton.setText(
translate('EditSongForm', u'\xa9'))
self.CCLILabel.setText(
translate(u'SongsPlugin.EditSongForm', u'CCLI Number:'))
self.CommentsGroupBox.setTitle(
translate(u'SongsPlugin.EditSongForm', u'Comments'))
self.SongTabWidget.setTabText( self.SongTabWidget.setTabText(
self.SongTabWidget.indexOf(self.ThemeTab), self.SongTabWidget.indexOf(self.ThemeTab),
translate('EditSongForm', 'Theme, Copyright Info && Comments')) translate(u'SongsPlugin.EditSongForm',
u'Theme, Copyright Info && Comments'))

View File

@ -101,7 +101,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtCore.QObject.connect(self.VerseOrderEdit, QtCore.QObject.connect(self.VerseOrderEdit,
QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus) QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus)
self.previewButton = QtGui.QPushButton() self.previewButton = QtGui.QPushButton()
self.previewButton.setText(translate('EditSongForm','Save && Preview')) self.previewButton.setText(
translate(u'SongsPlugin.EditSongForm', u'Save && Preview'))
self.ButtonBox.addButton( self.ButtonBox.addButton(
self.previewButton, QtGui.QDialogButtonBox.ActionRole) self.previewButton, QtGui.QDialogButtonBox.ActionRole)
QtCore.QObject.connect(self.ButtonBox, QtCore.QObject.connect(self.ButtonBox,
@ -460,27 +461,32 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if len(self.TitleEditItem.displayText()) == 0: if len(self.TitleEditItem.displayText()) == 0:
self.SongTabWidget.setCurrentIndex(0) self.SongTabWidget.setCurrentIndex(0)
self.TitleEditItem.setFocus() self.TitleEditItem.setFocus()
return False, translate('EditSongForm','You need to enter a song title.') return False, translate(u'SongsPlugin.EditSongForm',
u'You need to enter a song title.')
if self.VerseListWidget.rowCount() == 0: if self.VerseListWidget.rowCount() == 0:
self.SongTabWidget.setCurrentIndex(0) self.SongTabWidget.setCurrentIndex(0)
self.VerseListWidget.setFocus() self.VerseListWidget.setFocus()
return False, translate('EditSongForm','You need to enter some verses.') return False, translate(u'SongsPlugin.EditSongForm',
u'You need to enter some verses.')
if self.AuthorsListView.count() == 0: if self.AuthorsListView.count() == 0:
self.SongTabWidget.setCurrentIndex(1) self.SongTabWidget.setCurrentIndex(1)
self.AuthorsListView.setFocus() self.AuthorsListView.setFocus()
#split the verse list by space and mark lower case for testing #split the verse list by space and mark lower case for testing
taglist = unicode(translate('EditSongForm',' bitped')) taglist = unicode(translate(u'SongsPlugin.EditSongForm', u' bitped'))
for verse in unicode(self.VerseOrderEdit.text()).lower().split(u' '): for verse in unicode(self.VerseOrderEdit.text()).lower().split(u' '):
if len(verse) > 1: if len(verse) > 1:
if (verse[0:1] == u'%s' % translate('EditSongForm','v') or if (verse[0:1] == u'%s' % translate(u'SongsPlugin.EditSongForm',
verse[0:1] == u'%s' % translate('EditSongForm','c')) \ u'v') or
verse[0:1] == u'%s' % translate(u'SongsPlugin.EditSongForm',
u'c')) \
and verse[1:].isdigit(): and verse[1:].isdigit():
pass pass
else: else:
self.SongTabWidget.setCurrentIndex(0) self.SongTabWidget.setCurrentIndex(0)
self.VerseOrderEdit.setFocus() self.VerseOrderEdit.setFocus()
return False, \ return False, \
translate('EditSongForm','Invalid verse entry - Vx or Cx') translate(u'SongsPlugin.EditSongForm',
u'Invalid verse entry - Vx or Cx')
else: else:
if taglist.find(verse) > -1: if taglist.find(verse) > -1:
pass pass
@ -488,8 +494,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.SongTabWidget.setCurrentIndex(0) self.SongTabWidget.setCurrentIndex(0)
self.VerseOrderEdit.setFocus() self.VerseOrderEdit.setFocus()
return False, \ return False, \
translate('EditSongForm',\ translate(u'SongsPlugin.EditSongForm',\
'Invalid verse entry, values must be I,B,T,P,E,O,Vx,Cx') u'Invalid verse entry, values must be '
u'I,B,T,P,E,O,Vx,Cx')
return True, u'' return True, u''
def onTitleEditItemLostFocus(self): def onTitleEditItemLostFocus(self):
@ -524,7 +531,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
The Song is valid so as the plugin to add it to preview to see. The Song is valid so as the plugin to add it to preview to see.
""" """
log.debug(u'onPreview') log.debug(u'onPreview')
if button.text() == unicode(translate('EditSongForm','Save && Preview')) \ if button.text() == unicode(
translate(u'SongsPlugin.EditSongForm', u'Save && Preview')) \
and self.saveSong(): and self.saveSong():
Receiver.send_message(u'songs_preview') Receiver.send_message(u'songs_preview')
@ -542,7 +550,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
valid, message = self._validate_song() valid, message = self._validate_song()
if not valid: if not valid:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('EditSongForm','Error'), message, self, translate(u'SongsPlugin.EditSongForm', u'Error'), message,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return False return False
self.song.title = unicode(self.TitleEditItem.displayText()) self.song.title = unicode(self.TitleEditItem.displayText())

View File

@ -90,15 +90,25 @@ class Ui_EditVerseDialog(object):
QtCore.QMetaObject.connectSlotsByName(EditVerseDialog) QtCore.QMetaObject.connectSlotsByName(EditVerseDialog)
def retranslateUi(self, EditVerseDialog): def retranslateUi(self, EditVerseDialog):
EditVerseDialog.setWindowTitle(translate('EditVerseForm', 'Edit Verse')) EditVerseDialog.setWindowTitle(
self.VerseTypeLabel.setText(translate('EditVerseForm', 'Verse Type:')) translate(u'SongsPlugin.EditVerseForm', u'Edit Verse'))
self.VerseTypeComboBox.setItemText(0, translate('EditVerseForm', 'Verse')) self.VerseTypeLabel.setText(
self.VerseTypeComboBox.setItemText(1, translate('EditVerseForm', 'Chorus')) translate(u'SongsPlugin.EditVerseForm', u'Verse Type:'))
self.VerseTypeComboBox.setItemText(2, translate('EditVerseForm', 'Bridge')) self.VerseTypeComboBox.setItemText(0,
self.VerseTypeComboBox.setItemText(3, translate('EditVerseForm', 'Pre-Chorus')) translate(u'SongsPlugin.EditVerseForm', u'Verse'))
self.VerseTypeComboBox.setItemText(4, translate('EditVerseForm', 'Intro')) self.VerseTypeComboBox.setItemText(1,
self.VerseTypeComboBox.setItemText(5, translate('EditVerseForm', 'Ending')) translate(u'SongsPlugin.EditVerseForm', u'Chorus'))
self.VerseTypeComboBox.setItemText(6, translate('EditVerseForm', 'Other')) self.VerseTypeComboBox.setItemText(2,
self.InsertButton.setText(translate('EditVerseForm', 'Insert')) translate(u'SongsPlugin.EditVerseForm', u'Bridge'))
self.VerseTypeComboBox.setItemText(3,
translate(u'SongsPlugin.EditVerseForm', u'Pre-Chorus'))
self.VerseTypeComboBox.setItemText(4,
translate(u'SongsPlugin.EditVerseForm', u'Intro'))
self.VerseTypeComboBox.setItemText(5,
translate(u'SongsPlugin.EditVerseForm', u'Ending'))
self.VerseTypeComboBox.setItemText(6,
translate(u'SongsPlugin.EditVerseForm', u'Other'))
self.InsertButton.setText(
translate(u'SongsPlugin.EditVerseForm', u'Insert'))

View File

@ -286,21 +286,41 @@ class Ui_OpenLPExportDialog(object):
QtCore.QMetaObject.connectSlotsByName(OpenLPExportDialog) QtCore.QMetaObject.connectSlotsByName(OpenLPExportDialog)
def retranslateUi(self, OpenLPExportDialog): def retranslateUi(self, OpenLPExportDialog):
OpenLPExportDialog.setWindowTitle(translate('OpenLPExportForm', 'openlp.org Song Exporter')) OpenLPExportDialog.setWindowTitle(
self.ExportFileLabel.setText(translate('OpenLPExportForm', 'Select openlp.org export filename:')) translate(u'SongsPlugin.OpenLPExportForm',
self.ExportListLabel.setText(translate('OpenLPExportForm', 'Full Song List')) u'openlp.org Song Exporter'))
self.ExportListTable.horizontalHeaderItem(0).setText(translate('OpenLPExportForm', 'Song Title')) self.ExportFileLabel.setText(
self.ExportListTable.horizontalHeaderItem(1).setText(translate('OpenLPExportForm', 'Author')) translate(u'SongsPlugin.OpenLPExportForm',
self.ExportSelectAllPushButton.setText(translate('OpenLPExportForm', 'Select All')) u'Select openlp.org export filename:'))
self.ExportFilterComboBox.setItemText(0, translate('OpenLPExportForm', 'Lyrics')) self.ExportListLabel.setText(
self.ExportFilterComboBox.setItemText(1, translate('OpenLPExportForm', 'Title')) translate(u'SongsPlugin.OpenLPExportForm', u'Full Song List'))
self.ExportFilterComboBox.setItemText(2, translate('OpenLPExportForm', 'Author')) self.ExportListTable.horizontalHeaderItem(0).setText(
self.SelectedListLabel.setText(translate('OpenLPExportForm', 'Song Export List')) translate(u'SongsPlugin.OpenLPExportForm', u'Song Title'))
self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenLPExportForm', 'Song Title')) self.ExportListTable.horizontalHeaderItem(1).setText(
self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenLPExportForm', 'Author')) translate(u'SongsPlugin.OpenLPExportForm', u'Author'))
self.SelectedSelectAllPushButton.setText(translate('OpenLPExportForm', 'Select All')) self.ExportSelectAllPushButton.setText(
self.SelectedRemoveSelectedButton.setText(translate('OpenLPExportForm', 'Remove Selected')) translate(u'SongsPlugin.OpenLPExportForm', u'Select All'))
self.ProgressGroupBox.setTitle(translate('OpenLPExportForm', 'Progress:')) self.ExportFilterComboBox.setItemText(0,
self.ProgressLabel.setText(translate('OpenLPExportForm', 'Ready to export')) translate(u'SongsPlugin.OpenLPExportForm', u'Lyrics'))
self.ExportPushButton.setText(translate('OpenLPExportForm', 'Export')) self.ExportFilterComboBox.setItemText(1,
self.ClosePushButton.setText(translate('OpenLPExportForm', 'Close')) translate(u'SongsPlugin.OpenLPExportForm', u'Title'))
self.ExportFilterComboBox.setItemText(2,
translate(u'SongsPlugin.OpenLPExportForm', u'Author'))
self.SelectedListLabel.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Song Export List'))
self.SelectedListTable.horizontalHeaderItem(0).setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Author'))
self.SelectedSelectAllPushButton.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Select All'))
self.SelectedRemoveSelectedButton.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Remove Selected'))
self.ProgressGroupBox.setTitle(
translate(u'SongsPlugin.OpenLPExportForm', u'Progress:'))
self.ProgressLabel.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Ready to export'))
self.ExportPushButton.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Export'))
self.ClosePushButton.setText(
translate(u'SongsPlugin.OpenLPExportForm', u'Close'))

View File

@ -286,21 +286,42 @@ class Ui_OpenLPImportDialog(object):
QtCore.QMetaObject.connectSlotsByName(OpenLPImportDialog) QtCore.QMetaObject.connectSlotsByName(OpenLPImportDialog)
def retranslateUi(self, OpenLPImportDialog): def retranslateUi(self, OpenLPImportDialog):
OpenLPImportDialog.setWindowTitle(translate('OpenLPImportForm', 'openlp.org Song Importer')) OpenLPImportDialog.setWindowTitle(
self.ImportFileLabel.setText(translate('OpenLPImportForm', 'Select openlp.org songfile to import:')) translate(u'SongsPlugin.OpenLPImportForm',
self.ImportListLabel.setText(translate('OpenLPImportForm', 'Import File Song List')) u'openlp.org Song Importer'))
self.ImportListTable.horizontalHeaderItem(0).setText(translate('OpenLPImportForm', 'Song Title')) self.ImportFileLabel.setText(
self.ImportListTable.horizontalHeaderItem(1).setText(translate('OpenLPImportForm', 'Author')) translate(u'SongsPlugin.OpenLPImportForm',
self.ImportSelectAllPushButton.setText(translate('OpenLPImportForm', 'Select All')) u'Select openlp.org songfile to import:'))
self.ImportFilterComboBox.setItemText(0, translate('OpenLPImportForm', 'Lyrics')) self.ImportListLabel.setText(
self.ImportFilterComboBox.setItemText(1, translate('OpenLPImportForm', 'Title')) translate(u'SongsPlugin.OpenLPImportForm',
self.ImportFilterComboBox.setItemText(2, translate('OpenLPImportForm', 'Author')) u'Import File Song List'))
self.SelectedListLabel.setText(translate('OpenLPImportForm', 'Song Import List')) self.ImportListTable.horizontalHeaderItem(0).setText(
self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenLPImportForm', 'Song Title')) translate(u'SongsPlugin.OpenLPImportForm', u'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenLPImportForm', 'Author')) self.ImportListTable.horizontalHeaderItem(1).setText(
self.SelectedSelectAllPushButton.setText(translate('OpenLPImportForm', 'Select All')) translate(u'SongsPlugin.OpenLPImportForm', u'Author'))
self.SelectedRemoveSelectedButton.setText(translate('OpenLPImportForm', 'Remove Selected')) self.ImportSelectAllPushButton.setText(
self.ProgressGroupBox.setTitle(translate('OpenLPImportForm', 'Progress:')) translate(u'SongsPlugin.OpenLPImportForm', u'Select All'))
self.ProgressLabel.setText(translate('OpenLPImportForm', 'Ready to import')) self.ImportFilterComboBox.setItemText(0,
self.ImportPushButton.setText(translate('OpenLPImportForm', 'Import')) translate(u'SongsPlugin.OpenLPImportForm', u'Lyrics'))
self.ClosePushButton.setText(translate('OpenLPImportForm', 'Close')) self.ImportFilterComboBox.setItemText(1,
translate(u'SongsPlugin.OpenLPImportForm', u'Title'))
self.ImportFilterComboBox.setItemText(2,
translate(u'SongsPlugin.OpenLPImportForm', u'Author'))
self.SelectedListLabel.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Song Import List'))
self.SelectedListTable.horizontalHeaderItem(0).setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Author'))
self.SelectedSelectAllPushButton.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Select All'))
self.SelectedRemoveSelectedButton.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Remove Selected'))
self.ProgressGroupBox.setTitle(
translate(u'SongsPlugin.OpenLPImportForm', u'Progress:'))
self.ProgressLabel.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Ready to import'))
self.ImportPushButton.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Import'))
self.ClosePushButton.setText(
translate(u'SongsPlugin.OpenLPImportForm', u'Close'))

View File

@ -286,21 +286,39 @@ class Ui_OpenSongExportDialog(object):
QtCore.QMetaObject.connectSlotsByName(OpenSongExportDialog) QtCore.QMetaObject.connectSlotsByName(OpenSongExportDialog)
def retranslateUi(self, OpenSongExportDialog): def retranslateUi(self, OpenSongExportDialog):
OpenSongExportDialog.setWindowTitle(translate('OpenSongExportForm', 'OpenSong Song Exporter')) OpenSongExportDialog.setWindowTitle(
self.ExportFileLabel.setText(translate('OpenSongExportForm', 'Select OpenSong song folder:')) translate(u'SongsPlugin.OpenSongExportForm', u'OpenSong Song Exporter'))
self.ExportListLabel.setText(translate('OpenSongExportForm', 'Full Song List')) self.ExportFileLabel.setText(
self.ExportListTable.horizontalHeaderItem(0).setText(translate('OpenSongExportForm', 'Song Title')) translate(u'SongsPlugin.OpenSongExportForm', u'Select OpenSong song folder:'))
self.ExportListTable.horizontalHeaderItem(1).setText(translate('OpenSongExportForm', 'Author')) self.ExportListLabel.setText(
self.ExportSelectAllPushButton.setText(translate('OpenSongExportForm', 'Select All')) translate(u'SongsPlugin.OpenSongExportForm', u'Full Song List'))
self.ExportFilterComboBox.setItemText(0, translate('OpenSongExportForm', 'Lyrics')) self.ExportListTable.horizontalHeaderItem(0).setText(
self.ExportFilterComboBox.setItemText(1, translate('OpenSongExportForm', 'Title')) translate(u'SongsPlugin.OpenSongExportForm', u'Song Title'))
self.ExportFilterComboBox.setItemText(2, translate('OpenSongExportForm', 'Author')) self.ExportListTable.horizontalHeaderItem(1).setText(
self.SelectedListLabel.setText(translate('OpenSongExportForm', 'Song Export List')) translate(u'SongsPlugin.OpenSongExportForm', u'Author'))
self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenSongExportForm', 'Song Title')) self.ExportSelectAllPushButton.setText(
self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenSongExportForm', 'Author')) translate(u'SongsPlugin.OpenSongExportForm', u'Select All'))
self.SelectedSelectAllPushButton.setText(translate('OpenSongExportForm', 'Select All')) self.ExportFilterComboBox.setItemText(0,
self.SelectedRemoveSelectedButton.setText(translate('OpenSongExportForm', 'Remove Selected')) translate(u'SongsPlugin.OpenSongExportForm', u'Lyrics'))
self.ProgressGroupBox.setTitle(translate('OpenSongExportForm', 'Progress:')) self.ExportFilterComboBox.setItemText(1,
self.ProgressLabel.setText(translate('OpenSongExportForm', 'Ready to export')) translate(u'SongsPlugin.OpenSongExportForm', u'Title'))
self.ExportPushButton.setText(translate('OpenSongExportForm', 'Export')) self.ExportFilterComboBox.setItemText(2,
self.ClosePushButton.setText(translate('OpenSongExportForm', 'Close')) translate(u'SongsPlugin.OpenSongExportForm', u'Author'))
self.SelectedListLabel.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Song Export List'))
self.SelectedListTable.horizontalHeaderItem(0).setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Song Title'))
self.SelectedListTable.horizontalHeaderItem(1).setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Author'))
self.SelectedSelectAllPushButton.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Select All'))
self.SelectedRemoveSelectedButton.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Remove Selected'))
self.ProgressGroupBox.setTitle(
translate(u'SongsPlugin.OpenSongExportForm', u'Progress:'))
self.ProgressLabel.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Ready to export'))
self.ExportPushButton.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Export'))
self.ClosePushButton.setText(
translate(u'SongsPlugin.OpenSongExportForm', u'Close'))

View File

@ -101,9 +101,15 @@ class Ui_OpenSongImportDialog(object):
QtCore.QMetaObject.connectSlotsByName(OpenSongImportDialog) QtCore.QMetaObject.connectSlotsByName(OpenSongImportDialog)
def retranslateUi(self, OpenSongImportDialog): def retranslateUi(self, OpenSongImportDialog):
OpenSongImportDialog.setWindowTitle(translate('OpenSongImportForm', 'OpenSong Song Importer')) OpenSongImportDialog.setWindowTitle(
self.ImportFileLabel.setText(translate('OpenSongImportForm', 'OpenSong Folder:')) translate(u'SongsPlugin.OpenSongImportForm', u'OpenSong Song Importer'))
self.ProgressGroupBox.setTitle(translate('OpenSongImportForm', 'Progress:')) self.ImportFileLabel.setText(
self.ProgressLabel.setText(translate('OpenSongImportForm', 'Ready to import')) translate(u'SongsPlugin.OpenSongImportForm', u'OpenSong Folder:'))
self.ImportPushButton.setText(translate('OpenSongImportForm', 'Import')) self.ProgressGroupBox.setTitle(
self.ClosePushButton.setText(translate('OpenSongImportForm', 'Close')) translate(u'SongsPlugin.OpenSongImportForm', u'Progress:'))
self.ProgressLabel.setText(
translate(u'SongsPlugin.OpenSongImportForm', u'Ready to import'))
self.ImportPushButton.setText(
translate(u'SongsPlugin.OpenSongImportForm', u'Import'))
self.ClosePushButton.setText(
translate(u'SongsPlugin.OpenSongImportForm', u'Close'))

View File

@ -66,6 +66,8 @@ class Ui_SongBookDialog(object):
QtCore.QMetaObject.connectSlotsByName(SongBookDialog) QtCore.QMetaObject.connectSlotsByName(SongBookDialog)
def retranslateUi(self, SongBookDialog): def retranslateUi(self, SongBookDialog):
SongBookDialog.setWindowTitle(translate('SongBookForm', 'Edit Book')) SongBookDialog.setWindowTitle(
self.NameLabel.setText(translate('SongBookForm', 'Name:')) translate(u'SongsPlugin.SongBookForm', u'Edit Book'))
self.PublisherLabel.setText(translate('SongBookForm', 'Publisher:')) self.NameLabel.setText(translate(u'SongsPlugin.SongBookForm', u'Name:'))
self.PublisherLabel.setText(
translate(u'SongsPlugin.SongBookForm', u'Publisher:'))

View File

@ -50,8 +50,9 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
def accept(self): def accept(self):
if not self.NameEdit.text(): if not self.NameEdit.text():
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('SongBookForm','Error'), self, translate(u'SongsPlugin.SongBookForm', u'Error'),
translate('SongBookForm','You need to type in a book name!'), translate(u'SongsPlugin.SongBookForm',
u'You need to type in a book name!'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.NameEdit.setFocus() self.NameEdit.setFocus()
return False return False

View File

@ -104,36 +104,43 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
if source_format == SongFormat.OpenLyrics: if source_format == SongFormat.OpenLyrics:
if self.OpenLyricsFileListWidget.count() == 0: if self.OpenLyricsFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate('SongImportForm','No OpenLyrics Files Selected'), translate(u'SongsPlugin.SongImportForm',
translate('SongImportForm','You need to add at least one OpenLyrics ' u'No OpenLyrics Files Selected'),
'song file to import from.'), translate(u'SongsPlugin.SongImportForm',
u'You need to add at least one OpenLyrics '
u'song file to import from.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.OpenLyricsAddButton.setFocus() self.OpenLyricsAddButton.setFocus()
return False return False
elif source_format == SongFormat.OpenSong: elif source_format == SongFormat.OpenSong:
if self.OpenSongFileListWidget.count() == 0: if self.OpenSongFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate('SongImportForm','No OpenSong Files Selected'), translate(u'SongsPlugin.SongImportForm',
translate('SongImportForm','You need to add at least one OpenSong ' u'No OpenSong Files Selected'),
'song file to import from.'), translate(u'SongsPlugin.SongImportForm',
u'You need to add at least one OpenSong '
u'song file to import from.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.OpenSongAddButton.setFocus() self.OpenSongAddButton.setFocus()
return False return False
elif source_format == SongFormat.CCLI: elif source_format == SongFormat.CCLI:
if self.CCLIFileListWidget.count() == 0: if self.CCLIFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate('SongImportForm','No CCLI Files Selected'), translate(u'SongsPlugin.SongImportForm',
translate('SongImportForm','You need to add at least one CCLI file ' u'No CCLI Files Selected'),
'to import from.'), translate(u'SongsPlugin.SongImportForm',
u'You need to add at least one CCLI file '
u'to import from.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.CCLIAddButton.setFocus() self.CCLIAddButton.setFocus()
return False return False
elif source_format == SongFormat.CSV: elif source_format == SongFormat.CSV:
if self.CSVFilenameEdit.text().isEmpty(): if self.CSVFilenameEdit.text().isEmpty():
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate('SongImportForm','No CSV File Selected'), translate(u'SongsPlugin.SongImportForm',
translate('SongImportForm','You need to specify a CSV file to import ' u'No CSV File Selected'),
'from.'), translate(u'SongsPlugin.SongImportForm',
u'You need to specify a CSV file to import from.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.CSVFilenameEdit.setFocus() self.CSVFilenameEdit.setFocus()
return False return False
@ -184,7 +191,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
self.ImportProgressBar.setMinimum(0) self.ImportProgressBar.setMinimum(0)
self.ImportProgressBar.setMaximum(1188) self.ImportProgressBar.setMaximum(1188)
self.ImportProgressBar.setValue(0) self.ImportProgressBar.setValue(0)
self.ImportProgressLabel.setText(translate('SongImportForm','Starting import...')) self.ImportProgressLabel.setText(
translate(u'SongsPlugin.SongImportForm', u'Starting import...'))
Receiver.send_message(u'process_events') Receiver.send_message(u'process_events')
def performImport(self): def performImport(self):
@ -235,10 +243,10 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
# self.manager.save_meta_data(license_version, license_version, # self.manager.save_meta_data(license_version, license_version,
# license_copyright, license_permission) # license_copyright, license_permission)
# self.manager.reload_bibles() # self.manager.reload_bibles()
# self.ImportProgressLabel.setText(translate('SongImportForm','Finished import.')) # self.ImportProgressLabel.setText(translate(u'SongsPlugin.SongImportForm', u'Finished import.'))
# else: # else:
# self.ImportProgressLabel.setText( # self.ImportProgressLabel.setText(
# translate('SongImportForm','Your Bible import failed.')) # translate(u'SongsPlugin.SongImportForm', u'Your Bible import failed.'))
# importer.delete() # importer.delete()
def postImport(self): def postImport(self):

View File

@ -226,32 +226,55 @@ class Ui_SongImportWizard(object):
QtCore.QMetaObject.connectSlotsByName(SongImportWizard) QtCore.QMetaObject.connectSlotsByName(SongImportWizard)
def retranslateUi(self, SongImportWizard): def retranslateUi(self, SongImportWizard):
SongImportWizard.setWindowTitle(translate('SongImportWizard','Song Import Wizard')) SongImportWizard.setWindowTitle(
translate(u'SongsPlugin.SongImportWizard', u'Song Import Wizard'))
self.TitleLabel.setText( self.TitleLabel.setText(
'<span style="font-size:14pt; font-weight:600;">%s</span>' % \ '<span style="font-size:14pt; font-weight:600;">%s</span>' % \
translate('SongImportWizard','Welcome to the Song Import Wizard')) translate(u'SongsPlugin.SongImportWizard',
self.InformationLabel.setText(translate('SongImportWizard','This wizard will help you ' u'Welcome to the Song Import Wizard'))
'to import songs from a variety of formats. Click the next button ' self.InformationLabel.setText(
'below to start the process by selecting a format to import from.')) translate(u'SongsPlugin.SongImportWizard',
self.SourcePage.setTitle(translate('SongImportWizard','Select Import Source')) u'This wizard will help you to import songs from a variety of '
self.SourcePage.setSubTitle(translate('SongImportWizard','Select the import format, ' u'formats. Click the next button below to start the process by '
'and where to import from.')) u'selecting a format to import from.'))
self.FormatLabel.setText(translate('SongImportWizard','Format:')) self.SourcePage.setTitle(
self.FormatComboBox.setItemText(0, translate('SongImportWizard','OpenLyrics')) translate(u'SongsPlugin.SongImportWizard', u'Select Import Source'))
self.FormatComboBox.setItemText(1, translate('SongImportWizard','OpenSong')) self.SourcePage.setSubTitle(
self.FormatComboBox.setItemText(2, translate('SongImportWizard','CCLI')) translate(u'SongsPlugin.SongImportWizard',
self.FormatComboBox.setItemText(3, translate('SongImportWizard','CSV')) u'Select the import format, and where to import from.'))
self.OpenLyricsAddButton.setText(translate('SongImportWizard','Add Files...')) self.FormatLabel.setText(
self.OpenLyricsRemoveButton.setText(translate('SongImportWizard','Remove File(s)')) translate(u'SongsPlugin.SongImportWizard', u'Format:'))
self.OpenSongAddButton.setText(translate('SongImportWizard','Add Files...')) self.FormatComboBox.setItemText(0,
self.OpenSongRemoveButton.setText(translate('SongImportWizard','Remove File(s)')) translate(u'SongsPlugin.SongImportWizard', u'OpenLyrics'))
self.CCLIAddButton.setText(translate('SongImportWizard','Add Files...')) self.FormatComboBox.setItemText(1,
self.CCLIRemoveButton.setText(translate('SongImportWizard','Remove File(s)')) translate(u'SongsPlugin.SongImportWizard', u'OpenSong'))
self.CSVFilenameLabel.setText(translate('SongImportWizard','Filename:')) self.FormatComboBox.setItemText(2,
self.CSVBrowseButton.setText(translate('SongImportWizard','Browse...')) translate(u'SongsPlugin.SongImportWizard', u'CCLI'))
self.ImportPage.setTitle(translate('SongImportWizard','Importing')) self.FormatComboBox.setItemText(3,
self.ImportPage.setSubTitle(translate('SongImportWizard','Please wait while your songs ' translate(u'SongsPlugin.SongImportWizard', u'CSV'))
'are imported.')) self.OpenLyricsAddButton.setText(
self.ImportProgressLabel.setText(translate('SongImportWizard','Ready.')) translate(u'SongsPlugin.SongImportWizard', u'Add Files...'))
self.ImportProgressBar.setFormat(translate('SongImportWizard','%p%')) self.OpenLyricsRemoveButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Remove File(s)'))
self.OpenSongAddButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Add Files...'))
self.OpenSongRemoveButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Remove File(s)'))
self.CCLIAddButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Add Files...'))
self.CCLIRemoveButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Remove File(s)'))
self.CSVFilenameLabel.setText(
translate(u'SongsPlugin.SongImportWizard', u'Filename:'))
self.CSVBrowseButton.setText(
translate(u'SongsPlugin.SongImportWizard', u'Browse...'))
self.ImportPage.setTitle(
translate(u'SongsPlugin.SongImportWizard', u'Importing'))
self.ImportPage.setSubTitle(
translate(u'SongsPlugin.SongImportWizard',
u'Please wait while your songs are imported.'))
self.ImportProgressLabel.setText(
translate(u'SongsPlugin.SongImportWizard', u'Ready.'))
self.ImportProgressBar.setFormat(
translate(u'SongsPlugin.SongImportWizard', u'%p%'))

View File

@ -208,16 +208,29 @@ class Ui_SongMaintenanceDialog(object):
QtCore.QMetaObject.connectSlotsByName(SongMaintenanceDialog) QtCore.QMetaObject.connectSlotsByName(SongMaintenanceDialog)
def retranslateUi(self, SongMaintenanceDialog): def retranslateUi(self, SongMaintenanceDialog):
SongMaintenanceDialog.setWindowTitle(translate('SongMaintenanceForm', 'Song Maintenance')) SongMaintenanceDialog.setWindowTitle(
self.TypeListWidget.item(0).setText(translate('SongMaintenanceForm', 'Authors')) translate(u'SongsPlugin.SongMaintenanceForm', u'Song Maintenance'))
self.TypeListWidget.item(1).setText(translate('SongMaintenanceForm', 'Topics')) self.TypeListWidget.item(0).setText(
self.TypeListWidget.item(2).setText(translate('SongMaintenanceForm', 'Books/Hymnals')) translate(u'SongsPlugin.SongMaintenanceForm', u'Authors'))
self.AuthorAddButton.setText(translate('SongMaintenanceForm', 'Add')) self.TypeListWidget.item(1).setText(
self.AuthorEditButton.setText(translate('SongMaintenanceForm', 'Edit')) translate(u'SongsPlugin.SongMaintenanceForm', u'Topics'))
self.AuthorDeleteButton.setText(translate('SongMaintenanceForm', 'Delete')) self.TypeListWidget.item(2).setText(
self.TopicAddButton.setText(translate('SongMaintenanceForm', 'Add')) translate(u'SongsPlugin.SongMaintenanceForm', u'Books/Hymnals'))
self.TopicEditButton.setText(translate('SongMaintenanceForm', 'Edit')) self.AuthorAddButton.setText(
self.TopicDeleteButton.setText(translate('SongMaintenanceForm', 'Delete')) translate(u'SongsPlugin.SongMaintenanceForm', u'Add'))
self.BookAddButton.setText(translate('SongMaintenanceForm', 'Add')) self.AuthorEditButton.setText(
self.BookEditButton.setText(translate('SongMaintenanceForm', 'Edit')) translate(u'SongsPlugin.SongMaintenanceForm', u'Edit'))
self.BookDeleteButton.setText(translate('SongMaintenanceForm', 'Delete')) self.AuthorDeleteButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Delete'))
self.TopicAddButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Add'))
self.TopicEditButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Edit'))
self.TopicDeleteButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Delete'))
self.BookAddButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Add'))
self.BookEditButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Edit'))
self.BookDeleteButton.setText(
translate(u'SongsPlugin.SongMaintenanceForm', u'Delete'))

View File

@ -140,8 +140,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetAuthors() self.resetAuthors()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('SongMaintenanceForm','Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','Couldn\'t add your author.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t add your author.'))
def onTopicAddButtonClick(self): def onTopicAddButtonClick(self):
if self.topicform.exec_(): if self.topicform.exec_():
@ -151,8 +153,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetTopics() self.resetTopics()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('SongMaintenanceForm','Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','Couldn\'t add your topic.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t add your topic.'))
def onBookAddButtonClick(self): def onBookAddButtonClick(self):
if self.bookform.exec_(): if self.bookform.exec_():
@ -163,8 +167,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetBooks() self.resetBooks()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('SongMaintenanceForm','Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','Couldn\'t add your book.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t add your book.'))
def onAuthorEditButtonClick(self): def onAuthorEditButtonClick(self):
author_id = self._getCurrentItemId(self.AuthorsListWidget) author_id = self._getCurrentItemId(self.AuthorsListWidget)
@ -185,8 +191,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetAuthors() self.resetAuthors()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('SongMaintenanceForm','Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','Couldn\'t save your author.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t save your author.'))
def onTopicEditButtonClick(self): def onTopicEditButtonClick(self):
topic_id = self._getCurrentItemId(self.TopicsListWidget) topic_id = self._getCurrentItemId(self.TopicsListWidget)
@ -199,8 +207,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetTopics() self.resetTopics()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('SongMaintenanceForm','Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','Couldn\'t save your topic.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t save your topic.'))
def onBookEditButtonClick(self): def onBookEditButtonClick(self):
book_id = self._getCurrentItemId(self.BooksListWidget) book_id = self._getCurrentItemId(self.BooksListWidget)
@ -216,8 +226,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetBooks() self.resetBooks()
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('SongMaintenanceForm','Error'), self, translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','Couldn\'t save your book.')) u'Error'),
translate(u'SongsPlugin.SongMaintenanceForm',
u'Couldn\'t save your book.'))
def onAuthorDeleteButtonClick(self): def onAuthorDeleteButtonClick(self):
""" """
@ -226,11 +238,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self._deleteItem( self._deleteItem(
self.AuthorsListWidget, self.songmanager.get_author, self.AuthorsListWidget, self.songmanager.get_author,
self.songmanager.delete_author, self.resetAuthors, self.songmanager.delete_author, self.resetAuthors,
translate('SongMaintenanceForm','Delete Author'), translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Author'),
translate('SongMaintenanceForm','Are you sure you want to delete the selected author?'), translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','This author can\'t be deleted, they are currently ' u'Are you sure you want to delete the selected author?'),
'assigned to at least one song.'), translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','No author selected!')) u'This author can\'t be deleted, they are currently '
u'assigned to at least one song.'),
translate(u'SongsPlugin.SongMaintenanceForm', u'No author selected!'))
def onTopicDeleteButtonClick(self): def onTopicDeleteButtonClick(self):
""" """
@ -239,11 +253,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self._deleteItem( self._deleteItem(
self.TopicsListWidget, self.songmanager.get_topic, self.TopicsListWidget, self.songmanager.get_topic,
self.songmanager.delete_topic, self.resetTopics, self.songmanager.delete_topic, self.resetTopics,
translate('SongMaintenanceForm','Delete Topic'), translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Topic'),
translate('SongMaintenanceForm','Are you sure you want to delete the selected topic?'), translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','This topic can\'t be deleted, it is currently ' u'Are you sure you want to delete the selected topic?'),
'assigned to at least one song.'), translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','No topic selected!')) u'This topic can\'t be deleted, it is currently '
u'assigned to at least one song.'),
translate(u'SongsPlugin.SongMaintenanceForm', u'No topic selected!'))
def onBookDeleteButtonClick(self): def onBookDeleteButtonClick(self):
""" """
@ -252,8 +268,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self._deleteItem( self._deleteItem(
self.BooksListWidget, self.songmanager.get_book, self.BooksListWidget, self.songmanager.get_book,
self.songmanager.delete_book, self.resetBooks, self.songmanager.delete_book, self.resetBooks,
translate('SongMaintenanceForm','Delete Book'), translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Book'),
translate('SongMaintenanceForm','Are you sure you want to delete the selected book?'), translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','This book can\'t be deleted, it is currently ' u'Are you sure you want to delete the selected book?'),
'assigned to at least one song.'), translate(u'SongsPlugin.SongMaintenanceForm',
translate('SongMaintenanceForm','No book selected!')) u'This book can\'t be deleted, it is currently '
u'assigned to at least one song.'),
translate(u'SongsPlugin.SongMaintenanceForm', u'No book selected!'))

View File

@ -60,5 +60,7 @@ class Ui_TopicsDialog(object):
QtCore.QMetaObject.connectSlotsByName(TopicsDialog) QtCore.QMetaObject.connectSlotsByName(TopicsDialog)
def retranslateUi(self, TopicsDialog): def retranslateUi(self, TopicsDialog):
TopicsDialog.setWindowTitle(translate('TopicsForm', 'Topic Maintenance')) TopicsDialog.setWindowTitle(
self.NameLabel.setText(translate('TopicsForm', 'Topic name:')) translate(u'SongsPlugin.TopicsForm', u'Topic Maintenance'))
self.NameLabel.setText(
translate(u'SongsPlugin.TopicsForm', u'Topic name:'))

View File

@ -49,8 +49,9 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
def accept(self): def accept(self):
if not self.NameEdit.text(): if not self.NameEdit.text():
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate('TopicsForm','Error'), self, translate(u'SongsPlugin.TopicsForm', u'Error'),
translate('TopicsForm','You need to type in a topic name!'), translate(u'SongsPlugin.TopicsForm',
u'You need to type in a topic name!'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.NameEdit.setFocus() self.NameEdit.setFocus()
return False return False

View File

@ -60,7 +60,7 @@ class SongMediaItem(MediaManagerItem):
self.remoteSong = -1 self.remoteSong = -1
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = translate('mediaItem','Song') self.PluginNameVisible = translate(u'SongsPlugin.MediaItem', u'Song')
def requiredIcons(self): def requiredIcons(self):
MediaManagerItem.requiredIcons(self) MediaManagerItem.requiredIcons(self)
@ -69,8 +69,10 @@ class SongMediaItem(MediaManagerItem):
def addEndHeaderBar(self): def addEndHeaderBar(self):
self.addToolbarSeparator() self.addToolbarSeparator()
## Song Maintenance Button ## ## Song Maintenance Button ##
self.addToolbarButton(translate('mediaItem','Song Maintenance'), self.addToolbarButton(
translate('mediaItem','Maintain the lists of authors, topics and books'), translate(u'SongsPlugin.MediaItem', u'Song Maintenance'),
translate(u'SongsPlugin.MediaItem',
u'Maintain the lists of authors, topics and books'),
':/songs/song_maintenance.png', self.onSongMaintenanceClick) ':/songs/song_maintenance.png', self.onSongMaintenanceClick)
self.PageLayout.setSpacing(4) self.PageLayout.setSpacing(4)
self.SearchLayout = QtGui.QFormLayout() self.SearchLayout = QtGui.QFormLayout()
@ -139,15 +141,22 @@ class SongMediaItem(MediaManagerItem):
QtCore.QVariant(u'False')).toBool() QtCore.QVariant(u'False')).toBool()
def retranslateUi(self): def retranslateUi(self):
self.SearchTextLabel.setText(translate('mediaItem','Search:')) self.SearchTextLabel.setText(
self.SearchTypeLabel.setText(translate('mediaItem','Type:')) translate(u'SongsPlugin.MediaItem', u'Search:'))
self.ClearTextButton.setText(translate('mediaItem','Clear')) self.SearchTypeLabel.setText(
self.SearchTextButton.setText(translate('mediaItem','Search')) translate(u'SongsPlugin.MediaItem', u'Type:'))
self.ClearTextButton.setText(
translate(u'SongsPlugin.MediaItem', u'Clear'))
self.SearchTextButton.setText(
translate(u'SongsPlugin.MediaItem', u'Search'))
def initialise(self): def initialise(self):
self.SearchTypeComboBox.addItem(translate('mediaItem','Titles')) self.SearchTypeComboBox.addItem(
self.SearchTypeComboBox.addItem(translate('mediaItem','Lyrics')) translate(u'SongsPlugin.MediaItem', u'Titles'))
self.SearchTypeComboBox.addItem(translate('mediaItem','Authors')) self.SearchTypeComboBox.addItem(
translate(u'SongsPlugin.MediaItem', u'Lyrics'))
self.SearchTypeComboBox.addItem(
translate(u'SongsPlugin.MediaItem', u'Authors'))
self.configUpdated() self.configUpdated()
def onSearchTextButtonClick(self): def onSearchTextButtonClick(self):
@ -203,7 +212,8 @@ class SongMediaItem(MediaManagerItem):
self.ListView.clear() self.ListView.clear()
for author in searchresults: for author in searchresults:
for song in author.songs: for song in author.songs:
song_detail = unicode(translate('mediaItem','%s (%s)' % \ song_detail = unicode(
translate(u'SongsPlugin.MediaItem', u'%s (%s)' % \
(unicode(author.display_name), unicode(song.title)))) (unicode(author.display_name), unicode(song.title))))
song_name = QtGui.QListWidgetItem(song_detail) song_name = QtGui.QListWidgetItem(song_detail)
song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
@ -281,12 +291,15 @@ class SongMediaItem(MediaManagerItem):
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()
if items: if items:
if len(items) == 1: if len(items) == 1:
del_message = translate('mediaItem','Delete song?') del_message = translate(u'SongsPlugin.MediaItem',
u'Delete song?')
else: else:
del_message = unicode( del_message = unicode(
translate('mediaItem','Delete %d songs?')) % len(items) translate(u'SongsPlugin.MediaItem',
u'Delete %d songs?')) % len(items)
ans = QtGui.QMessageBox.question(self, ans = QtGui.QMessageBox.question(self,
translate('mediaItem','Delete Confirmation'), del_message, translate(u'SongsPlugin.MediaItem', u'Delete Confirmation'),
del_message,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok| QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok|
QtGui.QMessageBox.Cancel), QtGui.QMessageBox.Cancel),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
@ -367,7 +380,7 @@ class SongMediaItem(MediaManagerItem):
raw_footer.append(author_list) raw_footer.append(author_list)
raw_footer.append(song.copyright ) raw_footer.append(song.copyright )
raw_footer.append(unicode( raw_footer.append(unicode(
translate('mediaItem','CCLI Licence: ') + ccli)) translate(u'SongsPlugin.MediaItem', u'CCLI Licence: ') + ccli))
service_item.raw_footer = raw_footer service_item.raw_footer = raw_footer
service_item.audit = [ service_item.audit = [
song.title, author_audit, song.copyright, song.ccli_number song.title, author_audit, song.copyright, song.ccli_number

View File

@ -63,9 +63,9 @@ class SongImport(object):
self.versecount = 0 self.versecount = 0
self.choruscount = 0 self.choruscount = 0
self.copyright_string = unicode(QtGui.QApplication.translate( \ self.copyright_string = unicode(QtGui.QApplication.translate( \
u'SongImport', u'copyright')) u'SongsPlugin.SongImport', u'copyright'))
self.copyright_symbol = unicode(QtGui.QApplication.translate( \ self.copyright_symbol = unicode(QtGui.QApplication.translate( \
u'SongImport', u'©')) u'SongsPlugin.SongImport', u'©'))
@staticmethod @staticmethod
def process_songs_text(manager, text): def process_songs_text(manager, text):

View File

@ -36,7 +36,7 @@ class SongsTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'SongsTab') self.setObjectName(u'SongsTab')
self.tabTitleVisible = translate('SongsTab','Songs') self.tabTitleVisible = translate(u'SongsPlugin.SongsTab', u'Songs')
self.SongsLayout = QtGui.QFormLayout(self) self.SongsLayout = QtGui.QFormLayout(self)
self.SongsLayout.setObjectName(u'SongsLayout') self.SongsLayout.setObjectName(u'SongsLayout')
self.SongsModeGroupBox = QtGui.QGroupBox(self) self.SongsModeGroupBox = QtGui.QGroupBox(self)
@ -61,11 +61,12 @@ class SongsTab(SettingsTab):
self.SongBarActiveCheckBoxChanged) self.SongBarActiveCheckBoxChanged)
def retranslateUi(self): def retranslateUi(self):
self.SongsModeGroupBox.setTitle(translate('SongsTab','Songs Mode')) self.SongsModeGroupBox.setTitle(
translate(u'SongsPlugin.SongsTab', u'Songs Mode'))
self.SearchAsTypeCheckBox.setText( self.SearchAsTypeCheckBox.setText(
translate('SongsTab','Enable search as you type')) translate(u'SongsPlugin.SongsTab', u'Enable search as you type'))
self.SongBarActiveCheckBox.setText( self.SongBarActiveCheckBox.setText(
translate('SongsTab','Display Verses on Live Tool bar')) translate(u'SongsPlugin.SongsTab', u'Display Verses on Live Tool bar'))
def onSearchAsTypeCheckBoxChanged(self, check_state): def onSearchAsTypeCheckBoxChanged(self, check_state):
self.song_search = False self.song_search = False

View File

@ -150,7 +150,8 @@ class SongsPlugin(Plugin):
def onImportSofItemClick(self): def onImportSofItemClick(self):
filenames = QtGui.QFileDialog.getOpenFileNames( filenames = QtGui.QFileDialog.getOpenFileNames(
None, translate('Songsplugin','Open Songs of Fellowship file'), None, translate(u'SongsPlugin.Songsplugin',
u'Open Songs of Fellowship file'),
u'', u'Songs of Fellowship file (*.rtf *.RTF)') u'', u'Songs of Fellowship file (*.rtf *.RTF)')
try: try:
for filename in filenames: for filename in filenames:
@ -170,15 +171,17 @@ class SongsPlugin(Plugin):
def onImportOooItemClick(self): def onImportOooItemClick(self):
filenames = QtGui.QFileDialog.getOpenFileNames( filenames = QtGui.QFileDialog.getOpenFileNames(
None, translate('Songsplugin','Open documents or presentations'), None, translate(u'SongsPlugin.Songsplugin',
u'Open documents or presentations'),
u'', u'All Files(*.*)') u'', u'All Files(*.*)')
oooimport = OooImport(self.manager) oooimport = OooImport(self.manager)
oooimport.import_docs(filenames) oooimport.import_docs(filenames)
Receiver.send_message(u'songs_load_list') Receiver.send_message(u'songs_load_list')
def about(self): def about(self):
about_text = translate('Songsplugin','<strong>Song Plugin</strong><br />' about_text = translate(u'SongsPlugin.Songsplugin',
'This plugin allows songs to be managed and displayed.') u'<strong>Song Plugin</strong><br />'
u'This plugin allows songs to be managed and displayed.')
return about_text return about_text
def can_delete_theme(self, theme): def can_delete_theme(self, theme):

View File

@ -58,4 +58,5 @@ class Ui_SongUsageDeleteDialog(object):
QtCore.QMetaObject.connectSlotsByName(SongUsageDeleteDialog) QtCore.QMetaObject.connectSlotsByName(SongUsageDeleteDialog)
def retranslateUi(self, SongUsageDeleteDialog): def retranslateUi(self, SongUsageDeleteDialog):
SongUsageDeleteDialog.setWindowTitle(translate('AuditDeleteDialog', 'Song Usage Delete')) SongUsageDeleteDialog.setWindowTitle(
translate(u'SongsPlugin.AuditDeleteDialog', u'Song Usage Delete'))

View File

@ -42,8 +42,10 @@ class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog):
def accept(self): def accept(self):
ret = QtGui.QMessageBox.question(self, ret = QtGui.QMessageBox.question(self,
translate('SongUsageDeleteForm','Delete Selected Song Usage Events?'), translate(u'SongsPlugin.SongUsageDeleteForm',
translate('SongUsageDeleteForm','Are you sure you want to delete selected Song Usage data?'), u'Delete Selected Song Usage Events?'),
translate(u'SongsPlugin.SongUsageDeleteForm',
u'Are you sure you want to delete selected Song Usage data?'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Ok | QtGui.QMessageBox.Ok |
QtGui.QMessageBox.Cancel), QtGui.QMessageBox.Cancel),

View File

@ -87,7 +87,12 @@ class Ui_SongUsageDetailDialog(object):
QtCore.QMetaObject.connectSlotsByName(SongUsageDetailDialog) QtCore.QMetaObject.connectSlotsByName(SongUsageDetailDialog)
def retranslateUi(self, SongUsageDetailDialog): def retranslateUi(self, SongUsageDetailDialog):
SongUsageDetailDialog.setWindowTitle(translate('AuditDetailDialog', 'Song Usage Extraction')) SongUsageDetailDialog.setWindowTitle(
self.DateRangeGroupBox.setTitle(translate('AuditDetailDialog', 'Select Date Range')) translate(u'SongsPlugin.AuditDetailDialog',
self.ToLabel.setText(translate('AuditDetailDialog', 'to')) u'Song Usage Extraction'))
self.FileGroupBox.setTitle(translate('AuditDetailDialog', 'Report Location')) self.DateRangeGroupBox.setTitle(
translate(u'SongsPlugin.AuditDetailDialog', u'Select Date Range'))
self.ToLabel.setText(
translate(u'SongsPlugin.AuditDetailDialog', u'to'))
self.FileGroupBox.setTitle(
translate(u'SongsPlugin.AuditDetailDialog', u'Report Location'))

View File

@ -61,7 +61,8 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
def defineOutputLocation(self): def defineOutputLocation(self):
path = QtGui.QFileDialog.getExistingDirectory(self, path = QtGui.QFileDialog.getExistingDirectory(self,
translate('SongUsageDetailForm','Output File Location'), translate(u'SongsPlugin.SongUsageDetailForm',
u'Output File Location'),
SettingsManager.get_last_dir(self.parent.settingsSection, 1)) SettingsManager.get_last_dir(self.parent.settingsSection, 1))
path = unicode(path) path = unicode(path)
if path != u'': if path != u'':

View File

@ -156,7 +156,8 @@ class SongUsagePlugin(Plugin):
self.SongUsagedetailform.exec_() self.SongUsagedetailform.exec_()
def about(self): def about(self):
about_text = translate('SongUsagePlugin','<b>SongUsage Plugin</b><br>This plugin ' about_text = translate(u'SongsPlugin.SongUsagePlugin',
'records the use of songs and when they have been used during ' u'<b>SongUsage Plugin</b><br>This plugin '
'a live service') u'records the use of songs and when they have been used during '
u'a live service')
return about_text return about_text