mirror of
https://github.com/searxng/searxng.git
synced 2024-11-29 22:21:02 +00:00
Merge pull request #672 from searxng/update_data_update_languages.py
Update searx.data - update_languages.py
This commit is contained in:
commit
c2e4b95e8d
3 changed files with 331 additions and 867 deletions
File diff suppressed because it is too large
Load diff
|
@ -19,21 +19,14 @@ language_codes = (
|
|||
('en-CA', 'English', 'Canada', 'English'),
|
||||
('en-GB', 'English', 'United Kingdom', 'English'),
|
||||
('en-IE', 'English', 'Ireland', 'English'),
|
||||
('en-IN', 'English', 'India', 'English'),
|
||||
('en-MY', 'English', 'Malaysia', 'English'),
|
||||
('en-NZ', 'English', 'New Zealand', 'English'),
|
||||
('en-PH', 'English', 'Philippines', 'English'),
|
||||
('en-SG', 'English', 'Singapore', 'English'),
|
||||
('en-US', 'English', 'United States', 'English'),
|
||||
('en-ZA', 'English', 'South Africa', 'English'),
|
||||
('es', 'Español', '', 'Spanish'),
|
||||
('es-AR', 'Español', 'Argentina', 'Spanish'),
|
||||
('es-CL', 'Español', 'Chile', 'Spanish'),
|
||||
('es-CO', 'Español', 'Colombia', 'Spanish'),
|
||||
('es-ES', 'Español', 'España', 'Spanish'),
|
||||
('es-MX', 'Español', 'México', 'Spanish'),
|
||||
('es-PE', 'Español', 'Perú', 'Spanish'),
|
||||
('es-US', 'Español', 'Estados Unidos', 'Spanish'),
|
||||
('et-EE', 'Eesti', '', 'Estonian'),
|
||||
('fa-IR', 'فارسی', '', 'Persian'),
|
||||
('fi-FI', 'Suomi', '', 'Finnish'),
|
||||
|
@ -43,6 +36,7 @@ language_codes = (
|
|||
('fr-CH', 'Français', 'Suisse', 'French'),
|
||||
('fr-FR', 'Français', 'France', 'French'),
|
||||
('he-IL', 'עברית', '', 'Hebrew'),
|
||||
('hi-IN', 'हिन्दी', '', 'Hindi'),
|
||||
('hr-HR', 'Hrvatski', '', 'Croatian'),
|
||||
('hu-HU', 'Magyar', '', 'Hungarian'),
|
||||
('id-ID', 'Indonesia', '', 'Indonesian'),
|
||||
|
@ -52,7 +46,6 @@ language_codes = (
|
|||
('ko-KR', '한국어', '', 'Korean'),
|
||||
('lt-LT', 'Lietuvių', '', 'Lithuanian'),
|
||||
('lv-LV', 'Latviešu', '', 'Latvian'),
|
||||
('nb-NO', 'Norsk Bokmål', '', 'Norwegian Bokmål'),
|
||||
('nl', 'Nederlands', '', 'Dutch'),
|
||||
('nl-BE', 'Nederlands', 'België', 'Dutch'),
|
||||
('nl-NL', 'Nederlands', 'Nederland', 'Dutch'),
|
||||
|
|
|
@ -189,7 +189,7 @@ def write_languages_file(languages):
|
|||
"# -*- coding: utf-8 -*-",
|
||||
"# list of language codes",
|
||||
"# this file is generated automatically by utils/fetch_languages.py",
|
||||
"language_codes =",
|
||||
"language_codes = (\n",
|
||||
)
|
||||
|
||||
language_codes = []
|
||||
|
@ -212,8 +212,11 @@ def write_languages_file(languages):
|
|||
language_codes = tuple(language_codes)
|
||||
|
||||
with open(languages_file, 'w') as new_file:
|
||||
file_content = "{file_headers} \\\n{language_codes}".format(
|
||||
file_headers='\n'.join(file_headers), language_codes=pformat(language_codes, indent=4)
|
||||
file_content = "{file_headers} {language_codes},\n)\n".format(
|
||||
# fmt: off
|
||||
file_headers = '\n'.join(file_headers),
|
||||
language_codes = pformat(language_codes, indent=4)[1:-1]
|
||||
# fmt: on
|
||||
)
|
||||
new_file.write(file_content)
|
||||
new_file.close()
|
||||
|
|
Loading…
Reference in a new issue