make the language setting a bit more robust

This commit is contained in:
frederik
2025-07-08 19:54:20 +02:00
parent 860fcd7be4
commit e5ed2ea42f
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -143,7 +143,9 @@ if(isset($_GET["latitude"])){
$contents = preg_replace("/APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=.*/", "APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=$apprise_notify_new_species_each_day", $contents);
$contents = preg_replace("/APPRISE_WEEKLY_REPORT=.*/", "APPRISE_WEEKLY_REPORT=$apprise_weekly_report", $contents);
$contents = preg_replace("/FLICKR_API_KEY=.*/", "FLICKR_API_KEY=$flickr_api_key", $contents);
$contents = preg_replace("/DATABASE_LANG=.*/", "DATABASE_LANG=$language", $contents);
if(strlen($language) == 2){
$contents = preg_replace("/DATABASE_LANG=.*/", "DATABASE_LANG=$language", $contents);
}
$contents = preg_replace("/INFO_SITE=.*/", "INFO_SITE=$info_site", $contents);
$contents = preg_replace("/COLOR_SCHEME=.*/", "COLOR_SCHEME=$color_scheme", $contents);
$contents = preg_replace("/FLICKR_FILTER_EMAIL=.*/", "FLICKR_FILTER_EMAIL=$flickr_filter_email", $contents);
+1 -1
View File
@@ -9,4 +9,4 @@ fi
label_file_name="labels_${DATABASE_LANG}.txt"
ln -sf ${BASEDIR}/${label_file_name} $HOME/BirdNET-Pi/model/labels.txt
[ -f "${label_file_name}" ] && ln -sf ${BASEDIR}/${label_file_name} $HOME/BirdNET-Pi/model/labels.txt