mirror of https://gitlab.com/openlp/openlp.git
Merge branch 'fix-missing-translations' into 'master'
Fix missing translations See merge request openlp/openlp!729
This commit is contained in:
commit
cb1db9f432
|
@ -309,15 +309,15 @@ class Ui_EditSongDialog(object):
|
||||||
self.verse_delete_button.setText(UiStrings().Delete)
|
self.verse_delete_button.setText(UiStrings().Delete)
|
||||||
self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.lyrics_tab),
|
self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.lyrics_tab),
|
||||||
translate('SongsPlugin.EditSongForm', 'Title && Lyrics'))
|
translate('SongsPlugin.EditSongForm', 'Title && Lyrics'))
|
||||||
self.authors_group_box.setTitle(SongStrings.Authors)
|
self.authors_group_box.setTitle(SongStrings().Authors)
|
||||||
self.author_add_button.setText(translate('SongsPlugin.EditSongForm', '&Add to Song'))
|
self.author_add_button.setText(translate('SongsPlugin.EditSongForm', '&Add to Song'))
|
||||||
self.author_edit_button.setText(translate('SongsPlugin.EditSongForm', '&Edit Author Type'))
|
self.author_edit_button.setText(translate('SongsPlugin.EditSongForm', '&Edit Author Type'))
|
||||||
self.author_remove_button.setText(translate('SongsPlugin.EditSongForm', '&Remove'))
|
self.author_remove_button.setText(translate('SongsPlugin.EditSongForm', '&Remove'))
|
||||||
self.maintenance_button.setText(translate('SongsPlugin.EditSongForm', '&Manage Authors, Topics, Songbooks'))
|
self.maintenance_button.setText(translate('SongsPlugin.EditSongForm', '&Manage Authors, Topics, Songbooks'))
|
||||||
self.topics_group_box.setTitle(SongStrings.Topics)
|
self.topics_group_box.setTitle(SongStrings().Topics)
|
||||||
self.topic_add_button.setText(translate('SongsPlugin.EditSongForm', 'A&dd to Song'))
|
self.topic_add_button.setText(translate('SongsPlugin.EditSongForm', 'A&dd to Song'))
|
||||||
self.topic_remove_button.setText(translate('SongsPlugin.EditSongForm', 'R&emove'))
|
self.topic_remove_button.setText(translate('SongsPlugin.EditSongForm', 'R&emove'))
|
||||||
self.songbook_group_box.setTitle(SongStrings.SongBooks)
|
self.songbook_group_box.setTitle(SongStrings().SongBooks)
|
||||||
self.songbook_add_button.setText(translate('SongsPlugin.EditSongForm', 'Add &to Song'))
|
self.songbook_add_button.setText(translate('SongsPlugin.EditSongForm', 'Add &to Song'))
|
||||||
self.songbook_remove_button.setText(translate('SongsPlugin.EditSongForm', 'Re&move'))
|
self.songbook_remove_button.setText(translate('SongsPlugin.EditSongForm', 'Re&move'))
|
||||||
self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.authors_tab),
|
self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.authors_tab),
|
||||||
|
@ -325,7 +325,7 @@ class Ui_EditSongDialog(object):
|
||||||
self.theme_group_box.setTitle(UiStrings().Theme)
|
self.theme_group_box.setTitle(UiStrings().Theme)
|
||||||
self.theme_add_button.setText(translate('SongsPlugin.EditSongForm', 'New &Theme'))
|
self.theme_add_button.setText(translate('SongsPlugin.EditSongForm', 'New &Theme'))
|
||||||
self.rights_group_box.setTitle(translate('SongsPlugin.EditSongForm', 'Copyright Information'))
|
self.rights_group_box.setTitle(translate('SongsPlugin.EditSongForm', 'Copyright Information'))
|
||||||
self.copyright_insert_button.setText(SongStrings.CopyrightSymbol)
|
self.copyright_insert_button.setText(SongStrings().CopyrightSymbol)
|
||||||
self.ccli_label.setText(UiStrings().CCLISongNumberLabel)
|
self.ccli_label.setText(UiStrings().CCLISongNumberLabel)
|
||||||
self.comments_group_box.setTitle(translate('SongsPlugin.EditSongForm', 'Comments'))
|
self.comments_group_box.setTitle(translate('SongsPlugin.EditSongForm', 'Comments'))
|
||||||
self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.theme_tab),
|
self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.theme_tab),
|
||||||
|
|
|
@ -911,7 +911,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties):
|
||||||
"""
|
"""
|
||||||
text = self.copyright_edit.text()
|
text = self.copyright_edit.text()
|
||||||
pos = self.copyright_edit.cursorPosition()
|
pos = self.copyright_edit.cursorPosition()
|
||||||
sign = SongStrings.CopyrightSymbol
|
sign = SongStrings().CopyrightSymbol
|
||||||
text = text[:pos] + sign + text[pos:]
|
text = text[:pos] + sign + text[pos:]
|
||||||
self.copyright_edit.setText(text)
|
self.copyright_edit.setText(text)
|
||||||
self.copyright_edit.setFocus()
|
self.copyright_edit.setFocus()
|
||||||
|
|
|
@ -141,10 +141,10 @@ class Ui_SongMaintenanceDialog(object):
|
||||||
"""
|
"""
|
||||||
Translate the UI on the fly.
|
Translate the UI on the fly.
|
||||||
"""
|
"""
|
||||||
song_maintenance_dialog.setWindowTitle(SongStrings.SongMaintenance)
|
song_maintenance_dialog.setWindowTitle(SongStrings().SongMaintenance)
|
||||||
self.authors_list_item.setText(SongStrings.Authors)
|
self.authors_list_item.setText(SongStrings().Authors)
|
||||||
self.topics_list_item.setText(SongStrings.Topics)
|
self.topics_list_item.setText(SongStrings().Topics)
|
||||||
self.books_list_item.setText(SongStrings.SongBooks)
|
self.books_list_item.setText(SongStrings().SongBooks)
|
||||||
self.add_author_button.setText(UiStrings().Add)
|
self.add_author_button.setText(UiStrings().Add)
|
||||||
self.edit_author_button.setText(UiStrings().Edit)
|
self.edit_author_button.setText(UiStrings().Edit)
|
||||||
self.delete_author_button.setText(UiStrings().Delete)
|
self.delete_author_button.setText(UiStrings().Delete)
|
||||||
|
@ -154,7 +154,7 @@ class Ui_SongMaintenanceDialog(object):
|
||||||
self.add_book_button.setText(UiStrings().Add)
|
self.add_book_button.setText(UiStrings().Add)
|
||||||
self.edit_book_button.setText(UiStrings().Edit)
|
self.edit_book_button.setText(UiStrings().Edit)
|
||||||
self.delete_book_button.setText(UiStrings().Delete)
|
self.delete_book_button.setText(UiStrings().Delete)
|
||||||
type_list_width = max(self.fontMetrics().width(SongStrings.Authors),
|
type_list_width = max(self.fontMetrics().width(SongStrings().Authors),
|
||||||
self.fontMetrics().width(SongStrings.Topics),
|
self.fontMetrics().width(SongStrings().Topics),
|
||||||
self.fontMetrics().width(SongStrings.SongBooks))
|
self.fontMetrics().width(SongStrings().SongBooks))
|
||||||
self.type_list_widget.setFixedWidth(type_list_width + self.type_list_widget.iconSize().width() + 32)
|
self.type_list_widget.setFixedWidth(type_list_width + self.type_list_widget.iconSize().width() + 32)
|
||||||
|
|
|
@ -384,7 +384,7 @@ def clean_song(manager, song):
|
||||||
song.search_lyrics = ' '.join([clean_string(remove_tags(verse[1], True)) for verse in verses])
|
song.search_lyrics = ' '.join([clean_string(remove_tags(verse[1], True)) for verse in verses])
|
||||||
# The song does not have any author, add one.
|
# The song does not have any author, add one.
|
||||||
if not song.authors_songs:
|
if not song.authors_songs:
|
||||||
name = SongStrings.AuthorUnknown
|
name = SongStrings().AuthorUnknown
|
||||||
author = manager.get_object_filtered(Author, Author.display_name == name)
|
author = manager.get_object_filtered(Author, Author.display_name == name)
|
||||||
if author is None:
|
if author is None:
|
||||||
author = Author(display_name=name, last_name='', first_name='')
|
author = Author(display_name=name, last_name='', first_name='')
|
||||||
|
|
|
@ -56,7 +56,7 @@ class DatasoulImport(SongImport):
|
||||||
tree = objectify.parse(str(file_path), parser)
|
tree = objectify.parse(str(file_path), parser)
|
||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
log.exception('XML syntax error in file {name}'.format(name=file_path))
|
log.exception('XML syntax error in file {name}'.format(name=file_path))
|
||||||
self.log_error(file_path, SongStrings.XMLSyntaxError)
|
self.log_error(file_path, SongStrings().XMLSyntaxError)
|
||||||
continue
|
continue
|
||||||
song_xml = tree.getroot()
|
song_xml = tree.getroot()
|
||||||
if song_xml.tag != 'Song':
|
if song_xml.tag != 'Song':
|
||||||
|
|
|
@ -93,16 +93,16 @@ class DreamBeamImport(SongImport):
|
||||||
parsed_file = etree.parse(xml_file, parser)
|
parsed_file = etree.parse(xml_file, parser)
|
||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
log.exception('XML syntax error in file {name}'.format(name=file_path))
|
log.exception('XML syntax error in file {name}'.format(name=file_path))
|
||||||
self.log_error(file_path, SongStrings.XMLSyntaxError)
|
self.log_error(file_path, SongStrings().XMLSyntaxError)
|
||||||
continue
|
continue
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
log.exception('Unreadable characters in {name}'.format(name=file_path))
|
log.exception('Unreadable characters in {name}'.format(name=file_path))
|
||||||
self.log_error(file_path, SongStrings.XMLSyntaxError)
|
self.log_error(file_path, SongStrings().XMLSyntaxError)
|
||||||
continue
|
continue
|
||||||
file_str = etree.tostring(parsed_file)
|
file_str = etree.tostring(parsed_file)
|
||||||
if not file_str:
|
if not file_str:
|
||||||
log.exception('Could not find XML in file {name}'.format(name=file_path))
|
log.exception('Could not find XML in file {name}'.format(name=file_path))
|
||||||
self.log_error(file_path, SongStrings.XMLSyntaxError)
|
self.log_error(file_path, SongStrings().XMLSyntaxError)
|
||||||
continue
|
continue
|
||||||
xml = file_str.decode()
|
xml = file_str.decode()
|
||||||
song_xml = objectify.fromstring(xml)
|
song_xml = objectify.fromstring(xml)
|
||||||
|
@ -151,7 +151,7 @@ class DreamBeamImport(SongImport):
|
||||||
author_copyright = song_xml.Text2.Text.text
|
author_copyright = song_xml.Text2.Text.text
|
||||||
if author_copyright:
|
if author_copyright:
|
||||||
author_copyright = str(author_copyright)
|
author_copyright = str(author_copyright)
|
||||||
if author_copyright.find(SongStrings.CopyrightSymbol) >= 0:
|
if author_copyright.find(SongStrings().CopyrightSymbol) >= 0:
|
||||||
self.add_copyright(author_copyright)
|
self.add_copyright(author_copyright)
|
||||||
else:
|
else:
|
||||||
self.parse_author(author_copyright)
|
self.parse_author(author_copyright)
|
||||||
|
|
|
@ -54,16 +54,16 @@ class EasySlidesImport(SongImport):
|
||||||
parsed_file = etree.parse(xml_file, parser)
|
parsed_file = etree.parse(xml_file, parser)
|
||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
log.exception('XML syntax error in file {name}'.format(name=self.import_source))
|
log.exception('XML syntax error in file {name}'.format(name=self.import_source))
|
||||||
self.log_error(self.import_source, SongStrings.XMLSyntaxError)
|
self.log_error(self.import_source, SongStrings().XMLSyntaxError)
|
||||||
return
|
return
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
log.exception('Unreadable characters in {name}'.format(name=self.import_source))
|
log.exception('Unreadable characters in {name}'.format(name=self.import_source))
|
||||||
self.log_error(self.import_source, SongStrings.XMLSyntaxError)
|
self.log_error(self.import_source, SongStrings().XMLSyntaxError)
|
||||||
return
|
return
|
||||||
file_str = etree.tostring(parsed_file)
|
file_str = etree.tostring(parsed_file)
|
||||||
if not file_str:
|
if not file_str:
|
||||||
log.exception('Could not find XML in file {name}'.format(name=self.import_source))
|
log.exception('Could not find XML in file {name}'.format(name=self.import_source))
|
||||||
self.log_error(self.import_source, SongStrings.XMLSyntaxError)
|
self.log_error(self.import_source, SongStrings().XMLSyntaxError)
|
||||||
return
|
return
|
||||||
xml = file_str.decode()
|
xml = file_str.decode()
|
||||||
song_xml = objectify.fromstring(xml)
|
song_xml = objectify.fromstring(xml)
|
||||||
|
|
|
@ -125,7 +125,7 @@ class FoilPresenterImport(SongImport):
|
||||||
xml = etree.tostring(parsed_file).decode()
|
xml = etree.tostring(parsed_file).decode()
|
||||||
self.foil_presenter.xml_to_song(xml)
|
self.foil_presenter.xml_to_song(xml)
|
||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
self.log_error(file_path, SongStrings.XMLSyntaxError)
|
self.log_error(file_path, SongStrings().XMLSyntaxError)
|
||||||
log.exception('XML syntax error in file {path}'.format(path=file_path))
|
log.exception('XML syntax error in file {path}'.format(path=file_path))
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.log_error(file_path, translate('SongsPlugin.FoilPresenterSongImport',
|
self.log_error(file_path, translate('SongsPlugin.FoilPresenterSongImport',
|
||||||
|
|
|
@ -72,7 +72,7 @@ class LiveWorshipImport(SongImport):
|
||||||
try:
|
try:
|
||||||
self.root = etree.fromstring(xml_content, parser)
|
self.root = etree.fromstring(xml_content, parser)
|
||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
self.log_error(self.dump_file, SongStrings.XMLSyntaxError)
|
self.log_error(self.dump_file, SongStrings().XMLSyntaxError)
|
||||||
log.exception('XML syntax error in file {path}'.format(path=str(self.dump_file)))
|
log.exception('XML syntax error in file {path}'.format(path=str(self.dump_file)))
|
||||||
|
|
||||||
def extract_songs(self):
|
def extract_songs(self):
|
||||||
|
|
|
@ -73,7 +73,7 @@ class OpenLyricsImport(SongImport):
|
||||||
self.open_lyrics.xml_to_song(xml)
|
self.open_lyrics.xml_to_song(xml)
|
||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
log.exception('XML syntax error in file {path}'.format(path=file_path))
|
log.exception('XML syntax error in file {path}'.format(path=file_path))
|
||||||
self.log_error(file_path, SongStrings.XMLSyntaxError)
|
self.log_error(file_path, SongStrings().XMLSyntaxError)
|
||||||
except OpenLyricsError as exception:
|
except OpenLyricsError as exception:
|
||||||
log.exception('OpenLyricsException {error:d} in file {name}: {text}'.format(error=exception.type,
|
log.exception('OpenLyricsException {error:d} in file {name}: {text}'.format(error=exception.type,
|
||||||
name=file_path,
|
name=file_path,
|
||||||
|
|
|
@ -129,7 +129,7 @@ class OpenSongImport(SongImport):
|
||||||
try:
|
try:
|
||||||
tree = objectify.parse(file)
|
tree = objectify.parse(file)
|
||||||
except (etree.Error, etree.LxmlError):
|
except (etree.Error, etree.LxmlError):
|
||||||
self.log_error(file.name, SongStrings.XMLSyntaxError)
|
self.log_error(file.name, SongStrings().XMLSyntaxError)
|
||||||
log.exception('Error parsing XML')
|
log.exception('Error parsing XML')
|
||||||
return
|
return
|
||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
|
|
|
@ -50,11 +50,11 @@ class PowerPraiseImport(SongImport):
|
||||||
root = objectify.parse(xml_file).getroot()
|
root = objectify.parse(xml_file).getroot()
|
||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
log.exception('XML syntax error in file {name}'.format(name=file_path))
|
log.exception('XML syntax error in file {name}'.format(name=file_path))
|
||||||
self.log_error(file_path, SongStrings.XMLSyntaxError)
|
self.log_error(file_path, SongStrings().XMLSyntaxError)
|
||||||
continue
|
continue
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
log.exception('Unreadable characters in {name}'.format(name=file_path))
|
log.exception('Unreadable characters in {name}'.format(name=file_path))
|
||||||
self.log_error(file_path, SongStrings.XMLSyntaxError)
|
self.log_error(file_path, SongStrings().XMLSyntaxError)
|
||||||
continue
|
continue
|
||||||
self.process_song(root, file_path)
|
self.process_song(root, file_path)
|
||||||
|
|
||||||
|
|
|
@ -54,11 +54,11 @@ class ProPresenterImport(SongImport):
|
||||||
root = objectify.parse(xml_file).getroot()
|
root = objectify.parse(xml_file).getroot()
|
||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
log.exception('XML syntax error in file {name}'.format(name=file_path))
|
log.exception('XML syntax error in file {name}'.format(name=file_path))
|
||||||
self.log_error(file_path, SongStrings.XMLSyntaxError)
|
self.log_error(file_path, SongStrings().XMLSyntaxError)
|
||||||
continue
|
continue
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
log.exception('Unreadable characters in {name}'.format(name=file_path))
|
log.exception('Unreadable characters in {name}'.format(name=file_path))
|
||||||
self.log_error(file_path, SongStrings.XMLSyntaxError)
|
self.log_error(file_path, SongStrings().XMLSyntaxError)
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
self.process_song(root, file_path)
|
self.process_song(root, file_path)
|
||||||
|
|
|
@ -104,7 +104,7 @@ class SongImport(QtCore.QObject):
|
||||||
self.verse_counts = {}
|
self.verse_counts = {}
|
||||||
self.copyright_string = translate('SongsPlugin.SongImport', 'copyright')
|
self.copyright_string = translate('SongsPlugin.SongImport', 'copyright')
|
||||||
|
|
||||||
def log_error(self, file_path, reason=SongStrings.SongIncomplete):
|
def log_error(self, file_path, reason=SongStrings().SongIncomplete):
|
||||||
"""
|
"""
|
||||||
This should be called, when a song could not be imported.
|
This should be called, when a song could not be imported.
|
||||||
|
|
||||||
|
@ -151,11 +151,11 @@ class SongImport(QtCore.QObject):
|
||||||
:param text: Some text
|
:param text: Some text
|
||||||
"""
|
"""
|
||||||
lines = text.split('\n')
|
lines = text.split('\n')
|
||||||
if text.lower().find(self.copyright_string) >= 0 or text.find(str(SongStrings.CopyrightSymbol)) >= 0:
|
if text.lower().find(self.copyright_string) >= 0 or text.find(str(SongStrings().CopyrightSymbol)) >= 0:
|
||||||
copyright_found = False
|
copyright_found = False
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if (copyright_found or line.lower().find(self.copyright_string) >= 0 or
|
if (copyright_found or line.lower().find(self.copyright_string) >= 0 or
|
||||||
line.find(str(SongStrings.CopyrightSymbol)) >= 0):
|
line.find(str(SongStrings().CopyrightSymbol)) >= 0):
|
||||||
copyright_found = True
|
copyright_found = True
|
||||||
self.add_copyright(line)
|
self.add_copyright(line)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -124,7 +124,7 @@ class SongMediaItem(MediaManagerItem):
|
||||||
def retranslate_ui(self):
|
def retranslate_ui(self):
|
||||||
self.search_text_label.setText('{text}:'.format(text=UiStrings().Search))
|
self.search_text_label.setText('{text}:'.format(text=UiStrings().Search))
|
||||||
self.search_text_button.setText(UiStrings().Search)
|
self.search_text_button.setText(UiStrings().Search)
|
||||||
self.maintenance_action.setText(SongStrings.SongMaintenance)
|
self.maintenance_action.setText(SongStrings().SongMaintenance)
|
||||||
self.maintenance_action.setToolTip(translate('SongsPlugin.MediaItem',
|
self.maintenance_action.setToolTip(translate('SongsPlugin.MediaItem',
|
||||||
'Maintain the lists of authors, topics and books.'))
|
'Maintain the lists of authors, topics and books.'))
|
||||||
|
|
||||||
|
@ -145,11 +145,11 @@ class SongMediaItem(MediaManagerItem):
|
||||||
(SongSearch.Lyrics, UiIcons().search_lyrics,
|
(SongSearch.Lyrics, UiIcons().search_lyrics,
|
||||||
translate('SongsPlugin.MediaItem', 'Lyrics'),
|
translate('SongsPlugin.MediaItem', 'Lyrics'),
|
||||||
translate('SongsPlugin.MediaItem', 'Search Lyrics...')),
|
translate('SongsPlugin.MediaItem', 'Search Lyrics...')),
|
||||||
(SongSearch.Authors, UiIcons().user, SongStrings.Authors,
|
(SongSearch.Authors, UiIcons().user, SongStrings().Authors,
|
||||||
translate('SongsPlugin.MediaItem', 'Search Authors...')),
|
translate('SongsPlugin.MediaItem', 'Search Authors...')),
|
||||||
(SongSearch.Topics, UiIcons().light_bulb, SongStrings.Topics,
|
(SongSearch.Topics, UiIcons().light_bulb, SongStrings().Topics,
|
||||||
translate('SongsPlugin.MediaItem', 'Search Topics...')),
|
translate('SongsPlugin.MediaItem', 'Search Topics...')),
|
||||||
(SongSearch.Books, UiIcons().address, SongStrings.SongBooks,
|
(SongSearch.Books, UiIcons().address, SongStrings().SongBooks,
|
||||||
translate('SongsPlugin.MediaItem', 'Search Songbooks...')),
|
translate('SongsPlugin.MediaItem', 'Search Songbooks...')),
|
||||||
(SongSearch.Themes, UiIcons().theme, UiStrings().Themes, UiStrings().SearchThemes),
|
(SongSearch.Themes, UiIcons().theme, UiStrings().Themes, UiStrings().SearchThemes),
|
||||||
(SongSearch.Copyright, UiIcons().copyright,
|
(SongSearch.Copyright, UiIcons().copyright,
|
||||||
|
@ -673,7 +673,7 @@ class SongMediaItem(MediaManagerItem):
|
||||||
authors=create_separated_list(authors.translation))
|
authors=create_separated_list(authors.translation))
|
||||||
)
|
)
|
||||||
if song.copyright:
|
if song.copyright:
|
||||||
item.raw_footer.append("{symbol} {song}".format(symbol=SongStrings.CopyrightSymbol,
|
item.raw_footer.append("{symbol} {song}".format(symbol=SongStrings().CopyrightSymbol,
|
||||||
song=song.copyright))
|
song=song.copyright))
|
||||||
if song.songbook_entries:
|
if song.songbook_entries:
|
||||||
item.raw_footer.append(", ".join(songbooks))
|
item.raw_footer.append(", ".join(songbooks))
|
||||||
|
|
|
@ -32,18 +32,19 @@ class SongStrings(object):
|
||||||
"""
|
"""
|
||||||
Provide standard strings for use throughout the songs plugin.
|
Provide standard strings for use throughout the songs plugin.
|
||||||
"""
|
"""
|
||||||
# These strings should need a good reason to be retranslated elsewhere.
|
def __init__(self):
|
||||||
Author = translate('OpenLP.Ui', 'Author', 'Singular')
|
# These strings should need a good reason to be retranslated elsewhere.
|
||||||
Authors = translate('OpenLP.Ui', 'Authors', 'Plural')
|
self.Author = translate('OpenLP.Ui', 'Author', 'Singular')
|
||||||
AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used to populate the database.
|
self.Authors = translate('OpenLP.Ui', 'Authors', 'Plural')
|
||||||
CopyrightSymbol = '\xa9'
|
self.AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used to populate the database.
|
||||||
SongBook = translate('OpenLP.Ui', 'Songbook', 'Singular')
|
self.CopyrightSymbol = '\xa9'
|
||||||
SongBooks = translate('OpenLP.Ui', 'Songbooks', 'Plural')
|
self.SongBook = translate('OpenLP.Ui', 'Songbook', 'Singular')
|
||||||
SongIncomplete = translate('OpenLP.Ui', 'Title and/or verses not found')
|
self.SongBooks = translate('OpenLP.Ui', 'Songbooks', 'Plural')
|
||||||
SongMaintenance = translate('OpenLP.Ui', 'Song Maintenance')
|
self.SongIncomplete = translate('OpenLP.Ui', 'Title and/or verses not found')
|
||||||
Topic = translate('OpenLP.Ui', 'Topic', 'Singular')
|
self.SongMaintenance = translate('OpenLP.Ui', 'Song Maintenance')
|
||||||
Topics = translate('OpenLP.Ui', 'Topics', 'Plural')
|
self.Topic = translate('OpenLP.Ui', 'Topic', 'Singular')
|
||||||
XMLSyntaxError = translate('OpenLP.Ui', 'XML syntax error')
|
self.Topics = translate('OpenLP.Ui', 'Topics', 'Plural')
|
||||||
|
self.XMLSyntaxError = translate('OpenLP.Ui', 'XML syntax error')
|
||||||
|
|
||||||
|
|
||||||
def show_key_warning(parent):
|
def show_key_warning(parent):
|
||||||
|
|
|
@ -107,8 +107,7 @@
|
||||||
</column>
|
</column>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>
|
<string>Authors</string>
|
||||||
Authors</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="textAlignment">
|
<property name="textAlignment">
|
||||||
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
|
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
|
||||||
|
@ -120,8 +119,7 @@ Authors</string>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>
|
<string>Topics</string>
|
||||||
Topics</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="textAlignment">
|
<property name="textAlignment">
|
||||||
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
|
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
|
||||||
|
@ -133,8 +131,7 @@ Topics</string>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>
|
<string>Books/Hymnals</string>
|
||||||
Books/Hymnals</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="textAlignment">
|
<property name="textAlignment">
|
||||||
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
|
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
|
||||||
|
|
|
@ -111,14 +111,14 @@ def test_can_parse_file_having_a_processing_instruction(mocked_logger: MagicMock
|
||||||
# otherwise we don't care about it now (but should in other tests...)
|
# otherwise we don't care about it now (but should in other tests...)
|
||||||
assert ex is not etree.XMLSyntaxError
|
assert ex is not etree.XMLSyntaxError
|
||||||
|
|
||||||
# THEN: the importer's log_error method was never called with SongStrings.XMLSyntaxError as its second
|
# THEN: the importer's log_error method was never called with SongStrings().XMLSyntaxError as its second
|
||||||
# positional argument
|
# positional argument
|
||||||
if importer.log_error.called:
|
if importer.log_error.called:
|
||||||
for call_args in importer.log_error.call_args_list:
|
for call_args in importer.log_error.call_args_list:
|
||||||
args = call_args[0]
|
args = call_args[0]
|
||||||
# there are at least two positional arguments
|
# there are at least two positional arguments
|
||||||
if len(args) > 1:
|
if len(args) > 1:
|
||||||
assert args[1] is not SongStrings.XMLSyntaxError
|
assert args[1] is not SongStrings().XMLSyntaxError
|
||||||
|
|
||||||
# THEN: the logger's 'exception' method was never called with a first positional argument
|
# THEN: the logger's 'exception' method was never called with a first positional argument
|
||||||
# which is a string and starts with 'XML syntax error in file'
|
# which is a string and starts with 'XML syntax error in file'
|
||||||
|
|
Loading…
Reference in New Issue