update the 'scripture reference invalid' message

This commit is contained in:
M2j 2012-01-18 21:20:05 +01:00
parent 9ef317db2a
commit cac10059f3

View File

@ -33,7 +33,7 @@ from PyQt4 import QtCore
from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.lib import Receiver, SettingsManager, translate
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import critical_error_message_box
from openlp.core.utils import AppLocation, delete_file from openlp.core.utils import AppLocation, delete_file
from openlp.plugins.bibles.lib import parse_reference from openlp.plugins.bibles.lib import parse_reference, get_reference_separator
from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta
from csvbible import CSVBible from csvbible import CSVBible
from http import HTTPBible from http import HTTPBible
@ -309,19 +309,29 @@ class BibleManager(object):
return self.db_cache[bible].get_verses(reflist, show_error) return self.db_cache[bible].get_verses(reflist, show_error)
else: else:
if show_error: if show_error:
reference_seperators = {
u'verse': get_reference_separator(u'sep_v_display'),
u'range': get_reference_separator(u'sep_r_display'),
u'list': get_reference_separator(u'sep_l_display')}
Receiver.send_message(u'openlp_information_message', { Receiver.send_message(u'openlp_information_message', {
u'title': translate('BiblesPlugin.BibleManager', u'title': translate('BiblesPlugin.BibleManager',
'Scripture Reference Error'), 'Scripture Reference Error'),
u'message': translate('BiblesPlugin.BibleManager', u'message': unicode(translate('BiblesPlugin.BibleManager',
'Your scripture reference is either not supported by ' 'Your scripture reference is either not supported by '
'OpenLP or is invalid. Please make sure your reference ' 'OpenLP or is invalid. Please make sure your reference '
'conforms to one of the following patterns:\n\n' 'conforms to one of the following patterns or consult the '
'manual:\n\n'
'Book Chapter\n' 'Book Chapter\n'
'Book Chapter-Chapter\n' 'Book Chapter%(range)sChapter\n'
'Book Chapter:Verse-Verse\n' 'Book Chapter%(verse)sVerse%(range)sVerse\n'
'Book Chapter:Verse-Verse,Verse-Verse\n' 'Book Chapter%(verse)sVerse%(range)sVerse%(list)sVerse'
'Book Chapter:Verse-Verse,Chapter:Verse-Verse\n' '%(range)sVerse\n'
'Book Chapter:Verse-Chapter:Verse') 'Book Chapter%(verse)sVerse%(range)sVerse%(list)sChapter'
'%(verse)sVerse%(range)sVerse\n'
'Book Chapter%(verse)sVerse%(range)sChapter%(verse)sVerse',
'Please pay attention to the appended "s" of the wildcards '
'and refrain from translating the words inside the '
'names in the brackets.')) % reference_seperators
}) })
return None return None