summaryrefslogtreecommitdiff
path: root/searx/languages.py
AgeCommit message (Collapse)Author
2023-03-24[mod] replace searx.languages by searx.sxng_localesMarkus Heiser
With the language and region tags from the EngineTraitsMap the handling of SearXNG's tags of languages and regions has been normalized and is no longer a *mystery*. The "languages" became "locales" that are supported by babel and by this, the update_engine_traits.py can be simplified a lot. Other code places can be simplified as well, but these simplifications should (respectively can) only be done when none of the engines work with the deprecated EngineTraits.supported_languages interface anymore. This commit replaces searx.languages by searx.sxng_locales and fix the naming of some names from "language" to "locale" (e.g. language_codes --> sxng_locales). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-22[fix] add back missing languages & regions (followup of PR #1071)Markus Heiser
In PR #1071 the language catalog of dailymotion has been cleaned up, before there had been over 7000 "languages" in the catalog. As a side effect of this clean-up the language & region catalog in SearXNG has been reduced [1]. This patch reduce the ``min_engines_per_lang`` from 13 to 12 to get the missed languages back in language & region catalog of SearXNG. [1] https://github.com/searxng/searxng/pull/1071/commits/3bb62823ec3af0e67bd2d959bec20c4791ee3bac#diff-f3f00db0f87f95b882624a192e0aac21525638af0b18c9514e765fcf1991678d Requested-by: @tiekoetter in a Matrix chat Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-16[fix] dailymotion engine: filter by language & countryMarkus Heiser
- fix the issue of fetching more the 7000 *languages* - improve the request function and filter by language & country - implement time_range_support & safesearch - add more fields to the response from dailymotion (allow_embed, length) - better clean up of HTML tags in the 'content' field. This is more or less a complete rework based on the '/videos' API from [1]. This patch cleans up the language list in SearXNG that has been polluted by the ISO-639-3 2 and 3 letter codes from dailymotion languages which have never been used. [1] https://developers.dailymotion.com/tools/ Closes: https://github.com/searxng/searxng/issues/1065 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-05[fix] add missing territory (country) nameMarkus Heiser
Related-to: https://github.com/searxng/searxng/pull/1029#issuecomment-1086824911 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-31Update languagesAlexandre FLAMENT
2022-03-19[fix] languages: show country name even if there is only one countryMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-19[fix] don't show flags for languages without region identifierMarkus Heiser
SearXNG shows two different things: region: "de-CH" is the equivalent of "Schweiz (de)" in DDG. languages: "en" doesn't say anything about the location. It is up the engines to do their best to select English results without a region. Suggested-by: @dalf https://github.com/searxng/searxng/pull/967#issuecomment-1072979693 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-19[mod] add flags to the languages filterMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-01Update searx.data - update_languages.pyMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-27[format.python] initial formatting of the python codeMarkus Heiser
This patch was generated by black [1]:: make format.python [1] https://github.com/psf/black Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-10-26[mod] update_languages: min_engines_per_country=7Alexandre Flament
a (language,country) tuple is included if 7 engines have it, was 10 before. close #432
2021-10-01Update searx.data - update_languages.pydalf
2021-08-01[fix] get common used languages back (min_engines_per_lang = 13)Markus Heiser
In commit 4d3f2f48d common used languages has been droped. By reducing the number of `min_engines_per_lang` from 15 to 13 we get theses languages back. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-08-01Update searx.data - update_languages.pydalf
2021-03-05Update searx.data - update_languages.pydalf
2021-01-24[data] make engines.languagesMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-09-22fetch google's search langs rather than ui langsMarc Abonce Seguin
2020-09-22fix utils/fetch_languages to work with new languagesMarc Abonce Seguin
2020-09-10Drop Python 2 (1/n): remove unicode string and url_utilsDalf
2020-03-01update languages: engines_languages.json languages.pyMarkus Heiser
build by Makefile target: make project Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2018-03-20fix fetch_langauges to be more accurateMarc Abonce Seguin
Add languages supported by either all default general engines or 10 engines.
2017-10-10update engines_languages.json and languages.pymarc
Also, fix fetch_languages.py so it can run on python3.
2017-03-18make search language handling less strictmarc
languages.py can change, so users may query on a language that is not on the list anymore, even if it is still recognized by a few engines. also made no and nb the same because they seem to return the same, though most engines will only support one or the other.
2017-03-18add language support for qwantmarc
closes issue #863
2016-12-29change language list to only include languages with a minimum of enginesmarc
that support them. users can still query lesser supported through the :lang_code bang.
2016-12-16minor fixes in utils/fetch_languages.pymarc
2016-12-15tests for _fetch_supported_languages in enginesmarc
and refactor method to make it testable without making requests
2016-12-13[mod] fetch supported languages for several enginesmarc
utils/fetch_languages.py gets languages supported by each engine and generates engines_languages.json with each engine's supported language.
2016-12-13small fixesmarc
2016-12-13Add country names in language list.marc
2016-12-13Add language support for more engines.marc
2016-12-13filter langaugesmarc
2016-12-13[enh] add supported_languages on engines and auto-generate languages.pymarc
2016-04-09sort languages properlyNoemi Vanyi
2016-02-06[enh] add occitan search language - example query: ":oc !wp south" - closes #445Adam Tauber
2014-09-13add comments to languages.pyThomas Pointhuber
* add comments * add licence-header
2014-01-31[enh] search language support initasciimoo