Change name of localization array
This commit is contained in:
parent
fd54fc7543
commit
4c21f669b7
@ -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. *"
|
||||
|
@ -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. *"
|
||||
|
@ -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."
|
||||
|
8
qsgen2
8
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"
|
||||
|
Loading…
Reference in New Issue
Block a user