mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
fix alternative string-list representation in xcu
A alternative representation for string-list use <it> tag for each item of the list, for example: https://github.com/LibreOffice/dictionaries/tree/master/tr_TR
This commit is contained in:
parent
9551f021ec
commit
a43d86a0af
@ -45,6 +45,8 @@ def parse_xcu(raw, origin='%origin%'):
|
|||||||
paths = [c.text.replace('%origin%', origin) for v in value for c in v.iterchildren('*') if c.text]
|
paths = [c.text.replace('%origin%', origin) for v in value for c in v.iterchildren('*') if c.text]
|
||||||
aff, dic = paths if paths[0].endswith('.aff') else reversed(paths)
|
aff, dic = paths if paths[0].endswith('.aff') else reversed(paths)
|
||||||
locales = ''.join(XPath('descendant::prop[@oor:name="Locales"]/value/text()')(node)).split()
|
locales = ''.join(XPath('descendant::prop[@oor:name="Locales"]/value/text()')(node)).split()
|
||||||
|
if not locales:
|
||||||
|
locales = [str(item) for item in XPath('descendant::prop[@oor:name="Locales"]/value/it/text()')(node)]
|
||||||
ans[(dic, aff)] = locales
|
ans[(dic, aff)] = locales
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user