mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Fix duplicate names in hyphenation dictionary chooser. Fixes #1615040 [Greek modern language listed twice](https://bugs.launchpad.net/calibre/+bug/1615040)
This commit is contained in:
parent
abe32ad8ca
commit
fefb3ee882
@ -140,7 +140,14 @@ class ConfigDialog(QDialog, Ui_Dialog):
|
|||||||
with zipfile.ZipFile(P('viewer/hyphenate/patterns.zip',
|
with zipfile.ZipFile(P('viewer/hyphenate/patterns.zip',
|
||||||
allow_user_override=False), 'r') as zf:
|
allow_user_override=False), 'r') as zf:
|
||||||
pats = [x.split('.')[0].replace('-', '_') for x in zf.namelist()]
|
pats = [x.split('.')[0].replace('-', '_') for x in zf.namelist()]
|
||||||
names = list(map(get_language, pats))
|
|
||||||
|
lang_pats = {
|
||||||
|
'el_monoton': get_language('el').partition(';')[0] + _(' monotone'), 'el_polyton':get_language('el').partition(';')[0] + _(' polytone'),
|
||||||
|
'sr_cyrl': get_language('sr') + _(' cyrillic'), 'sr_latn': get_language('sr') + _(' latin'),
|
||||||
|
}
|
||||||
|
def gl(pat):
|
||||||
|
return lang_pats.get(pat, get_language(pat))
|
||||||
|
names = list(map(gl, pats))
|
||||||
pmap = {}
|
pmap = {}
|
||||||
for i in range(len(pats)):
|
for i in range(len(pats)):
|
||||||
pmap[names[i]] = pats[i]
|
pmap[names[i]] = pats[i]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user