diff --git a/searx/engines/google.py b/searx/engines/google.py index 048acd1b0455ebe3ffcc7b77df729f175bf872e2..bba2f2ede2f273f401da398a781da56fdb1d95e4 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -181,7 +181,12 @@ def get_lang_info(params, lang_list, custom_aliases, supported_any_language): # https://developers.google.com/custom-search/docs/xml_results#lrsp # Language Collection Values: # https://developers.google.com/custom-search/docs/xml_results_appendices#languageCollections - ret_val['params']['lr'] = "lang_" + lang_country if lang_country in lang_list else language + if lang_country in lang_list: + ret_val['params']['lr'] = "lang_" + lang_country + elif language in lang_country: + ret_val['params']['lr'] = "lang_" + language + else: + ret_val['params']['lr'] = language ret_val['params']['hl'] = lang_country if lang_country in lang_list else language