View Single Post
Old 05-02-2013, 11:05 AM   #269
mnjkl
Member
mnjkl has a spectacular aura aboutmnjkl has a spectacular aura aboutmnjkl has a spectacular aura aboutmnjkl has a spectacular aura aboutmnjkl has a spectacular aura aboutmnjkl has a spectacular aura aboutmnjkl has a spectacular aura aboutmnjkl has a spectacular aura aboutmnjkl has a spectacular aura aboutmnjkl has a spectacular aura aboutmnjkl has a spectacular aura about
 
Posts: 11
Karma: 4264
Join Date: Dec 2011
Device: kobo touch
The new line in the text is not translated, so I changed some code to penelope.py.
It has no problem on my dictionary (stardict formated). Will it cause problem on some dictionary?



if type(global_dictionary[k]) is tuple:
# single keyword
definition = global_dictionary[k][4].replace("\n","</p><p>")
f.write("<w><p><a name=\"%s\"/><div><b>%s</b><br/>%s</div></p></w>" % (word, word, definition))
else:
# multiple keyword
for sql_tuple in global_dictionary[k]:
definition = sql_tuple[4].replace("\n","</p><p>")
f.write("<w><p><a name=\"%s\"/><div><b>%s</b><br/>%s</div></p></w>" % (word, word, definition))
mnjkl is offline   Reply With Quote