diff --git a/usr/bin/mabox-include.cfg b/usr/bin/mabox-include.cfg index faaa6e8..9342748 100755 --- a/usr/bin/mabox-include.cfg +++ b/usr/bin/mabox-include.cfg @@ -49,11 +49,22 @@ prompt() { # Usage: connectiontest [attempts] # If attempt count is not specified or 0, then it will loop forever and exit(!) your main program with 1 exit status. connectiontest() { +case $LANG in + pl*) + local TEXT_CHECKING='Sprawdzanie połączenia internetowego...' + local TEXT_FAILED='Brak połączenia internetowego!' + local TEXT_ASK_RETRY=$'\n\nTen skrypt wymaga działającego połączenia internetowego. Skonfiguruj połączenie internetowe, a następnie wciśnij dowolny klawisz, aby kontynuować, aby wyjść wciśnij "q".' + local TEXT_ABORT='Skrypt przerwany.' + local TEXT_OK='Test połączenia internetowego zakończył się powodzeniem!' + ;; + *) local TEXT_CHECKING='Checking internet connection...' local TEXT_FAILED='Internet connection test failed!' local TEXT_ASK_RETRY=$'\n\nThis script requires a working internet connection. Please configure your internet connection, then hit any key to continue, else hit "q" to quit.' local TEXT_ABORT='Script aborted.' local TEXT_OK='Internet connection test passed!' + ;; + esac local -i i attempts=${1-0} for (( i=0; i < attempts || attempts == 0; i++ )); do @@ -112,39 +123,64 @@ menuEnd() { # Usage: promptInstall title description package... promptInstall() { +case $LANG in + pl*) + PROBLEM="Wystąpił problem podczas instalowania" + HITANY=" Wciśnij dowolny klawisz aby spróbować ponownie, lub 'q' aby wyjść" + INST="INSTALACJA" + WILLINST="Ten skrypt zainstaluje" + RUNNOW=" Uruchomić instalowanie?" + UPD_SOURCES="Aktualizowanie źródeł..." + INSTALLING="Instalowanie pakietu..." + SUCCESFULLY="został zainstalowany." + ANYKEYEXIT="Wciśnij dowolny klawisz aby wyjść..." + ;; + *) + PROBLEM="There was a problem installing" + HITANY=" Hit any key to try again, or 'q' to quit..." + INST="INSTALL" + WILLINST="This script will install" + RUNNOW=" Run the installer now?" + UPD_SOURCES="Updating sources..." + INSTALLING="Installing package..." + SUCCESFULLY="has been installed successfully." + ANYKEYEXIT="Hit any key to exit..." + ;; +esac + while true; do # Repeat until there are no errors if [[ $TRYAGAIN ]]; then # previous try failed say - say "There was a problem installing ${2,,}." + say "$PROBLEM ${2,,}." say - prompt ' Hit any key to try again, or "q" to quit...' Q && return 1 + prompt "$HITANY" Q && return 1 fi local TRYAGAIN=true clear say - say "INSTALL ${1^^}" + say "$INST ${1^^}" say '------------------------' - say "This script will install ${2,,}." + say "$WILLINST ${2,,}." say - prompt ' Run the installer now?' || return 0 + prompt "$RUNNOW" || return 0 clear connectiontest || continue clear - say 'Updating sources...' 1 + say "$UPD_SOURCES" 1 sudo pacman -Syu clear - say 'Installing package...' 1 + say "$INSTALLING" 1 sudo pacman -S "${@:3}" || continue clear say - say "${2^} has been installed successfully." + say "${2^} $SUCCESFULLY" say - say 'Hit any key to exit...' + say "$ANYKEYEXIT" read -srn1 return 0 done