make the language setting a bit more robust
This commit is contained in:
+3
-1
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user