Load translations from file, but disable color output

This commit is contained in:
southerntofu 2020-12-01 17:36:12 +01:00
parent 0caa9c0eba
commit 711a04d378
1 changed files with 22 additions and 18 deletions

View File

@ -22,6 +22,10 @@ fi
# - we load the requested language if it exists, fail otherwise
# - when no language is requested, default to something (TODO)
if [[ "$LANG" != "NONE" ]]; then
# If LANG is a file, load it directly
if [ -f "$LANG" ]; then
locale_strings="$(cat $LANG)"
else
# Enable colors (escape codes) as echo option
COLORS=1
@ -40,7 +44,7 @@ if [[ "$LANG" != "NONE" ]]; then
# Initialize translations
[ -f $I18N_DIR/$locale.json ] && locale_strings="$(cat $I18N_DIR/$locale.json)" || locale_strings="$(cat $I18N_DIR/en.json)"
fi
fi # End translations initialization
# Takes one argument, looks up translation
@ -305,7 +309,7 @@ done
# Error when the requested basedir (or the default ~/.forgebuild) does not exist
if [ ! -d $BASEDIR ]; then
i18n_basedir="$BASEDIR"
export i18n_basedir="$BASEDIR"
error "missing_basedir"
exit 1
fi