Update main_menu.sh

This commit is contained in:
MacRimi 2025-01-29 22:43:49 +01:00 committed by GitHub
parent 808afc93b1
commit c794d5d7fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,6 +34,13 @@ initialize_cache() {
fi fi
} }
Load language from JSON file
load_language() {
if [ -f "$CONFIG_FILE" ]; then
LANGUAGE=$(jq -r '.language' "$CONFIG_FILE")
fi
}
show_menu() { show_menu() {
while true; do while true; do
OPTION=$(whiptail --title "$(translate "Main Menu")" --menu "$(translate "Select an option:")" 15 60 5 \ OPTION=$(whiptail --title "$(translate "Main Menu")" --menu "$(translate "Select an option:")" 15 60 5 \
@ -59,5 +66,6 @@ done
# Main flow # Main flow
initialize_cache initialize_cache
load_language
show_menu show_menu