From 9caf240d5232550363b85dd74b13559c78ec7df5 Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Fri, 31 Jan 2025 20:48:31 +0100 Subject: [PATCH] Update hw_grafics_menu.sh --- scripts/menus/hw_grafics_menu.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/menus/hw_grafics_menu.sh b/scripts/menus/hw_grafics_menu.sh index 573c25a..dfdd5bb 100644 --- a/scripts/menus/hw_grafics_menu.sh +++ b/scripts/menus/hw_grafics_menu.sh @@ -20,12 +20,24 @@ VENV_PATH="/opt/googletrans-env" LANGUAGE=$(jq -r '.language // "en"' "$BASE_DIR/config.json" 2>/dev/null) -# Try to load utils.sh from GitHub if ! source <(curl -sSf "$UTILS_URL"); then echo "$(translate 'Error: Could not load utils.sh from') $UTILS_URL" exit 1 fi +initialize_cache() { + if [ ! -f "$CACHE_FILE" ]; then + echo "{}" > "$CACHE_FILE" + return + fi +} + +load_language() { + if [ -f "$CONFIG_FILE" ]; then + LANGUAGE=$(jq -r '.language' "$CONFIG_FILE") + fi +} + while true; do OPTION=$(whiptail --title "$(translate "GPUs and Coral-TPU Menu")" --menu "$(translate "Select an option:")" 15 60 8 \