Improve Author Unknown strings

This commit is contained in:
Jon Tibble 2011-02-13 15:17:42 +00:00
parent ffd4d41760
commit d129085d87
3 changed files with 6 additions and 3 deletions

View File

@ -31,6 +31,7 @@ from PyQt4 import QtCore
from openlp.core.lib import Receiver, translate
from openlp.plugins.songs.lib import VerseType
from openlp.plugins.songs.lib.db import Song, Author, Topic, Book, MediaFile
from openlp.plugins.songs.lib.ui import SongStrings
from openlp.plugins.songs.lib.xml import SongXML
log = logging.getLogger(__name__)
@ -260,7 +261,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(u'Author Unknown')
self.authors.append(SongStrings.AuthorUnknownUnT)
log.info(u'commiting song %s to database', self.title)
song = Song()
song.title = self.title

View File

@ -36,7 +36,8 @@ 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')
AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI.
AuthorUnknownUnT = u'Author Unknown' # Used to populate the database.
SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular')
SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural')
Topic = translate('OpenLP.Ui', 'Topic', 'Singular')

View File

@ -69,6 +69,7 @@ from lxml import etree, objectify
from openlp.core.lib import translate
from openlp.plugins.songs.lib import VerseType
from openlp.plugins.songs.lib.db import Author, Book, Song, Topic
from openlp.plugins.songs.lib.ui import SongStrings
log = logging.getLogger(__name__)
@ -377,7 +378,7 @@ class OpenLyrics(object):
except AttributeError:
pass
if not authors:
authors.append(u'Author Unknown')
authors.append(SongStrings.AuthorUnknownUnT)
for display_name in authors:
author = self.manager.get_object_filtered(Author,
Author.display_name == display_name)