From 4c21f669b7c2fc810a140072b9a1a068bdce4c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Wed, 14 Feb 2024 13:37:58 +0100 Subject: [PATCH] Change name of localization array --- include/qsgen2/lang/en_US | 4 ++-- include/qsgen2/lang/es_ES | 4 ++-- include/qsgen2/lang/nb_NO | 4 ++-- qsgen2 | 8 +++++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/qsgen2/lang/en_US b/include/qsgen2/lang/en_US index ebd2d72..0def5b2 100644 --- a/include/qsgen2/lang/en_US +++ b/include/qsgen2/lang/en_US @@ -1,5 +1,5 @@ -typeset -A localization -localization=( +typeset -A qsgenlang +qsgenlang=( _qsgen2_msg_1 "Usage: qsgen2 add \\"Site Name\\" \\"/path/to/project\\"" _qsgen2_msg_2 "- Forced Update: Generating Everything" _qsgen2_msg_3 "* %SCRIPT_NAME% cannot parse this site. Exiting. *" diff --git a/include/qsgen2/lang/es_ES b/include/qsgen2/lang/es_ES index 653cd80..992a543 100644 --- a/include/qsgen2/lang/es_ES +++ b/include/qsgen2/lang/es_ES @@ -1,5 +1,5 @@ -typeset -A localization -localization=( +typeset -A qsgenlang +qsgenlang=( _qsgen2_msg_1 "Uso: qsgen2 add \"Nombre del Sitio\" \"ruta/al/proyecto\"" _qsgen2_msg_2 "- ActualizaciĆ³n forzada: Generando todo" _qsgen2_msg_3 "* %SCRIPT_NAME% no puede analizar este sitio. Saliendo. *" diff --git a/include/qsgen2/lang/nb_NO b/include/qsgen2/lang/nb_NO index 759fe72..43d7aae 100644 --- a/include/qsgen2/lang/nb_NO +++ b/include/qsgen2/lang/nb_NO @@ -1,5 +1,5 @@ -typeset -A localization -localization+=( +typeset -A qsgenlang +qsgenlang=( _qsgen2_msg_2 "- Tvungen oppdatering: Genererer alt" _qsgen2_msg_3 "* %SCRIPT_NAME% kan ikke analysere dette nettstedet. Avslutter. *" _qsgen2_msg_4 "Vennligst installer Pandoc." diff --git a/qsgen2 b/qsgen2 index 0b9fbe5..612bc8e 100755 --- a/qsgen2 +++ b/qsgen2 @@ -58,7 +58,7 @@ if ! $found; then # Fallback or error handling fi echo "Language loaded: ${language}" -echo "Localization array contents: ${(@kv)localization}" +echo "Localization array contents: ${(@kv)qsgenlang}" if (${globaldebug}); then qsconfig=$( cat $(pwd)/config | grep -v \# | awk '{print substr($0, index($0, " ") + 1)}' ) @@ -69,15 +69,17 @@ if (${globaldebug}); then done fi +echo "Sample QSGenLang entry: ${qsgenlang[_qsgen2_msg_1]}" + function _msg() { local type=$1 shift # Remove the first argument so $@ now contains only keys or additional strings local full_msg="" for arg in "$@"; do - if [[ -n "${localization[$arg]}" ]]; then + if [[ -n "${qsgenlang[$arg]}" ]]; then echo "Found key: $arg" # Debug line to confirm key is found - full_msg+="${localization[$arg]}" + full_msg+="${qsgenlang[$arg]}" else echo "Key not found: $arg" # Debug line for keys not found full_msg+="$arg"