Update more english translation text

This commit is contained in:
natemaia
2018-10-26 01:26:21 -07:00
parent 89c95254ed
commit ce18eabd60
6 changed files with 369 additions and 364 deletions

View File

@ -12,7 +12,7 @@
# immutable {
readonly DIST="ArchLabs" # Linux distributor
readonly VER="1.6.94" # Installer version
readonly VER="1.7.1" # Installer version
readonly LIVE="liveuser" # Live session user
readonly MNT="/mnt/install" # Install mountpoint
readonly ERR="/tmp/errlog" # Built-in error log
@ -108,7 +108,6 @@ init() {
declare -g MKINIT_HOOKS="shutdown"
declare -g WARN=false
declare -g IS_64BIT=false
declare -g AUTOLOGIN=false
declare -g CONFIG_DONE=false
declare -g SEPERATE_BOOT=false
@ -133,17 +132,6 @@ init() {
)
}
devices() {
IGNORE_DEV="$(lsblk -lno NAME,MOUNTPOINT | awk '/\/run\/archiso\/bootmnt/ {sub(/[1-9]/, ""); print $1}')"
if [[ $IGNORE_DEV ]]; then
SYS_DEVS="$(lsblk -lno NAME,SIZE,TYPE | awk '/disk/ && !'"/$IGNORE_DEV/"' {print "/dev/" $1 " " $2}')"
else
SYS_DEVS="$(lsblk -lno NAME,SIZE,TYPE | awk '/disk/ {print "/dev/" $1 " " $2}')"
fi
DEV_COUNT="$(wc -l <<< "$SYS_DEVS")"
declare -gr SYS_DEVS IGNORE_DEV DEV_COUNT
}
user() {
tput cnorm
local values
@ -264,9 +252,9 @@ keymap() {
fi
if [[ $DISPLAY && $TERM != 'linux' ]]; then
(type setxkbmap >/dev/null 2>&1) && setxkbmap $KEYMAP >/dev/null 2>&1
hash setxkbmap >/dev/null 2>&1 && setxkbmap $KEYMAP >/dev/null 2>&1
else
(type loadkeys >/dev/null 2>&1) && loadkeys $CONSOLE_MAP >/dev/null 2>&1
hash loadkeys >/dev/null 2>&1 && loadkeys $CONSOLE_MAP >/dev/null 2>&1
fi
return 0
}
@ -285,6 +273,20 @@ timezone() {
yesno "$_TimeZTitle" "$_TimeZQ $ZONE/$SUBZONE?\n" && return 0 || timezone
}
choose_dm() {
LOGIN_TYPE="$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_WMLogin " --menu "$_LoginTypeBody" 0 0 0 \
"xinit" "Console login without a display manager" \
"lightdm" "Lightweight display manager with the gtk greeter")"
[[ $? -eq 0 ]] || return 1
if [[ $LOGIN_TYPE == 'lightdm' ]]; then
WM_PACKAGES+=" lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
FILES[11]="/etc/lightdm/lightdm.conf /etc/lightdm/lightdm-gtk-greeter.conf"
else
FILES[11]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.zprofile /home/$NEWUSER/.xprofile"
fi
}
sessions() {
INSTALL_WMS="$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 0 \
@ -295,11 +297,13 @@ sessions() {
"gnome" "A desktop environment that aims to be simple and easy to use" off \
"cinnamon" "A desktop environment combining a traditional desktop layout with modern graphical effects" off \
"xfce4" "A lightweight and modular desktop environment based on GTK+ 2 and 3" off)"
[[ $? != 0 || $INSTALL_WMS == "" ]] && return 1
[[ $? -eq 0 ]] || return 1
[[ $INSTALL_WMS ]] || INSTALL_WMS='openbox'
WM_NUM=$(awk '{print NF}' <<< "$INSTALL_WMS")
WM_PACKAGES="$INSTALL_WMS"
# packages needed for the selected WM/DE
# packages needed for the selected WMs/DEs
for wm in $INSTALL_WMS; do
LOGIN_CHOICES="${LOGIN_CHOICES}$wm - "
case $wm in
@ -319,25 +323,19 @@ sessions() {
WM_PACKAGES+=" archlabs-oblogout archlabs-screenlock archlabs-paranoid"
fi
# choose which to login
if [[ $WM_NUM -eq 1 ]]; then
# choose which WM/DE to start at login
if (( WM_NUM == 1 )); then
LOGIN_WM="$INSTALL_WMS"
else
LOGIN_WM="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
--title " $_WMLogin " --menu "$_WMLoginBody" 0 0 0 $LOGIN_CHOICES)"
[[ $LOGIN_WM == "" ]] && LOGIN_WM="$(awk '{print $1}' <<< "$INSTALL_WMS")"
[[ $? -eq 0 ]] || return 1
fi
# chose login type
if yesno "$_WMLogin" "$_LoginTypeBody\n" "xinit" "lightdm"; then
LOGIN_TYPE='xinit'
FILES[11]="/home/$NEWUSER/.xinitrc"
else
LOGIN_TYPE='lightdm'
WM_PACKAGES+=" lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
FILES[11]="/etc/lightdm/lightdm.conf /etc/lightdm/lightdm-gtk-greeter.conf"
fi
# choose how to log in
choose_dm || return 1
# add all the packages to the main package list
EXTRA_PACKAGES="$WM_PACKAGES"
# autologin
@ -349,7 +347,6 @@ sessions() {
openbox) LOGIN_WM='openbox-session' ;;
cinnamon) LOGIN_WM='cinnamon-session' ;;
esac
return 0
}
@ -447,38 +444,31 @@ packages() {
mirrors() {
local key="5f29642060ab983b31fdf4c2935d8c56"
local ip="$(curl -s "http://api.ipstack.com/check&fields=ip&?access_key=${key}" |
json 'ip')"
if hash reflector >/dev/null 2>&1; then
MIRROR_CMD="reflector --score 100 -l 50 -f 10 --sort rate --verbose"
yesno "$_MirrorTitle" "$_MirrorSetup" "Automatic" "Custom" && return 0
local c="$(curl -s "http://api.ipstack.com/${ip}?access_key=${key}&fields=country_name" |
json 'country_name')"
if [[ $c != "" ]]; then
MIRROR_CMD="reflector --country $c --score 80 --latest 40 --fastest 10 --sort rate --verbose"
fi
local ip="$(json 'ip' "check&?access_key=${key}&fields=ip")"
local c="$(json 'country_name' "${ip}?access_key=${key}&fields=country_name")"
MIRROR_CMD="reflector --country $c --score 80 --latest 40 --fastest 10 --sort rate --verbose"
tput cnorm
MIRROR_CMD="$(dialog --cr-wrap --no-cancel --stdout --backtitle "$BT" \
--title " $_MirrorTitle " --inputbox "$_MirrorCmd\n
--score n Limit the list to the n servers with the highest score.
--latest n Limit the list to the n most recently synchronized servers.
--fastest n Return the n fastest mirrors that meet the other criteria.
--sort {age,rate,country,score,delay}
--score n Limit the list to the n servers with the highest score.
--latest n Limit the list to the n most recently synchronized servers.
--fastest n Return the n fastest mirrors that meet the other criteria.
--sort {age,rate,country,score,delay}
'age': Last server synchronization;
'rate': Download rate;
'country': Server location;
'score': MirrorStatus score;
'delay': MirrorStatus delay.\n" 0 0 "$MIRROR_CMD")"
'age': Last server synchronization;
'rate': Download rate;
'country': Server location;
'score': MirrorStatus score;
'delay': MirrorStatus delay.\n" 0 0 "$MIRROR_CMD")"
else
local c="$(curl -s "http://api.ipstack.com/${ip}?access_key=${key}&fields=country_code" |
json 'country_code')"
local ip="$(json 'ip' "check&?access_key=${key}&fields=ip")"
local c="$(json 'country_code' "${ip}?access_key=${key}&fields=country_code")"
local w="https://www.archlinux.org/mirrorlist"
if [[ $c != "" ]]; then
if [[ $c ]]; then
if [[ $c =~ (CA|US) ]]; then
MIRROR_CMD="curl -s '$w/?country=US&country=CA&protocol=https&use_mirror_status=on'"
else
@ -544,8 +534,7 @@ configure() {
configs() {
if [[ $CURRENT_MENU != "edit" ]]; then
SELECTED=1
CURRENT_MENU="edit"
SELECTED=1; CURRENT_MENU="edit"
elif (( SELECTED < 11 )); then
(( SELECTED++ ))
fi
@ -558,13 +547,27 @@ configs() {
"11" "${LOGIN_TYPE^}")
if [[ ! $SELECTED || $SELECTED -eq 1 ]]; then
wrap_up "$_InstFinBody" 'Reboot' 'Back' 'reboot'
die 'reboot'
else
local existing_files=""
for f in $(echo "${FILES[$SELECTED]}"); do
[[ -e ${MNT}$f ]] && existing_files+=" ${MNT}$f"
done
[[ ! $existing_files ]] && msgbox "$_ErrTitle" "$_NoFileErr" || vim -O $existing_files
if [[ ! $existing_files ]]; then
msgbox "$_ErrTitle" "$_NoFileErr"
else
if hash vim >/dev/null 2>&1; then
vim -O $existing_files
else
for f in $existing_files; do
if hash nano >/dev/null 2>&1; then
nano $f
else
vi $f
fi
done
fi
fi
fi
configs
}
@ -590,8 +593,7 @@ main() {
if [[ $SELECTED -eq 8 ]]; then
icheck || return 1
elif [[ ($SELECTED -eq 2 || $SELECTED -eq 5) && $WARN != true ]]; then
msgbox "$_PrepTitle" "$_WarnMount"
WARN=true
msgbox "$_PrepTitle" "$_WarnMount" && WARN=true
fi
fi
@ -603,17 +605,14 @@ main() {
5) mountp || SELECTED=4 ;;
6) configure || SELECTED=5 ;;
7) display ;;
8) install || SELECTED=7 ;;
*) wrap_up "$_CloseInstBody" 'Exit' 'Back' 'exit'
8) install ;;
*) yesno "$_CloseInst" "$_CloseInstBody" "Exit" "Back" && die 0
esac
}
# must be done first
init
# declares system device list
devices
# source all the lib files
for i in /usr/share/archlabs/installer/lib/?*.sh; do
. "$i" || { printf "\nFailed to source library file %s\n" "$i"; die 1; }
@ -627,6 +626,7 @@ for arg in $@; do case $arg in
esac done
# initial choices/prep
devices
language
keymap
checks