Configuration for the number of languages

This commit is contained in:
Michael 2023-11-05 20:18:01 +00:00
parent 5ae0331993
commit ec16e7c0e6
2 changed files with 5 additions and 1 deletions

View 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;
}

View 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',