]> git.mxchange.org Git - friendica.git/commitdiff
Configuration for the number of languages
authorMichael <heluecht@pirati.ca>
Sun, 5 Nov 2023 20:18:01 +0000 (20:18 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 5 Nov 2023 20:18:01 +0000 (20:18 +0000)
src/Protocol/Relay.php
static/defaults.config.php

index a88c470e0588aeefccafe290800340f63d7fce6b..e7ecea43f857d64573958ae2d415559ba501b39a 100644 (file)
@@ -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;
                        }
index 56f1d20f8b8db88dd778a2f5a5de050507f9a111..dbc11235f2b949b6172952c570bd334e8af26823 100644 (file)
@@ -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',