adding web GUI labels.txt language selection support

This commit is contained in:
mcguirepr89
2022-01-24 15:47:32 -05:00
parent 4795fda897
commit 7c5a80b1fe
2 changed files with 50 additions and 5 deletions
+13
View File
@@ -29,5 +29,18 @@ if(true){
$_SESSION['success'] = 1;
header("Location:config.php");
}
$language = $_POST["language"];
if ($language != "none"){
$command = "sudo -upi set -x; sudo -upi mv /home/pi/BirdNET-Pi/model/labels.txt /home/pi/BirdNET-Pi/model/labels.txt.old && sudo -upi unzip /home/pi/BirdNET-Pi/model/labels_l18n.zip $language -d /home/pi/BirdNET-Pi/model && sudo -upi mv /home/pi/BirdNET-Pi/model/$language /home/pi/BirdNET-Pi/model/labels.txt";
$command_output = `$command`;
echo $command_output;
@session_start();
if(true){
$_SESSION['success'] = 1;
header("Location:config.php");
}
}
?>