Skip to content

Commit

Permalink
improved initial language loading #565
Browse files Browse the repository at this point in the history
  • Loading branch information
frostworx committed Sep 15, 2022
1 parent ee33b0f commit 72c0980
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v11.1.20220915"
PROGVERS="v11.1.20220916"
PROGCMD="${0##*/}"
SHOSTL="stl"
GHURL="https://github.com"
Expand Down Expand Up @@ -2237,21 +2237,24 @@ function loadLanguage {

writelog "INFO" "${FUNCNAME[0]} - Loading STLLANG from '$STLDEFGLOBALCFG'"

if [ -f "$STLDEFGLOBALCFG" ]; then
ARGSLANG="$(awk -F 'lang=' '{print $2}' <<< "$@" | cut -d ' ' -f1)"
if [ -n "$ARGSLANG" ]; then
STLLANG="$ARGSLANG"
writelog "INFO" "${FUNCNAME[0]} - STLLANG from command line' is '$STLLANG'"

elif [ -f "$STLDEFGLOBALCFG" ]; then
STLLRAW="$(grep "^STLLANG" "$STLDEFGLOBALCFG" | cut -d '=' -f2)"
STLLANG="${STLLRAW//\"/}"
writelog "INFO" "${FUNCNAME[0]} - STLLANG from '$STLDEFGLOBALCFG' is '$STLLANG'"
else
ARGSLANG="$(awk -F 'lang=' '{print $2}' <<< "$@" | cut -d ' ' -f1)"
if [ -n "$ARGSLANG" ]; then
STLLANG="$ARGSLANG"
writelog "INFO" "${FUNCNAME[0]} - STLLANG from command line' is '$STLLANG'"
fi
writelog "WARN" "${FUNCNAME[0]} - Could not determine STLLANG"
fi

if [ -n "$STLLANG" ] && [ "$STLLANG" != "$STLDEFLANG" ]; then
writelog "INFO" "${FUNCNAME[0]} - Now load the language file '$STLLANG'"
loadLangFile "$STLLANG"
touch "$FUPDATE"
updateConfigEntry "STLLANG" "$STLLANG" "$STLDEFGLOBALCFG"
fi

# touch "$STLSHM/lola-$AID.txt"
Expand Down

0 comments on commit 72c0980

Please sign in to comment.