mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 12:16:53 +00:00
Update config_menu.sh
This commit is contained in:
parent
42d50693a5
commit
90d26ee721
@ -13,29 +13,15 @@
|
|||||||
|
|
||||||
# Configuration ============================================
|
# Configuration ============================================
|
||||||
REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main"
|
REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main"
|
||||||
UTILS_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main/scripts/utils.sh"
|
|
||||||
BASE_DIR="/usr/local/share/proxmenux"
|
BASE_DIR="/usr/local/share/proxmenux"
|
||||||
CACHE_FILE="$BASE_DIR/cache.json"
|
UTILS_FILE="$BASE_DIR/utils.sh"
|
||||||
VENV_PATH="/opt/googletrans-env"
|
VENV_PATH="/opt/googletrans-env"
|
||||||
LANGUAGE=$(jq -r '.language // "en"' "$BASE_DIR/config.json" 2>/dev/null)
|
|
||||||
|
|
||||||
if ! source <(curl -sSf "$UTILS_URL"); then
|
if [[ -f "$UTILS_FILE" ]]; then
|
||||||
echo "$(translate 'Error: Could not load utils.sh from') $UTILS_URL"
|
source "$UTILS_FILE"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
load_language
|
||||||
initialize_cache() {
|
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
|
|
||||||
}
|
|
||||||
# ==========================================================
|
# ==========================================================
|
||||||
|
|
||||||
|
|
||||||
@ -65,7 +51,6 @@ show_config_menu() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Change language
|
|
||||||
change_language() {
|
change_language() {
|
||||||
LANGUAGE=$(whiptail --title "$(translate "Change Language")" --menu "$(translate "Select a new language for the menu:")" 20 60 12 \
|
LANGUAGE=$(whiptail --title "$(translate "Change Language")" --menu "$(translate "Select a new language for the menu:")" 20 60 12 \
|
||||||
"en" "$(translate "English (Recommended)")" \
|
"en" "$(translate "English (Recommended)")" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user