diff options
author | Marc Abonce Seguin <marc-abonce@mailbox.org> | 2018-02-28 22:30:48 -0600 |
---|---|---|
committer | Marc Abonce Seguin <marc-abonce@mailbox.org> | 2018-03-27 00:08:03 -0600 |
commit | 772c048d01c7585fd60afca1ce30a1914e6e5b4a (patch) | |
tree | 96a5662897df2bcf0ab53456e0a67ace998f2169 /searx/templates/oscar/preferences.html | |
parent | d1eae9359f8c5920632a730744ea2208070f06da (diff) | |
download | searxng-772c048d01c7585fd60afca1ce30a1914e6e5b4a.tar.gz searxng-772c048d01c7585fd60afca1ce30a1914e6e5b4a.zip |
refactor engine's search language handling
Add match_language function in utils to match any user given
language code with a list of engine's supported languages.
Also add language_aliases dict on each engine to translate
standard language codes into the custom codes used by the engine.
Diffstat (limited to 'searx/templates/oscar/preferences.html')
-rw-r--r-- | searx/templates/oscar/preferences.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index f23cae3e5..b64d72ddf 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -187,7 +187,7 @@ </td> <th>{{ search_engine.name }}</th> <td class="name">{{ shortcuts[search_engine.name] }}</td> - <td>{{ support_toggle(current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages) }}</td> + <td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td> <td>{{ support_toggle(search_engine.safesearch==True) }}</td> <td>{{ support_toggle(search_engine.time_range_support==True) }}</td> <td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td> @@ -197,7 +197,7 @@ <td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td> <td>{{ support_toggle(search_engine.time_range_support==True) }}</td> <td>{{ support_toggle(search_engine.safesearch==True) }}</td> - <td>{{ support_toggle(current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages) }}</td> + <td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td> <td>{{ shortcuts[search_engine.name] }}</td> <th>{{ search_engine.name }}</th> <td class="onoff-checkbox"> |