From c237db80f23dafc119949172c721797e25d3aa79 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 3 Dec 2011 14:03:15 +0530 Subject: [PATCH] Only allow searching via non accented author names if the user interface language in calibre is set to English. See #899227 for discussion. --- src/calibre/library/caches.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index 15d9123b81..03f3590252 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -15,7 +15,8 @@ from calibre.utils.config import tweaks, prefs from calibre.utils.date import parse_date, now, UNDEFINED_DATE, clean_date_for_sort from calibre.utils.search_query_parser import SearchQueryParser from calibre.utils.pyparsing import ParseException -from calibre.utils.localization import canonicalize_lang, lang_map, get_udc +from calibre.utils.localization import (canonicalize_lang, lang_map, get_udc, + get_lang) from calibre.ebooks.metadata import title_sort, author_to_author_sort from calibre.ebooks.metadata.opf2 import metadata_to_opf from calibre import prints @@ -215,6 +216,10 @@ class ResultCache(SearchQueryParser): # {{{ ''' def __init__(self, FIELD_MAP, field_metadata, db_prefs=None): self.FIELD_MAP = FIELD_MAP + l = get_lang() + asciize_author_names = l and l.lower() in ('en', 'eng') + if not asciize_author_names: + self.ascii_name = lambda x: False self.db_prefs = db_prefs self.composites = {} self.udc = get_udc()