Changed “langs” function so that, if “api/v1/instance” returned a language different from the default en, it assumes it is right, because it has been explicitly set, and avoid doing autodection of languages based on last toots

This commit is contained in:
pezcurrel 2022-11-23 20:35:53 +01:00
parent 56c1e85893
commit 9b87447da0

View file

@ -586,6 +586,9 @@ function langs($instid, $uri, $auto) {
global $info, $instrow, $link, $opts;
$retlangs=array();
$languages=array();
// even if $auto is true, set it to false (don't do autodection of languages based on last toots) if api/v1/instance returned a language different from the default "en": assume instead it is right, because it has been explicitly set
if (isset($info['languages'][0]) && $info['languages'][0]!='en')
$auto=false;
if ($auto) {
$languages = get_instance_langs($uri);
} elseif (akeavinn('languages',$info)) {