From 8d1d2807688c07f34f77817ab75c1cf8297879e5 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:56:54 +0200 Subject: [PATCH] Update 99-run.sh --- birdnet-pi/rootfs/etc/cont-init.d/99-run.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh b/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh index 11e9afcbb..77657b40e 100755 --- a/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh +++ b/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh @@ -41,6 +41,9 @@ fi || (bashio::log.fatal "Error : $TIMEZONE not found. Here is a list of valid t # Correct language labels export "$(grep "^DATABASE_LANG" /config/birdnet.conf)" echo "... adapting labels according to birdnet.conf file to $DATABASE_LANG" + +DATABASE_LANG=fr + /."$HOME"/BirdNET-Pi/scripts/install_language_label_nm.sh -l "$DATABASE_LANG" # Saving default of en cp "$HOME"/BirdNET-Pi/model/labels.txt "$HOME"/BirdNET-Pi/model/labels.bak @@ -90,8 +93,8 @@ if [[ "$(bashio::config "BIRDS_ONLINE_INFO")" == *"ebird"* ]]; then sed -i '/$sciname =/a \\t$ebirdname = shell_exec("grep \\"$( echo \\"$sciname\\" | sed '\''s/_/ /g'\'')\\" /home/pi/BirdNET-Pi/model/ebird.txt | cut -d'\''_'\'' -f2 | sed '\''s/ /_/g'\''");' "$HOME"/BirdNET-Pi/scripts/todays_detections.php # shellcheck disable=SC2016 sed -i '/$sciname =/a \\t$ebirdname = shell_exec("grep \\"$( echo \\"$sciname\\" | sed '\''s/_/ /g'\'')\\" /home/pi/BirdNET-Pi/model/ebird.txt | cut -d'\''_'\'' -f2 | sed '\''s/ /_/g'\''");' "$HOME"/BirdNET-Pi/scripts/stats.php - sed -i "s|https://allaboutbirds.org/guide/|https://ebird.org/species/?siteLanguage=$DATABASE_LANG_$DATABASE_LANG|g" "$HOME"/BirdNET-Pi/scripts/todays_detections.php - sed -i "s|https://allaboutbirds.org/guide/\$comname|https://ebird.org/species/\$ebirdname?siteLanguage=$DATABASE_LANG_$DATABASE_LANG|g" "$HOME"/BirdNET-Pi/scripts/stats.php + sed -i "s|https://allaboutbirds.org/guide/|https://ebird.org/species/?siteLanguage=${DATABASE_LANG}_${DATABASE_LANG}|g" "$HOME"/BirdNET-Pi/scripts/todays_detections.php + sed -i "s|https://allaboutbirds.org/guide/\$comname|https://ebird.org/species/\$ebirdname?siteLanguage=${DATABASE_LANG}_${DATABASE_LANG}|g" "$HOME"/BirdNET-Pi/scripts/stats.php else # Correct allaboutbirds for non-english names echo "... using allaboutbirds, with correction for non-english names"