Different solution to use Nextcloud languages #1293

This commit is contained in:
the-djmaze 2023-12-08 01:28:08 +01:00
parent 8984726fd7
commit e56415aa51
5 changed files with 25 additions and 20 deletions

View file

@ -23,7 +23,9 @@ trait Localization
$sLanguage = $this->ValidateLanguage($this->detectUserLanguage($bAdmin), $sLanguage, false);
}
}
return $this->ValidateLanguage($sLanguage, '', $bAdmin) ?: 'en';
$sHookLanguage = $sLanguage = $this->ValidateLanguage($sLanguage, '', $bAdmin) ?: 'en';
$this->Plugins()->RunHook('filter.language', array(&$sHookLanguage, $bAdmin));
return $this->ValidateLanguage($sHookLanguage, $sLanguage, $bAdmin);
}
public function ValidateLanguage(string $sLanguage, string $sDefault = '', bool $bAdmin = false, bool $bAllowEmptyResult = false): string