diff --git a/yomi_base/japanese/dictionary.py b/yomi_base/japanese/dictionary.py index 88930a6..1b9f232 100644 --- a/yomi_base/japanese/dictionary.py +++ b/yomi_base/japanese/dictionary.py @@ -56,7 +56,7 @@ class Dictionary: 'id': vocabId, 'expression': expression, 'reading': reading, - 'glossary': '; '.join(glossary), + 'glossary': glossary, 'tags': tags + addons, 'addons': addons }) @@ -86,7 +86,7 @@ class Dictionary: 'character': character, 'kunyomi': kunyomi, 'onyomi': onyomi, - 'glossary': '; '.join(glossary), + 'glossary': glossary } diff --git a/yomi_base/reader_util.py b/yomi_base/reader_util.py index 9674dd9..b49bfa0 100644 --- a/yomi_base/reader_util.py +++ b/yomi_base/reader_util.py @@ -151,11 +151,11 @@ def buildDefHeader(): toolTipBg = palette.color(QtGui.QPalette.Window).name() toolTipFg = palette.color(QtGui.QPalette.WindowText).name() - return u""" + return u'''
""".format(toolTipBg, toolTipFg) + '''.format(toolTipBg, toolTipFg) def buildDefFooter(): @@ -163,10 +163,10 @@ def buildDefFooter(): def buildEmpty(): - return u""" + return u'''No definitions to display.
Mouse over text with the middle mouse button or shift key pressed to search.
-You can also also input terms in the search box below.""" +
You can also also input terms in the search box below.'''
def buildVocabDef(definition, index, query):
@@ -186,13 +186,13 @@ def buildVocabDef(definition, index, query):
if query('vocab', markupVocabReading(definition)):
links += ''.format(index)
- html = u"""
+ html = u'''
{0}
{1}
{2}
{3}
{4}
-
""".format(links, definition['expression'], reading, definition['glossary'], rules)
+
'''.format(links, definition['expression'], reading, enumListItems(definition['glossary']), rules)
return html
@@ -214,16 +214,24 @@ def buildKanjiDef(definition, index, query):
links += ''.format(index)
readings = ', '.join([definition['kunyomi'], definition['onyomi']])
- html = u"""
+ html = u'''
{0}
{1}
[{2}]
{3}
-
""".format(links, definition['character'], readings, definition['glossary'])
+
'''.format(links, definition['character'], readings, enumListItems(definition['glossary']))
return html
+def enumListItems(items):
+ result = u'