|
@@ -79,11 +79,20 @@ class Search(object):
|
79
|
79
|
modified = False
|
80
|
80
|
if query_parts[0].startswith(':'):
|
81
|
81
|
lang = query_parts[0][1:]
|
82
|
|
- if lang in (x[0] for x in language_codes):
|
83
|
|
- self.lang = lang
|
84
|
|
- modified = True
|
|
82
|
+
|
|
83
|
+ for lc in language_codes:
|
|
84
|
+ lang_id, lang_name, country = map(str.lower, lc)
|
|
85
|
+ if lang == lang_id\
|
|
86
|
+ or lang_id.startswith(lang)\
|
|
87
|
+ or lang == lang_name\
|
|
88
|
+ or lang == country:
|
|
89
|
+ self.lang = lang
|
|
90
|
+ modified = True
|
|
91
|
+ break
|
|
92
|
+
|
85
|
93
|
elif query_parts[0].startswith('!'):
|
86
|
94
|
prefix = query_parts[0][1:].replace('_', ' ')
|
|
95
|
+
|
87
|
96
|
if prefix in engine_shortcuts\
|
88
|
97
|
and not engine_shortcuts[prefix] in self.blocked_engines:
|
89
|
98
|
modified = True
|