mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 10:32:21 +02:00
minor fixes in utils/fetch_languages.py
This commit is contained in:
parent
af35eee10b
commit
4a1ff56389
5 changed files with 36 additions and 32 deletions
File diff suppressed because one or more lines are too long
|
@ -131,7 +131,8 @@ def _fetch_supported_languages(resp):
|
|||
name = td[2].xpath('./a')[0].text
|
||||
english_name = td[1].xpath('./a')[0].text
|
||||
articles = int(td[4].xpath('./a/b')[0].text.replace(',', ''))
|
||||
if articles >= 10000:
|
||||
# exclude languages with too few articles
|
||||
if articles >= 100000:
|
||||
supported_languages[code] = {"name": name, "english_name": english_name, "articles": articles}
|
||||
|
||||
return supported_languages
|
||||
|
|
|
@ -124,8 +124,8 @@ language_codes = (
|
|||
(u"war", u"Winaray", u"", u"Waray-Waray"),
|
||||
(u"xh", u"Xhosa", u"", u"Xhosa"),
|
||||
(u"zh", u"中文", u"", u"Chinese"),
|
||||
(u"zh-CN", u"中文", u"中国", u""),
|
||||
(u"zh-CN", u"中文", u"中国", u"Chinese"),
|
||||
(u"zh-HK", u"中文", u"香港", u"Chinese"),
|
||||
(u"zh-TW", u"中文", u"台湾", u""),
|
||||
(u"zh-TW", u"中文", u"台湾", u"Chinese"),
|
||||
(u"zu", u"Isi-Zulu", u"", u"Zulu")
|
||||
)
|
||||
|
|
|
@ -172,7 +172,7 @@
|
|||
</td>
|
||||
<th>{{ search_engine.name }}</th>
|
||||
<td>{{ shortcuts[search_engine.name] }}</td>
|
||||
<td><input type="checkbox" {{ "checked" if current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages else ""}} readonly="readonly" disabled="disabled"></td>
|
||||
<td><input type="checkbox" {{ "checked" if current_language == 'all' and current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages else ""}} readonly="readonly" disabled="disabled"></td>
|
||||
<td><input type="checkbox" {{ "checked" if search_engine.safesearch==True else ""}} readonly="readonly" disabled="disabled"></td>
|
||||
<td><input type="checkbox" {{ "checked" if search_engine.time_range_support==True else ""}} readonly="readonly" disabled="disabled"></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>
|
||||
|
@ -181,7 +181,7 @@
|
|||
<td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</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>
|
||||
<td><input type="checkbox" {{ "checked" if search_engine.safesearch==True else ""}} readonly="readonly" disabled="disabled"></td>
|
||||
<td><input type="checkbox" {{ "checked" if current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages else ""}} readonly="readonly" disabled="disabled"></td>
|
||||
<td><input type="checkbox" {{ "checked" if current_language == 'all' and current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages else ""}} readonly="readonly" disabled="disabled"></td>
|
||||
<td>{{ shortcuts[search_engine.name] }}</td>
|
||||
<th>{{ search_engine.name }}</th>
|
||||
<td class="onoff-checkbox">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue