From a43d86a0afa5260958c7299c7456757fd33b8764 Mon Sep 17 00:00:00 2001 From: un-pogaz <46523284+un-pogaz@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:46:32 +0200 Subject: [PATCH] fix alternative string-list representation in xcu A alternative representation for string-list use tag for each item of the list, for example: https://github.com/LibreOffice/dictionaries/tree/master/tr_TR --- src/calibre/spell/import_from.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/spell/import_from.py b/src/calibre/spell/import_from.py index 58287e8f32..0d49687425 100644 --- a/src/calibre/spell/import_from.py +++ b/src/calibre/spell/import_from.py @@ -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] aff, dic = paths if paths[0].endswith('.aff') else reversed(paths) 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 return ans