lang & firefox-esr

- Added `_detect_lang()` helper to `modules/utils.sh` (extracts first 2 chars from `$LANG`, fallback to `en`).
- Created `_detect_lang_pkg()` utility for LibreOffice localization: handles regional variants (`es-ar` → `es`) and skips English packages.
- Implemented `_check_network()` with cascade methods (ping→wget→curl) in `modules/utils.sh`. Warning-only pre-flight check after `check_sudo` in `debianito.sh`, compatible with `set -euo pipefail`.
- Fixed system time validation: changed `2026` threshold to `2025` in `check_system_time()` (replaced self-referential `$(date +%Y)` which always evaluated false).
- Refactored LibreOffice language selection in `office.sh`: replaced 10 lines of inline logic with `_detect_lang_pkg "libreoffice-l10n"`.
- Overhauled Firefox ESR integration in `internet.sh`: added state detection, mutual exclusion guard (both Firefox variants selected → warning), new `install_firefox_esr()` function with language support.
- Updated `install_firefox_mozilla()`: added Debian version guard (`<12`), replaced `_run_install` with `_run_cmd`.
- Standardized header in internet menu and improved whiptail UX for Firefox options.
This commit is contained in:
stornic56
2026-06-25 22:06:15 -05:00
committed by GitHub
parent 3972cc4811
commit ad0b39e159
7 changed files with 154 additions and 29 deletions
+2 -10
View File
@@ -33,16 +33,8 @@ install_libreoffice_bpo() {
return
fi
local sys_lang
sys_lang=$(echo "${LANG:-en}" | cut -c1-2 | tr '[:upper:]' '[:lower:]')
local lang_pkg=""
if [ "$sys_lang" != "en" ]; then
local candidate="libreoffice-l10n-${sys_lang}"
if apt-cache show "$candidate" &>/dev/null 2>&1; then
lang_pkg="$candidate"
fi
fi
local lang_pkg
lang_pkg=$(_detect_lang_pkg "libreoffice-l10n")
local ver
ver=$(apt-cache policy libreoffice 2>/dev/null | awk 'NR==3 {print $2; exit}')