From: Michael Date: Sun, 5 Nov 2023 20:18:01 +0000 (+0000) Subject: Configuration for the number of languages X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ec16e7c0e6349d7080f634177ef943b446be3735;p=friendica.git Configuration for the number of languages --- diff --git a/src/Protocol/Relay.php b/src/Protocol/Relay.php index a88c470e05..e7ecea43f8 100644 --- a/src/Protocol/Relay.php +++ b/src/Protocol/Relay.php @@ -186,7 +186,7 @@ class Relay $detected = []; $quality = DI::config()->get('system', 'relay_language_quality'); - foreach (Item::getLanguageArray($body, 10, $uri_id, $author_id) as $language => $reliability) { + foreach (Item::getLanguageArray($body, DI::config()->get('system', 'relay_languages'), $uri_id, $author_id) as $language => $reliability) { if (($reliability >= $quality) && ($quality > 0)) { $detected[] = $language; } diff --git a/static/defaults.config.php b/static/defaults.config.php index 56f1d20f8b..dbc11235f2 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -566,6 +566,10 @@ return [ // Minimum value for the language detection quality for relay posts. The value must be betweeen 0 and 1. 'relay_language_quality' => 0, + // relay_languages (Integer) + // Number of languages that are used per post to check for acceptable posts. + 'relay_languages' => 10, + // session_handler (database|cache|native) // Whether to use Cache to store session data or to use PHP native session storage. 'session_handler' => 'database',