diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py
index fa1025fdd..e65271e03 100644
--- a/openlp/core/lib/__init__.py
+++ b/openlp/core/lib/__init__.py
@@ -84,6 +84,9 @@ base_html_expands.append({u'desc': u'Italics', u'start tag': u'{it}',
base_html_expands.append({u'desc': u'Underline', u'start tag': u'{u}',
u'start html': u'',
u'end tag': u'{/u}', u'end html': u'', u'protected': True})
+base_html_expands.append({u'desc': u'Break', u'start tag': u'{br}',
+ u'start html': u'
', u'end tag': u'', u'end html': u'',
+ u'protected': True})
def translate(context, text, comment=None,
encoding=QtCore.QCoreApplication.CodecForTr, n=-1,
@@ -245,6 +248,7 @@ def clean_tags(text):
Remove Tags from text for display
"""
text = text.replace(u'
', u'\n')
+ text = text.replace(u'{br}', u'\n')
text = text.replace(u' ', u' ')
for tag in DisplayTags.get_html_tags():
text = text.replace(tag[u'start tag'], u'')
diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py
index 030798c57..6e3d0aa97 100644
--- a/openlp/core/lib/serviceitem.py
+++ b/openlp/core/lib/serviceitem.py
@@ -29,6 +29,7 @@ The :mod:`serviceitem` provides the service item functionality including the
type and capability of an item.
"""
+import cgi
import datetime
import logging
import os
@@ -175,17 +176,18 @@ class ServiceItem(object):
formatted = self.renderer \
.format_slide(slide[u'raw_slide'], line_break, self)
for page in formatted:
+ page = page.replace(u'
', u'{br}')
self._display_frames.append({
u'title': clean_tags(page),
u'text': clean_tags(page.rstrip()),
- u'html': expand_tags(page.rstrip()),
+ u'html': expand_tags(cgi.escape(page.rstrip())),
u'verseTag': slide[u'verseTag']
})
elif self.service_item_type == ServiceItemType.Image or \
self.service_item_type == ServiceItemType.Command:
pass
else:
- log.error(u'Invalid value renderer :%s' % self.service_item_type)
+ log.error(u'Invalid value renderer: %s' % self.service_item_type)
self.title = clean_tags(self.title)
# The footer should never be None, but to be compatible with a few
# nightly builds between 1.9.4 and 1.9.5, we have to correct this to
diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py
index c98383c9e..38a00f1a1 100644
--- a/openlp/core/ui/thememanager.py
+++ b/openlp/core/ui/thememanager.py
@@ -29,6 +29,7 @@ import os
import zipfile
import shutil
import logging
+import locale
from xml.etree.ElementTree import ElementTree, XML
from PyQt4 import QtCore, QtGui
@@ -462,7 +463,10 @@ class ThemeManager(QtGui.QWidget):
QtCore.QVariant(theme.theme_name))
self.configUpdated()
files = SettingsManager.get_files(self.settingsSection, u'.png')
- files.sort()
+ # Sort the themes by its name considering language specific characters.
+ # lower() is needed for windows!
+ files.sort(key=lambda filename: unicode(filename).lower(),
+ cmp=locale.strcoll)
# now process the file list of png files
for name in files:
# check to see file is in theme root directory
diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py
index 28e4fee0d..e01d8afea 100644
--- a/openlp/plugins/bibles/forms/bibleimportform.py
+++ b/openlp/plugins/bibles/forms/bibleimportform.py
@@ -31,6 +31,7 @@ import csv
import logging
import os
import os.path
+import locale
from PyQt4 import QtCore, QtGui
@@ -532,7 +533,7 @@ class BibleImportForm(OpenLPWizard):
"""
self.webTranslationComboBox.clear()
bibles = self.web_bible_list[index].keys()
- bibles.sort()
+ bibles.sort(cmp=locale.strcoll)
self.webTranslationComboBox.addItems(bibles)
def onOsisBrowseButtonClicked(self):
@@ -767,4 +768,3 @@ class BibleImportForm(OpenLPWizard):
'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.'))
del self.manager.db_cache[importer.name]
delete_database(self.plugin.settingsSection, importer.file)
-
diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py
index 3d45a9c5f..e2aa86d8c 100644
--- a/openlp/plugins/bibles/lib/mediaitem.py
+++ b/openlp/plugins/bibles/lib/mediaitem.py
@@ -26,6 +26,7 @@
###############################################################################
import logging
+import locale
from PyQt4 import QtCore, QtGui
@@ -359,7 +360,7 @@ class BibleMediaItem(MediaManagerItem):
self.advancedSecondComboBox.addItem(u'')
# Get all bibles and sort the list.
bibles = self.parent.manager.get_bibles().keys()
- bibles.sort()
+ bibles.sort(cmp=locale.strcoll)
# Load the bibles into the combo boxes.
for bible in bibles:
if bible:
@@ -443,7 +444,7 @@ class BibleMediaItem(MediaManagerItem):
if bible:
book_data = bibles[bible].get_books()
books = [book.name + u' ' for book in book_data]
- books.sort()
+ books.sort(cmp=locale.strcoll)
add_widget_completer(books, self.quickSearchEdit)
def onImportClick(self):
diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py
index ef2558b8a..0603230ba 100644
--- a/openlp/plugins/songs/lib/songbeamerimport.py
+++ b/openlp/plugins/songs/lib/songbeamerimport.py
@@ -69,6 +69,30 @@ class SongBeamerImport(SongImport):
Song Beamer file format is text based
in the beginning are one or more control tags written
"""
+ HTML_TAG_PAIRS = [
+ (re.compile(u''), u'{st}'),
+ (re.compile(u''), u'{/st}'),
+ (re.compile(u''), u'{it}'),
+ (re.compile(u''), u'{/it}'),
+ (re.compile(u''), u'{u}'),
+ (re.compile(u''), u'{/u}'),
+ (re.compile(u'
'), u'{p}'), + (re.compile(u'
'), u'{/p}'), + (re.compile(u'', u'{p}'), - (u'
', u'{/p}'), - (u'