pub / serci

Search the web with !keywords
git clone https://src.jayvii.de/pub/serci.git
Home | Log | Files | Exports | Refs | README | RSS

commit af3957a4ff55717be3a5ae7a8e2c652ccb30110a
parent 3bcfb46af4de0fbced708188aa023a42cb4eb412
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Tue, 22 Apr 2025 18:33:05 +0200

feat: language detection for wikipedia, metager-maps and deepl

Diffstat:
Mconfig/config.php | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/config/config.php b/config/config.php @@ -58,7 +58,7 @@ $searches = array( "name" => "DeepL", "website" => "https://deepl.com", "query" => "https://www.deepl.com/translator#%opt/%s", - "default_opts" => "de/en", + "default_opts" => substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2) . "/en", "categories" => array("lang"), "keywords" => array("deepl"), "description" => "DeepL Translator is a neural machine translation service that is owned by Cologne-based DeepL SE and offers translations for over 33 languages. Translation languages can be choosen via !deepl:de/en" @@ -300,7 +300,7 @@ $searches = array( "name" => "MetaGer Maps", "website" => "https://metager.de/?fokus=maps", "query" => "https://maps.metager.de/%opt/%s/guess", - "default_opts" => "en", + "default_opts" => substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2), "categories" => array("map", "foss", "subscription"), "keywords" => array( "metagermap", "metagermaps", "mgmap", "metamap", "map", "maps" @@ -588,7 +588,7 @@ $searches = array( "name" => "Wikipedia", "website" => "https://wikipedia.org", "query" => "https://%opt.wikipedia.org/w/index.php?title=Special%3ASearch&search=%s", - "default_opts" => "en", + "default_opts" => substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2), "categories" => array("wiki", "foss", "edu", "community"), "keywords" => array("wikipedia", "wiki", "wp", "wk"), "description" => "A free content online encyclopedia written and maintained by a community of volunteers through open collaboration. It is the largest and most-read reference work in history, and is consistently ranked among the ten most visited websites world-wide. Language can be choosen via !wikipedia:en"