mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-30 22:33:15 +02:00
Fallback to non-localized version if present instead of considering it a match
This commit is contained in:
parent
0bb47ed9fe
commit
ffa42fe809
1 changed files with 4 additions and 2 deletions
|
|
@ -176,12 +176,14 @@ def localize_string(data):
|
|||
|
||||
def key_matches(key):
|
||||
if key is None:
|
||||
return True
|
||||
return False
|
||||
base = re.split(r'[_.@]', key)[0]
|
||||
return canonicalize_lang(base) == lang
|
||||
|
||||
matches = tuple(filter(key_matches, data))
|
||||
return data[matches[0]] if matches else ''
|
||||
if matches:
|
||||
return data[matches[0]]
|
||||
return data.get(None) or ''
|
||||
|
||||
|
||||
def process_desktop_file(data):
|
||||
|
|
|
|||
Loading…
Reference in a new issue