mirror of
https://github.com/searxng/searxng.git
synced 2025-07-16 09:49:21 +02:00
[enh] add supported_languages on engines and auto-generate languages.py
This commit is contained in:
parent
e58949b76f
commit
149802c569
34 changed files with 666 additions and 128 deletions
|
@ -29,8 +29,8 @@ xpath_link = './/div[@class="mw-search-result-heading"]/a'
|
|||
|
||||
# cut 'en' from 'en_US', 'de' from 'de_CH', and so on
|
||||
def locale_to_lang_code(locale):
|
||||
if locale.find('_') >= 0:
|
||||
locale = locale.split('_')[0]
|
||||
if locale.find('-') >= 0:
|
||||
locale = locale.split('-')[0]
|
||||
return locale
|
||||
|
||||
|
||||
|
@ -95,6 +95,7 @@ main_langs = {
|
|||
'uk': 'Українська',
|
||||
'zh': '简体中文'
|
||||
}
|
||||
supported_languages = dict(lang_urls, **main_langs)
|
||||
|
||||
|
||||
# do search-request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue