huge longrun improvements
This commit is contained in:
@@ -34,7 +34,8 @@
|
||||
# * OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
locale_check() {
|
||||
locale_check()
|
||||
{
|
||||
locale -a | grep -qx "$1" || {
|
||||
disp W "Locale '$1' is not installed on this system."
|
||||
return 1
|
||||
@@ -45,9 +46,34 @@ locale_check() {
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Change locale to the given one in parameter
|
||||
# ------------------------------------------------------------------------------
|
||||
# Usage: setlocale <locale>
|
||||
setlocale()
|
||||
{
|
||||
local PARSED
|
||||
PARSED=$(getopt -o h --long help -n 'setlocale' -- "$@")
|
||||
if [[ $? -ne 0 ]]; then
|
||||
disp E "Invalid options, use \"setlocale --help\" to display usage."
|
||||
return 1
|
||||
fi
|
||||
eval set -- "$PARSED"
|
||||
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
printf "setlocale: Configure system environment locale variables.\n\n"
|
||||
printf "Usage: setlocale <locale>\n\n"
|
||||
printf "Options:\n"
|
||||
printf " -h, --help Display this help screen\n"
|
||||
return 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
disp E "Invalid options, use \"setlocale --help\" to display usage."
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
local loc=$1
|
||||
[[ -z $loc ]] && disp E "No locale specified." && return 1
|
||||
|
||||
@@ -64,11 +90,12 @@ setlocale()
|
||||
disp I "Locale set to $loc."
|
||||
}
|
||||
export -f setlocale
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Special case : change locale to C standard
|
||||
# ------------------------------------------------------------------------------
|
||||
# Usage: setc
|
||||
setc()
|
||||
{
|
||||
# Locale definitions
|
||||
@@ -76,27 +103,31 @@ setc()
|
||||
disp I "Locale changed to standard C (POSIX)."
|
||||
}
|
||||
export -f setc
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Change locale to French
|
||||
# ------------------------------------------------------------------------------
|
||||
# Usage: setfr
|
||||
setfr()
|
||||
{
|
||||
# Set fr locale definitions
|
||||
setlocale "fr_FR.UTF-8"
|
||||
}
|
||||
export -f setfr
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Change locale to US (needed by Steam)
|
||||
# ------------------------------------------------------------------------------
|
||||
# Usage: setus
|
||||
setus()
|
||||
{
|
||||
setlocale "en_US.UTF-8"
|
||||
}
|
||||
export -f setus
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# EOF
|
||||
|
||||
Reference in New Issue
Block a user