w00t! Think I got it...
I was wondering why only '[MP]' was being difficult, and nothing else, and my mind started wandering.
I changed the '[p]' in the 'cleanup' function to something more unique (easier to find when editing/testing code).
Added '${font}' to the end of the '[MP]' line, in my template, and it seems to be working now. LoL!
UPDATE 1
* Changed the logical OR operator to AND ('||' to '&&') also.
Not sure how this will affect the langs. Guess I should go test it, huh?
UPDATE 2
Spanish is working in '[MP]' now. I don't *think* it was doing jack before.
If I remember correctly, '[MP]' was displaying in English, even when Spanish was selected.
UPDATE 3
Changed the AND operator back to OR. AND operator was causing everything but '[MP]' to fail. LoL!
Funny thing is, everything is working normally now -- no close bracket et cetera.
This is a grand cat n' mouse game!
Think I'll turn my back on it, for a few minutes, and let it sneak up on me again. Heh!
Code:
# -----------------------------------------------------------------------
# Process the final template before showtime
# -----------------------------------------------------------------------
pre_showtime_template () {
# set -x
if [[ $language_to_use ]]; then
lang_path="${cwxpath}/lang"
language_to_use2=${language_to_use,,}
language_file="${lang_path}/${language_to_use2}.lang"
if [[ -s $language_file ]]; then
source $language_file
else
msgout "$no_lang_display"
fi
fi
if [[ $template_cleanup ]] && [[ $language_to_use ]]; then
template_cleanup2=( "${do_lang[@]}" "${template_cleanup[@]}" )
elif [[ ! $template_cleanup ]] && [[ $language_to_use ]]; then
template_cleanup2=( "${do_lang[@]}" )
elif [[ $template_cleanup ]] && [[ ! $language_to_use ]]; then
template_cleanup2=( "${template_cleanup[@]}" )
fi
if [[ $template_cleanup ]] && [[ $language_to_use ]]; then
for vindsl in ${!template_cleanup2[@]}
do
local bl_text="${template_cleanup2[vindsl]}"
if [[ $bl_text == *:* ]]; then
local lt1=${bl_text/\:*} # get value left of :
local rt1=${bl_text#*\:} # get value right of :
local rt1=$(do_pc_what_case "$rt1")
# local test1='s`'"$lt1"'`'"$rt1"'`gi'
local test1='s`\<'"${lt1}"'\>`'"${rt1}"'`gi'
local test2+="$test1; "
err_1=0
else
err_1=1
fi
done
case $err_1 in
0) sed -i -e "${test2[@]}" $temp_template ;;
1) msgout "$showtime_err" ;;
esac
fi
# set +x
}
Go figure!
That was too easy!
I'll keep an eye on it for a while...
Bookmarks