diff --git a/setup b/setup index 5d623e5..c2d2f38 100755 --- a/setup +++ b/setup @@ -1,7 +1,7 @@ #!/bin/bash ANSWER="/tmp/.setup" -TITLE="Arch Linux Installation" +TITLE="$(gettext "Arch Linux Installation")" LOG="/dev/tty5" DESTDIR="/mnt" EDITOR= @@ -45,16 +45,22 @@ NEXTITEM="" abort() { - dodialog yesno "Abort Installation?" 6 40 || return 0 + dodialog yesno "$(gettext "Abort Installation?")" 6 40 || return 0 exit 0 } msg() { - dodialog msgbox "$1" + dodialog msgbox "$(i18n $@)" return 1 } +i18n() { + msg="$1" + shift + printf "$(gettext "$msg")" $@ +} + dodialog() { # use this for msgbox, inputbox, yesno, infobox @@ -87,7 +93,7 @@ domenu() width=$1 ; shift mheight=$1 ; shift - dialog --backtitle "$TITLE" --$menutype "$text" $height $width $mheight $* + dialog --backtitle "$(i18n "$TITLE")" --$menutype "$text" $height $width $mheight $* } finddisks() { @@ -192,7 +198,7 @@ findpartitions() { get_grub_map() { rm /tmp/dev.map - dodialog infobox "Generating GRUB device map...\nThis could take a while.\n\n Please be patient." + dodialog infobox "$(i18n "Generating GRUB device map...\nThis could take a while.\n\n Please be patient.")" $DESTDIR/sbin/grub --no-floppy --device-map /tmp/dev.map >/tmp/grub.log 2>&1 <$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the destination directory where your target system is mounted")" 8 65 "/mnt" 2>$ANSWER || return 1 DESTDIR=$(cat $ANSWER) } geteditor() { - dialog --backtitle "$TITLE" --menu "Select a Text Editor to Use" 10 35 3 \ - "1" "nano (easier)" \ + dialog --backtitle "$TITLE" --menu "$(i18n "Select a Text Editor to Use")" 10 35 3 \ + "1" "$(printf "nano (%s)" $(gettext "easier"))" \ "2" "vi" 2>$ANSWER case $(cat $ANSWER) in "1") EDITOR="nano" ;; @@ -298,20 +304,20 @@ _mkfs() { if [ "${_domk}" = "yes" ]; then mkswap ${_device} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error creating swap: mkswap ${_device}" + msg "$(i18n "Error creating swap: mkswap %s" ${_device})" return 1 fi fi swapon ${_device} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error activating swap: swapon ${_device}" + msg "Error activating swap: swapon %s" ${_device} return 1 fi elif [ "${_fstype}" = "xfs" ]; then if [ "${_domk}" = "yes" ]; then mkfs.xfs -f ${_device} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error creating filesystem: mkfs.xfs ${_device}" + msg "$(gettext "Error creating filesystem"): mkfs.xfs ${_device}" return 1 fi sleep 2 @@ -319,14 +325,14 @@ _mkfs() { mkdir -p ${_dest}${_mountpoint} mount -t xfs ${_device} ${_dest}${_mountpoint} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error mounting ${_dest}${_mountpoint}" + msg "Error mounting %s%s" ${_dest} ${_mountpoint} return 1 fi elif [ "${_fstype}" = "jfs" ]; then if [ "${_domk}" = "yes" ]; then yes | mkfs.jfs ${_device} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error creating filesystem: mkfs.jfs ${_device}" + msg "$(gettext "Error creating filesystem"): mkfs.jfs ${_device}" return 1 fi sleep 2 @@ -334,14 +340,14 @@ _mkfs() { mkdir -p ${_dest}${_mountpoint} mount -t jfs ${_device} ${_dest}${_mountpoint} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error mounting ${_dest}${_mountpoint}" + msg "Error mounting %s%s" ${_dest} ${_mountpoint} return 1 fi elif [ "${_fstype}" = "reiserfs" ]; then if [ "${_domk}" = "yes" ]; then yes | mkreiserfs ${_device} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error creating filesystem: mkreiserfs ${_device}" + msg "$(gettext "Error creating filesystem"): mkreiserfs ${_device}" return 1 fi sleep 2 @@ -349,14 +355,14 @@ _mkfs() { mkdir -p ${_dest}${_mountpoint} mount -t reiserfs ${_device} ${_dest}${_mountpoint} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error mounting ${_dest}${_mountpoint}" + msg "Error mounting %s%s" ${_dest} ${_mountpoint} return 1 fi elif [ "${_fstype}" = "ext2" ]; then if [ "${_domk}" = "yes" ]; then mke2fs "${_device}" >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error creating filesystem: mke2fs ${_device}" + msg "$(gettext "Error creating filesystem"): mke2fs ${_device}" return 1 fi sleep 2 @@ -364,14 +370,14 @@ _mkfs() { mkdir -p ${_dest}${_mountpoint} mount -t ext2 ${_device} ${_dest}${_mountpoint} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error mounting ${_dest}${_mountpoint}" + msg "Error mounting %s%s" ${_dest} ${_mountpoint} return 1 fi elif [ "${_fstype}" = "ext3" ]; then if [ "${_domk}" = "yes" ]; then mke2fs -j ${_device} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error creating filesystem: mke2fs -j ${_device}" + msg "$(gettext "Error creating filesystem"): mke2fs -j ${_device}" return 1 fi sleep 2 @@ -379,14 +385,14 @@ _mkfs() { mkdir -p ${_dest}${_mountpoint} mount -t ext3 ${_device} ${_dest}${_mountpoint} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error mounting ${_dest}${_mountpoint}" + msg "Error mounting %s%s" ${_dest} ${_mountpoint} return 1 fi elif [ "${_fstype}" = "vfat" ]; then if [ "${_domk}" = "yes" ]; then mkfs.vfat ${_device} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error creating filesystem: mkfs.vfat ${_device}" + msg "$(gettext "Error creating filesystem"): mkfs.vfat ${_device}" return 1 fi sleep 2 @@ -394,11 +400,11 @@ _mkfs() { mkdir -p ${_dest}${_mountpoint} mount -t vfat ${_device} ${_dest}${_mountpoint} >$LOG 2>&1 if [ $? != 0 ]; then - msg "Error mounting ${_dest}${_mountpoint}" + msg "Error mounting %s%s" ${_dest} ${_mountpoint} return 1 fi else - msg "unknown fstype for ${_device}" + msg "unknown fstype for %s" ${_device} return 1 fi @@ -433,19 +439,19 @@ mksimplefs() { # validate DEVICE if [ ! -b "$DEVICE" ]; then - msg "Device '$DEVICE' is not valid" + msg "Device %s is not valid" "$DEVICE" return 1 fi # validate DEST if [ ! -d "$DESTDIR" ]; then - msg "Destination directory '$DESTDIR' is not valid" + msg "Destination directory %s is not valid" "$DESTDIR" return 1 fi # /boot required if [ $(echo $FSSPECS | grep '/boot:' | wc -l) -ne 1 ]; then - msg "Need exactly one boot partition" + msg "Need exactly one %s partition" "boot" return 1 fi @@ -457,19 +463,19 @@ mksimplefs() { # / required if [ $(echo $FSSPECS | grep '/:' | wc -l) -ne 1 ]; then - msg "Need exactly one root partition" + msg "Need exactly one %s partition" "root" return 1 fi if [ $(echo $FSSPECS | grep '/home:' | wc -l) -ne 1 ]; then - msg "Need exactly one home partition" + msg "Need exactly one %s partition" "home" return 1 fi rm -f /tmp/.fstab # disable swap and all mounted partitions, umount / last! - dodialog infobox "Disabling swapspace, unmounting already mounted disk devices..." + dodialog infobox "$(gettext "Disabling swapspace, unmounting already mounted disk devices...")" swapoff -a >/dev/null 2>&1 umount $(mount | grep -v "${DESTDIR} " | grep "${DESTDIR}" | sed 's|\ .*||g') >/dev/null 2>&1 umount $(mount | grep "${DESTDIR} " | sed 's|\ .*||g') >/dev/null 2>&1 @@ -505,8 +511,8 @@ mksimplefs() { $sfdisk_input EOF if [ $? -gt 0 ]; then - msg "Error partitioning $DEVICE (see $LOG for details)" - prink on + msg "Error partitioning %s (see %s for details)" $DEVICE $LOG + printk on return 1 fi printk on @@ -543,7 +549,7 @@ partition() { return 0 fi # disable swap and all mounted partitions, umount / last! - dodialog infobox "Disabling swapspace, unmounting already mounted disk devices..." + dodialog infobox "$(gettext "Disabling swapspace, unmounting already mounted disk devices...")" swapoff -a >/dev/null 2>&1 umount $(mount | grep -v "${DESTDIR} " | grep "${DESTDIR}" | sed 's|\ .*||g') >/dev/null 2>&1 umount $(mount | grep "${DESTDIR} " | sed 's|\ .*||g') >/dev/null 2>&1 @@ -552,24 +558,24 @@ partition() { # DISCS=$(finddisks _) DISCS="$DISCS OTHER -" - dodialog msgbox "Available Disks:\n\n$(for i in $(finddisks); do echo -n $(echo $i | sed 's#/dev/##g'): '' ; dmesg | grep $(echo $i | sed 's#/dev/##g') | grep sectors | sort -u | cut -d'(' -f2 | cut -d')' -f1; echo "\n"; done)\n" - domenu menu "Select the disk you want to partition" 14 55 7 $DISCS 2>$ANSWER || return 1 + dodialog msgbox "$(gettext "Available Disks"):\n\n$(for i in $(finddisks); do echo -n $(echo $i | sed 's#/dev/##g'): '' ; dmesg | grep $(echo $i | sed 's#/dev/##g') | grep sectors | sort -u | cut -d'(' -f2 | cut -d')' -f1; echo "\n"; done)\n" + domenu menu "$(gettext "Select the disk you want to partition")" 14 55 7 $DISCS 2>$ANSWER || return 1 DISC=$(cat $ANSWER) if [ "$DISC" = "OTHER" ]; then - dodialog inputbox "Enter the full path to the device you wish to partition" 8 65 "/dev/sda" 2>$ANSWER || return 1 + dodialog inputbox "$(gettext "Enter the full path to the device you wish to partition")" 8 65 "/dev/sda" 2>$ANSWER || return 1 DISC=$(cat $ANSWER) fi while [ "$DISC" != "DONE" ]; do # # Partition disc # - dodialog msgbox "Now you'll be put into the cfdisk program where you can partition your hard drive. You should make a swap partition and as many data partitions as you will need. NOTE: cfdisk may tell you to reboot after creating partitions. If you need to reboot, just re-enter this install program, skip this step and go on to step 2." 18 70 + dodialog msgbox "$(gettext "Now you'll be put into the cfdisk program where you can partition your hard drive. You should make a swap partition and as many data partitions as you will need. NOTE: cfdisk may tell you to reboot after creating partitions. If you need to reboot, just re-enter this install program, skip this step and go on to step 2.")" 18 70 cfdisk $DISC - domenu menu "Select the disk you want to partition" 14 55 7 $DISCS DONE + 2>$ANSWER || return 1 + domenu menu "$(gettext "Select the disk you want to partition")" 14 55 7 $DISCS DONE + 2>$ANSWER || return 1 DISC=$(cat $ANSWER) if [ "$DISC" = "OTHER" ]; then - dodialog inputbox "Enter the full path to the device you wish to partition" 8 65 "/dev/sda" 2>$ANSWER || return 1 + dodialog inputbox "$(gettext "Enter the full path to the device you wish to partition")" 8 65 "/dev/sda" 2>$ANSWER || return 1 DISC=$(cat $ANSWER) fi done @@ -597,58 +603,58 @@ mountpoints() { # # Select mountpoints # - dodialog msgbox "Available Disks:\n\n$(for i in $(finddisks); do echo -n $(echo $i | sed 's#/dev/##g'): '' ; dmesg | grep $(echo $i | sed 's#/dev/##g') | grep sectors | sort -u | cut -d'(' -f2 | cut -d')' -f1; echo "\n"; done)\n" + dodialog msgbox "$(gettext "Available Disks"):\n\n$(for i in $(finddisks); do echo -n $(echo $i | sed 's#/dev/##g'): '' ; dmesg | grep $(echo $i | sed 's#/dev/##g') | grep sectors | sort -u | cut -d'(' -f2 | cut -d')' -f1; echo "\n"; done)\n" PARTS=$(findpartitions _) - domenu menu "Select the partition to use as swap" 21 50 13 NONE - $PARTS 2>$ANSWER || return 1 + domenu menu "$(gettext "Select the partition to use as swap")" 21 50 13 NONE - $PARTS 2>$ANSWER || return 1 PART=$(cat $ANSWER) PARTS="$(echo $PARTS | sed -e "s#${PART}\ _##g")" PART_SWAP=$PART if [ "$PART_SWAP" != "NONE" ]; then DOMKFS="no" - dodialog yesno "Would you like to create a filesystem on $PART?\n\n(This will overwrite existing data!)" && DOMKFS="yes" + dodialog yesno "$(i18n "Would you like to create a filesystem on %s?\n\n(This will overwrite existing data!)" $PART)" && DOMKFS="yes" echo "$PART:swap:swap:$DOMKFS" >>/tmp/.parts fi - domenu menu "Select the partition to mount as /" 21 50 13 $PARTS 2>$ANSWER || return 1 + domenu menu "$(i18n "Select the partition to mount as /")" 21 50 13 $PARTS 2>$ANSWER || return 1 PART=$(cat $ANSWER) PARTS="$(echo $PARTS | sed -e "s#${PART}\ _##g")" PART_ROOT=$PART # Select root filesystem type - domenu menu "Select a filesystem for $PART" 13 45 6 $FSOPTS 2>$ANSWER || return 1 + domenu menu "$(i18n "Select a filesystem for %s" $PART)" 13 45 6 $FSOPTS 2>$ANSWER || return 1 FSTYPE=$(cat $ANSWER) DOMKFS="no" - dodialog yesno "Would you like to create a filesystem on $PART?\n\n(This will overwrite existing data!)" && DOMKFS="yes" + dodialog yesno "$(i18n "Would you like to create a filesystem on %s?\n\n(This will overwrite existing data!)" $PART)" && DOMKFS="yes" echo "$PART:$FSTYPE:/:$DOMKFS" >>/tmp/.parts # # Additional partitions # - domenu menu "Select any additional partitions to mount under your new root (select DONE when finished)" 21 50 13 $PARTS DONE _ 2>$ANSWER || return 1 + domenu menu "$(i18n "Select any additional partitions to mount under your new root (select DONE when finished)")" 21 50 13 $PARTS DONE _ 2>$ANSWER || return 1 PART=$(cat $ANSWER) while [ "$PART" != "DONE" ]; do PARTS="$(echo $PARTS | sed -e "s#${PART}\ _##g")" # Select a filesystem type - domenu menu "Select a filesystem for $PART" 13 45 6 $FSOPTS 2>$ANSWER || return 1 + domenu menu "$(i18n "Select a filesystem for %s" $PART)" 13 45 6 $FSOPTS 2>$ANSWER || return 1 FSTYPE=$(cat $ANSWER) MP="" while [ "${MP}" = "" ]; do - dodialog inputbox "Enter the mountpoint for $PART" 8 65 "/boot" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the mountpoint for %s" $PART)" 8 65 "/boot" 2>$ANSWER || return 1 MP=$(cat $ANSWER) if grep ":$MP:" /tmp/.parts; then - dodialog msgbox "ERROR: You have defined 2 identical mountpoints! Please select another mountpoint." 8 65 + dodialog msgbox "$(gettext "ERROR"): $(gettext "You have defined 2 identical mountpoints! Please select another mountpoint.")" 8 65 MP="" fi done DOMKFS="no" - dodialog yesno "Would you like to create a filesystem on $PART?\n\n(This will overwrite existing data!)" && DOMKFS="yes" + dodialog yesno "$(i18n "Would you like to create a filesystem on %s?\n\n(This will overwrite existing data!)" $PART)" && DOMKFS="yes" echo "$PART:$FSTYPE:$MP:$DOMKFS" >>/tmp/.parts - domenu menu "Select any additional partitions to mount under your new root" 21 50 13 $PARTS DONE _ 2>$ANSWER || return 1 + domenu menu "$(i18n "Select any additional partitions to mount under your new root")" 21 50 13 $PARTS DONE _ 2>$ANSWER || return 1 PART=$(cat $ANSWER) done - dodialog yesno "Would you like to create and mount the filesytems like this?\n\nSyntax\n------\nDEVICE:TYPE:MOUNTPOINT:FORMAT\n\n$(for i in $(cat /tmp/.parts); do echo "$i\n";done)" 18 && PARTFINISH="DONE" + dodialog yesno "$(gettext "Would you like to create and mount the filesytems like this?")\n\nSyntax\n------\nDEVICE:TYPE:MOUNTPOINT:FORMAT\n\n$(for i in $(cat /tmp/.parts); do echo "$i\n";done)" 18 && PARTFINISH="DONE" done # disable swap and all mounted partitions - dodialog infobox "Disabling swapspace, unmounting already mounted disk devices..." + dodialog infobox "$(i18n "Disabling swapspace, unmounting already mounted disk devices...")" swapoff -a >/dev/null 2>&1 umount $(mount | grep -v "${DESTDIR} " | grep "${DESTDIR}" | sed 's|\ .*||g') >/dev/null 2>&1 umount $(mount | grep "${DESTDIR} " | sed 's|\ .*||g') >/dev/null 2>&1 @@ -660,16 +666,16 @@ mountpoints() { umount ${DESTDIR}${MP} if [ "$DOMKFS" = "yes" ]; then if [ "$FSTYPE" = "swap" ]; then - dodialog infobox "Creating swapspace on $PART, activating..." + dodialog infobox "$(i18n "Creating swapspace on %s, activating..." $PART)" else - dodialog infobox "Creating $FSTYPE on $PART, mounting to ${DESTDIR}${MP}" + dodialog infobox "$(i18n "Creating %s on %s, mounting to %s%s" $FSTYPE $PART $DESTDIR $MP)" fi _mkfs yes $PART $FSTYPE $DESTDIR $MP || return 1 else if [ "$FSTYPE" = "swap" ]; then - dodialog infobox "Activating swapspace on $PART" + dodialog infobox "$(i18n "Activating swapspace on %s" $PART)" else - dodialog infobox "Mounting $PART to ${DESTDIR}${MP}" + dodialog infobox "$(i18n "Mounting %s to %s%s" $PART $DESTDIR $MP)" fi _mkfs no $PART $FSTYPE $DESTDIR $MP || return 1 fi @@ -690,13 +696,13 @@ getsource() { SRC_READY=2 fi if [ "$MODE" = "ftp" ]; then - dodialog msgbox "Keep in mind ftp.archlinux.org is throttled.\nPlease select another mirror to get full download speed." 18 70 + dodialog msgbox "$(i18n "Keep in mind ftp.archlinux.org is throttled.\nPlease select another mirror to get full download speed.")" 18 70 # FIXME: this regex doesn't honor commenting MIRRORS=$(egrep -o '((ftp)|(http))://[^/]*' "${MIRRORLIST}" | sed 's|$| _|g') - domenu menu "Select an FTP/HTTP mirror" 14 55 7 $MIRRORS "Custom" "_" 2>$ANSWER || return 1 + domenu menu "$(i18n "Select an FTP/HTTP mirror")" 14 55 7 $MIRRORS "Custom" "_" 2>$ANSWER || return 1 local _server=$(cat $ANSWER) if [ "${_server}" = "Custom" ]; then - dodialog inputbox "Enter the full URL to core repo." 8 65 "ftp://ftp.archlinux.org/core/os/i686" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the full URL to core repo.")" 8 65 "ftp://ftp.archlinux.org/core/os/i686" 2>$ANSWER || return 1 SYNC_URL=$(cat $ANSWER) else SYNC_URL=$(egrep -o "${_server}.*" "${MIRRORLIST}" | sed 's/\$repo/core/g') @@ -712,7 +718,7 @@ prepare_pacman() { if [ "$MODE" = "cd" ]; then if [ ! -f /usr/bin/$PACMAN ]; then # Unpack and "install" pacman - dodialog infobox "Unpacking pacman" + dodialog infobox "$(i18n "Unpacking pacman")" tar zxf /src/core/pkg/pacman-*.pkg.tar.gz usr/bin/$PACMAN cd /tmp fi @@ -723,7 +729,7 @@ prepare_pacman() { ! [ -d /var/lib/pacman ] && mkdir -p /var/lib/pacman mkdir -p $DESTDIR/var/cache/pacman/pkg /var/cache/pacman >/dev/null 2>&1 rm -f /var/cache/pacman/pkg >/dev/null 2>&1 - dodialog yesno "Do you want to keep the packages in pacman cache?\nYou can delete them later by running 'pacman -Scc'" "" "" "default=no" || delpkg="yes" + dodialog yesno "$(i18n "Do you want to keep the packages in pacman cache?\nYou can delete them later by running 'pacman -Scc'")" "" "" "default=no" || delpkg="yes" if [ "$delpkg" = "yes" ]; then # set up a symlink to fool pacman so it doesn't copy all the packages to the cache ln -sf /src/core/pkg /var/cache/pacman/pkg >/dev/null 2>&1 @@ -735,7 +741,7 @@ prepare_pacman() { if [ "$MODE" = "ftp" ]; then if [ ! -f /usr/bin/$PACMAN ]; then # Download and "install" pacman - dodialog infobox "Downloading pacman" + dodialog infobox "$(i18n "Downloading pacman")" $DLPROG ${SYNC_URL}/pacman-*.pkg.tar.gz >$LOG 2>&1 || msg "Error downloading pacman! Try another server." || return 1 tar zxf pacman-*.pkg.tar.gz usr/bin/$PACMAN || msg "Error unpacking pacman binary! The tarball may be corrupt." || return 1 cd /tmp @@ -751,7 +757,7 @@ prepare_pacman() { fi export PATH=$PATH:/tmp/usr/bin - dodialog infobox "Refreshing package database..." 6 45 + dodialog infobox "$(i18n "Refreshing package database...")" 6 45 $PACMAN --sync --refresh --root $DESTDIR >$LOG 2>&1 } @@ -765,7 +771,7 @@ cleanup_pacman() { selectpkg() { if [ $SRC_READY -gt 0 -a "$MODE" = "ftp" ]; then - dodialog yesno "Would you like to select a different server?" + dodialog yesno "$(i18n "Would you like to select a different server?")" if [ $? -eq 0 ]; then getsource || return 1 fi @@ -773,7 +779,7 @@ selectpkg() { getsource || return 1 fi - dodialog msgbox "Package selection is split into two stages. First you will select package categories that contain packages you may be interested in. Then you will be presented with a full list of packages in your selected categories, allowing you to fine-tune your selection.\n\nNOTE: It is recommended that you install the BASE category from this setup, SUPPORT contains additional useful packages for networking and filesystems, DEVEL contains software building tools, LIB contains libraries which are needed by the applications." 18 70 + dodialog msgbox "$(i18n "Package selection is split into two stages. First you will select package categories that contain packages you may be interested in. Then you will be presented with a full list of packages in your selected categories, allowing you to fine-tune your selection.\n\nNOTE: It is recommended that you install the BASE category from this setup, SUPPORT contains additional useful packages for networking and filesystems, DEVEL contains software building tools, LIB contains libraries which are needed by the applications.")" 18 70 if [ "$MODE" = "cd" ]; then PKGS="/src/core/pkg/packages.txt" @@ -782,7 +788,7 @@ selectpkg() { if [ "$MODE" = "ftp" ]; then cd /tmp rm -f packages.txt - dodialog infobox "Downloading package list..." + dodialog infobox "$(i18n "Downloading package list...")" $DLPROG ${SYNC_URL}/packages.txt >$LOG 2>&1 if [ $? -gt 0 ]; then SRC_READY=0 @@ -806,9 +812,9 @@ selectpkg() { grep $category /tmp/.pkgcategory > /dev/null 2>&1 || CHKLIST="$CHKLIST $category - OFF" done fi - domenu checklist "Select Package Categories" 19 55 12 $CHKLIST 2>/tmp/.pkgcategory || return 1 + domenu checklist "$(i18n "Select Package Categories")" 19 55 12 $CHKLIST 2>/tmp/.pkgcategory || return 1 SELECTALL="no" - dodialog yesno "Select all packages by default?" && SELECTALL="yes" + dodialog yesno "$(i18n "Select all packages by default?")" && SELECTALL="yes" CHKLIST= for category in $(cat /tmp/.pkgcategory | sed 's|"||g'); do tag="OFF" @@ -819,7 +825,7 @@ selectpkg() { CHKLIST="$CHKLIST $list" tag="OFF" done - domenu checklist "Select Packages to install. Use SPACE to select." 19 60 12 $CHKLIST 2>/tmp/.pkglist || return 1 + domenu checklist "$(i18n "Select Packages to install. Use SPACE to select.")" 19 60 12 $CHKLIST 2>/tmp/.pkglist || return 1 S_SELECT=1 } @@ -897,7 +903,7 @@ installpkg() { mount -o bind /dev $DESTDIR/dev doinstall $LIST dialog --backtitle "$TITLE" --title " $result " \ - --exit-label "Continue" --textbox "/tmp/pacman.log" 18 70 + --exit-label "$(i18n "Continue")" --textbox "/tmp/pacman.log" 18 70 if [ $? -gt 0 ]; then cleanup_pacman return 1 @@ -906,11 +912,11 @@ installpkg() { fi if [ "$MODE" = "ftp" ]; then - dodialog yesno "Do you want to keep the downloaded packages? You can delete them later by running 'pacman -Scc'" || delpkg="yes" - dodialog infobox "Downloading packages. See $LOG for output." 6 55 + dodialog yesno "$(i18n "Do you want to keep the downloaded packages? You can delete them later by running 'pacman -Scc'")" || delpkg="yes" + dodialog infobox "$(i18n "Downloading packages. See %s for output." $LOG)" 6 55 $PACMAN --noconfirm --root $DESTDIR --sync --downloadonly $(echo $LIST | sed 's|"||g') >$LOG 2>&1 if [ $? -gt 0 ]; then - dodialog msgbox "One or more packages failed to download. You can try again by re-selecting Install Packages from the main menu." 12 65 + dodialog msgbox "$(i18n "One or more packages failed to download. You can try again by re-selecting Install Packages from the main menu.")" 12 65 return 1 fi # mount proc/sysfs first, so mkinitrd can use auto-detection if it wants @@ -922,7 +928,7 @@ installpkg() { mount -o bind /dev $DESTDIR/dev doinstall $LIST dialog --backtitle "$TITLE" --title " $result " \ - --exit-label "Continue" --textbox "/tmp/pacman.log" 18 70 + --exit-label "$(i18n "Continue")" --textbox "/tmp/pacman.log" 18 70 if [ $? -gt 0 ]; then cleanup_pacman return 1 @@ -979,15 +985,15 @@ dokernel() { local KERNTARG= local SRCTARG= - dialog --backtitle "$TITLE" --menu "Select a kernel you would like to use" 14 55 7 \ - "v2.6" "Kernel 2.6.x for IDE/SCSI systems" 2>$ANSWER || return 1 + dialog --backtitle "$TITLE" --menu "$(i18n "Select a kernel you would like to use")" 14 55 7 \ + "v2.6" "$(i18n "Kernel 2.6.x for IDE/SCSI systems")" 2>$ANSWER || return 1 case $(cat $ANSWER) in "v2.6") KERNTARG="kernel26" ; VMLINUZ="vmlinuz26" ;; esac if [ "$KERNTARG" != "" ]; then prepare_pacman if [ "$MODE" = "ftp" ]; then - dodialog infobox "Downloading $KERNTARG package. See $LOG for output." 6 55 + dodialog infobox "$(i18n "Downloading %s package. See %s for output." $KERNTARG $LOG)" 6 55 $PACMAN --noconfirm --root $DESTDIR --sync --downloadonly $KERNTARG >$LOG 2>&1 if [ $? -gt 0 ]; then SRC_READY=0 @@ -1013,7 +1019,7 @@ dokernel() { msg "The kernel was successfully installed. Make sure to install a bootloader before you reboot." # fallback modifications USE_HWDETECT_RESULTS="" - dodialog yesno "PRECONFIGURATION?\n-----------------\n\nDo you want to use 'hwdetect' results from Configuration dialog for /etc/mkinitcpio.d/kernel26-fallback.conf?\n\nThis ensures consistent ordering of your hard disk controllers.\n\nIt is recommended to say 'YES' here." 18 70 && USE_HWDETECT_RESULTS="yes" + dodialog yesno "$(gettext "PRECONFIGURATION")?\n-----------------\n\n$(gettext "Do you want to use 'hwdetect' results from Configuration dialog for /etc/mkinitcpio.d/kernel26-fallback.conf")?\n\n$(gettext "This ensures consistent ordering of your hard disk controllers.")\n\n$(gettext "It is recommended to say 'YES' here.")" 18 70 && USE_HWDETECT_RESULTS="yes" if [ "$USE_HWDETECT_RESULTS" = "yes" ]; then [ -n "$HWDETECTHOSTCONTROLLER" ] && sed -i -e "s/^MODULES=.*/$HWDETECTHOSTCONTROLLER/g" ${DESTDIR}/etc/mkinitcpio.d/kernel26-fallback.conf HWDETECTHOOK="$(echo $HWDETECTHOOKS | sed -e 's/autodetect\ //g')" @@ -1027,20 +1033,20 @@ dokernel() { [ -e ${DESTDIR}/lib/initcpio/install/$i ] || FALLBACK_HOOK_ERROR=1 done if [ "$FALLBACK_HOOK_ERROR" = "1" ]; then - dodialog msgbox "ERROR: Detected error in 'HOOKS=' line, please correct HOOKS= in /etc/mkinitcpio.d/kernel26-fallback.conf!" 18 70 + dodialog msgbox "$(gettext "ERROR"): $(gettext "Detected error in 'HOOKS=' line, please correct HOOKS= in /etc/mkinitcpio.d/kernel26-fallback.conf!")" 18 70 fi mount -t proc none $DESTDIR/proc mount -t sysfs none $DESTDIR/sys mount -o bind /dev $DESTDIR/dev - dodialog infobox "Rebuilding fallback image. See $LOG for output." + dodialog infobox "$(i18n "Rebuilding fallback image. See %s for output." $LOG)" chroot ${DESTDIR} /sbin/mkinitcpio -p kernel26 >$LOG 2>&1 umount $DESTDIR/proc $DESTDIR/sys $DESTDIR/dev fi if [ -d /tmp/packages ]; then DO_ADDON="" - dodialog yesno "Would you like to install your addons packages to installed system?" && DO_ADDON="yes" + dodialog yesno "$(i18n "Would you like to install your addons packages to installed system?")" && DO_ADDON="yes" if [ "$DO_ADDON" = "yes" ] ; then - dodialog infobox "Installing the addons packages..." + dodialog infobox "$(i18n "Installing the addons packages...")" $PACMAN --noconfirm -U --root ${DESTDIR} /tmp/packages/* fi fi @@ -1052,7 +1058,7 @@ donetwork() { S_DHCP= ifaces=$(ifconfig -a | egrep "Ethernet" | cut -d' ' -f1 | sed 's|$| _|g') if [ "$ifaces" = "" ]; then - dodialog yesno "Cannot find any ethernet interfaces. You probably haven't loaded\nyour network module yet. You have two options:\n\n 1) Probe for the correct module now.\n 2) Switch to another VC (ALT-F2) and load your module\n with the modprobe command, then switch back here (ALT-F1)\n and continue.\n\nIf you know which module you need, you should do Step 2 and\nselect NO below. If you don't know which module you need,\nchoose Step 1 by selecting YES below.\n\nProbe for network module?" 18 70 + dodialog yesno "$(i18n "Cannot find any ethernet interfaces. You probably haven't loaded\nyour network module yet. You have two options:\n\n 1) Probe for the correct module now.\n 2) Switch to another VC (ALT-F2) and load your module\n with the modprobe command, then switch back here (ALT-F1)\n and continue.\n\nIf you know which module you need, you should do Step 2 and\nselect NO below. If you don't know which module you need,\nchoose Step 1 by selecting YES below.\n\nProbe for network module?")" 18 70 if [ $? -eq 0 ]; then probenic if [ $? -gt 0 ]; then @@ -1066,8 +1072,8 @@ donetwork() { fi fi while [ "$INTERFACE" = "" ]; do - dodialog msgbox "Available Ethernet Interfaces:\n$(ifconfig -a | egrep "Ethernet" | sed 's# #_#g')\n\nIf your ethernet interface is not listed,\n1) Probe for the correct module now.\n2) Switch to another VC (ALT-F2) and load your module with\n the modprobe command, then switch back here (ALT-F1)\n" - dialog --backtitle "$TITLE" --extra-button --extra-label "Probe" --ok-label "Select" --menu "Select a network interface" 14 55 7 $ifaces 2>$ANSWER + dodialog msgbox "$(gettext "Available Ethernet Interfaces"):\n$(ifconfig -a | egrep "Ethernet" | sed 's# #_#g')\n\n$(gettext "If your ethernet interface is not listed"),\n$(gettext "1) Probe for the correct module now.\n2) Switch to another VC (ALT-F2) and load your module with\n the modprobe command, then switch back here (ALT-F1)\n")" + dialog --backtitle "$TITLE" --extra-button --extra-label "$(i18n "Probe")" --ok-label "$(i18n "Select")" --menu "$(i18n "Select a network interface")" 14 55 7 $ifaces 2>$ANSWER case $? in 1) return 1 ;; 0) INTERFACE=$(cat $ANSWER) ;; @@ -1075,9 +1081,9 @@ donetwork() { esac ifaces=$(ifconfig -a | egrep "Ethernet" | cut -d' ' -f1 | sed 's|$| _|g') done - dodialog yesno "Do you want to use DHCP?" + dodialog yesno "$(i18n "Do you want to use DHCP?")" if [ $? -eq 0 ]; then - dodialog infobox "Please wait. Polling for DHCP server on $INTERFACE..." + dodialog infobox "$(i18n "Please wait. Polling for DHCP server on %s..." $INTERFACE)" dhcpcd $INTERFACE >$LOG 2>&1 || msg "Failed to run dhcpcd." || return 1 sleep 10 if [ ! $(ifconfig $INTERFACE | grep 'inet addr:') ]; then @@ -1087,21 +1093,21 @@ donetwork() { else NETPARAMETERS="" while [ "$NETPARAMETERS" = "" ]; do - dodialog inputbox "Enter your IP address" 8 65 "192.168.0.2" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter your IP address")" 8 65 "192.168.0.2" 2>$ANSWER || return 1 IPADDR=$(cat $ANSWER) - dodialog inputbox "Enter your netmask" 8 65 "255.255.255.0" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter your netmask")" 8 65 "255.255.255.0" 2>$ANSWER || return 1 SUBNET=$(cat $ANSWER) - dodialog inputbox "Enter your broadcast" 8 65 "192.168.0.255" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter your broadcast")" 8 65 "192.168.0.255" 2>$ANSWER || return 1 BROADCAST=$(cat $ANSWER) - dodialog inputbox "Enter your gateway (optional)" 8 65 "192.168.0.1" 8 65 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter your gateway (optional)")" 8 65 "192.168.0.1" 8 65 2>$ANSWER || return 1 GW=$(cat $ANSWER) - dodialog inputbox "Enter your DNS server IP" 8 65 "192.168.0.1" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter your DNS server IP")" 8 65 "192.168.0.1" 2>$ANSWER || return 1 DNS=$(cat $ANSWER) - dodialog inputbox "Enter your HTTP proxy server, for example:\nhttp://name:port\nhttp://ip:port\nhttp://username:password@ip:port\n\n Leave the field empty if no proxy is needed to install." 16 65 "" 2>$ANSWER || return 1 + dodialog inputbox "$(gettext "Enter your HTTP proxy server, for example"):\nhttp://name:port\nhttp://ip:port\nhttp://username:password@ip:port\n\n $(gettext "Leave the field empty if no proxy is needed to install.")" 16 65 "" 2>$ANSWER || return 1 PROXY_HTTP=$(cat $ANSWER) - dodialog inputbox "Enter your FTP proxy server, for example:\nhttp://name:port\nhttp://ip:port\nhttp://username:password@ip:port\n\n Leave the field empty if no proxy is needed to install." 16 65 "" 2>$ANSWER || return 1 + dodialog inputbox "$(gettext "Enter your FTP proxy server, for example"):\nhttp://name:port\nhttp://ip:port\nhttp://username:password@ip:port\n\n $(gettext "Leave the field empty if no proxy is needed to install.")" 16 65 "" 2>$ANSWER || return 1 PROXY_FTP=$(cat $ANSWER) - dodialog yesno "Are these settings correct?\n\nIP address: $IPADDR\nNetmask: $SUBNET\nGateway (optional): $GW\nDNS server: $DNS\nHTTP proxy server: $PROXY_HTTP\nFTP proxy server: $PROXY_FTP" + dodialog yesno "$(gettext "Are these settings correct?")\n\nIP address: $IPADDR\nNetmask: $SUBNET\nGateway ($(gettext "optional")): $GW\nDNS server: $DNS\nHTTP proxy server: $PROXY_HTTP\nFTP proxy server: $PROXY_FTP" case $? in 1) ;; 0) NETPARAMETERS="1" ;; @@ -1130,7 +1136,7 @@ donetwork() { probenic() { workdir="$PWD" - dodialog infobox "Looking for a matching ethernet module. Please wait..." + dodialog infobox "$(i18n "Looking for a matching ethernet module. Please wait...")" printk off cd /lib/modules/$(uname -r)/kernel/drivers/net @@ -1159,7 +1165,7 @@ probenic() { dolilo() { if [ ! -f $DESTDIR/etc/lilo.conf ]; then - msg "Error: Couldn't find $DESTDIR/etc/lilo.conf. Is LILO installed?" + msg "Error: Couldn't find %s/etc/lilo.conf. Is LILO installed?" $DESTDIR return 1 fi # Try to auto-configure LILO... @@ -1179,19 +1185,19 @@ dolilo() { msg "No hard drives were found" return 1 fi - domenu menu "Select the boot device where the LILO bootloader will be installed (usually the MBR)" 14 55 7 $DEVS 2>$ANSWER || return 1 + domenu menu "$(i18n "Select the boot device where the LILO bootloader will be installed (usually the MBR)")" 14 55 7 $DEVS 2>$ANSWER || return 1 ROOTDEV=$(cat $ANSWER) sed -i "s|boot=.*$|boot=$ROOTDEV|g" $DESTDIR/etc/lilo.conf msg "Before installing LILO, you must review the configuration file. You will now be put into the editor. After you save your changes and exit the editor, LILO will be installed." [ "$EDITOR" ] || geteditor $EDITOR ${DESTDIR}/etc/lilo.conf - dodialog infobox "Installing the LILO bootloader..." + dodialog infobox "$(i18n "Installing the LILO bootloader...")" mount -t proc none $DESTDIR/proc mount -o bind /dev $DESTDIR/dev chroot $DESTDIR /sbin/lilo >$LOG 2>&1 if [ $? -gt 0 ]; then umount $DESTDIR/dev $DESTDIR/proc - msg "Error installing LILO. (see $LOG for output)" + msg "Error installing LILO. (see %s for output)" $LOG return 1 fi umount $DESTDIR/dev $DESTDIR/proc @@ -1202,7 +1208,7 @@ dolilo() { dogrub() { get_grub_map if [ ! -f $DESTDIR/boot/grub/menu.lst ]; then - msg "Error: Couldn't find $DESTDIR/boot/grub/menu.lst. Is GRUB installed?" + msg "Error: Couldn't find %s/boot/grub/menu.lst. Is GRUB installed?" $DESTDIR return 1 fi # try to auto-configure GRUB... @@ -1262,9 +1268,9 @@ dogrub() { msg "No hard drives were found" return 1 fi - domenu menu "Select the boot device where the GRUB bootloader will be installed (usually the MBR)" 14 55 7 $DEVS 2>$ANSWER || return 1 + domenu menu "$(i18n "Select the boot device where the GRUB bootloader will be installed (usually the MBR)")" 14 55 7 $DEVS 2>$ANSWER || return 1 ROOTDEV=$(cat $ANSWER) - dodialog infobox "Installing the GRUB bootloader..." + dodialog infobox "$(i18n "Installing the GRUB bootloader...")" cp -a $DESTDIR/usr/lib/grub/i386-pc/* $DESTDIR/boot/grub/ sync # freeze xfs filesystems to enable grub installation on xfs filesystems @@ -1276,21 +1282,21 @@ dogrub() { bootpart=$(mount | grep $DESTDIR/boot | cut -d' ' -f 1) if [ "$bootpart" = "" ]; then if [ "$PART_ROOT" = "" ]; then - dodialog inputbox "Enter the full path to your root device" 8 65 "/dev/sda3" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the full path to your root device")" 8 65 "/dev/sda3" 2>$ANSWER || return 1 bootpart=$(cat $ANSWER) else bootpart=$PART_ROOT fi fi - dodialog yesno "Do you have your system installed on software raid?\nAnswer 'YES' to install grub to another hard disk." "" "" "default=no" + dodialog yesno "$(i18n "Do you have your system installed on software raid?\nAnswer 'YES' to install grub to another hard disk.")" "" "" "default=no" if [ $? -eq 0 ]; then - domenu menu "Please select the boot partition device, this cannot be autodetected!\nPlease redo grub installation for all partitions you need it!" 14 55 7 $DEVS 2>$ANSWER || return 1 + domenu menu "$(i18n "Please select the boot partition device, this cannot be autodetected!\nPlease redo grub installation for all partitions you need it!")" 14 55 7 $DEVS 2>$ANSWER || return 1 bootpart=$(cat $ANSWER) fi bootpart=$(mapdev $bootpart) bootdev=$(mapdev $ROOTDEV) if [ "$bootpart" = "" ]; then - msg "Error: Missing/Invalid root device: $bootpart" + msg "Error: Missing/Invalid root device: %s" $bootpart return 1 fi $DESTDIR/sbin/grub --no-floppy --batch >/tmp/grub.log 2>&1 </dev/null; then - msg "Error installing GRUB. (see $LOG for output)" + msg "Error installing GRUB. (see %s for output)" $LOG return 1 fi msg "GRUB was successfully installed." @@ -1320,24 +1326,24 @@ mainmenu() { DEFAULT="" fi if [ "$MODE" = "ftp" ]; then - dialog $DEFAULT --backtitle "$TITLE" --title " MAIN MENU " \ - --menu "Use the UP and DOWN arrows to navigate menus. Use TAB to switch between buttons and ENTER to select." 15 55 8 \ - "0" "Configure Network" \ - "1" "Prepare Hard Drive" \ - "2" "Select Packages" \ - "3" "Install Packages" \ - "4" "Configure System" \ - "5" "Install Bootloader" \ - "6" "Exit Install" 2>$ANSWER + dialog $DEFAULT --backtitle "$TITLE" --title " $(i18n "MAIN MENU") " \ + --menu "$(i18n "Use the UP and DOWN arrows to navigate menus. Use TAB to switch between buttons and ENTER to select.")" 15 55 8 \ + "0" "$(i18n "Configure Network")" \ + "1" "$(i18n "Prepare Hard Drive")" \ + "2" "$(i18n "Select Packages")" \ + "3" "$(i18n "Install Packages")" \ + "4" "$(i18n "Configure System")" \ + "5" "$(i18n "Install Bootloader")" \ + "6" "$(i18n "Exit Install")" 2>$ANSWER else - dialog $DEFAULT --backtitle "$TITLE" --title " MAIN MENU " \ - --menu "Use the UP and DOWN arrows to navigate menus. Use TAB to switch between buttons and ENTER to select." 15 55 8 \ - "1" "Prepare Hard Drive" \ - "2" "Select Packages" \ - "3" "Install Packages" \ - "4" "Configure System" \ - "5" "Install Bootloader" \ - "6" "Exit Install" 2>$ANSWER + dialog $DEFAULT --backtitle "$TITLE" --title " $(i18n "MAIN MENU") " \ + --menu "$(i18n "Use the UP and DOWN arrows to navigate menus. Use TAB to switch between buttons and ENTER to select.")" 15 55 8 \ + "1" "$(i18n "Prepare Hard Drive")" \ + "2" "$(i18n "Select Packages")" \ + "3" "$(i18n "Install Packages")" \ + "4" "$(i18n "Configure System")" \ + "5" "$(i18n "Install Bootloader")" \ + "6" "$(i18n "Exit Install")" 2>$ANSWER fi NEXTITEM="$(cat $ANSWER)" case $(cat $ANSWER) in @@ -1355,17 +1361,17 @@ mainmenu() { DEFAULT="" fi dialog $DEFAULT --backtitle "$TITLE" --menu "Prepare Hard Drive" 12 60 5 \ - "1" "Auto-Prepare (erases the ENTIRE hard drive)" \ - "2" "Partition Hard Drives" \ - "3" "Set Filesystem Mountpoints" \ - "4" "Return to Main Menu" 2>$ANSWER + "1" "$(i18n "Auto-Prepare (erases the ENTIRE hard drive)")" \ + "2" "$(i18n "Partition Hard Drives")" \ + "3" "$(i18n "Set Filesystem Mountpoints")" \ + "4" "$(i18n "Return to Main Menu")" 2>$ANSWER NEXTITEM="$(cat $ANSWER)" case $(cat $ANSWER) in "1") DISCS=$(finddisks) if [ $(echo $DISCS | wc -w) -gt 1 ]; then - dodialog msgbox "Available Disks:\n\n$(for i in $(finddisks); do dmesg | grep $(echo $i | sed 's#/dev/##g') | grep sectors | sort -u | cut -d')' -f1 |sed -e 's/ /|/g' -e 's/SCSI|device|//g' -e 's/(//g'; done)\n" - domenu menu "Select the hard drive to use" 14 55 7 $(finddisks _) 2>$ANSWER || return 1 + dodialog msgbox "$(gettext "Available Disks"):\n\n$(for i in $(finddisks); do dmesg | grep $(echo $i | sed 's#/dev/##g') | grep sectors | sort -u | cut -d')' -f1 |sed -e 's/ /|/g' -e 's/SCSI|device|//g' -e 's/(//g'; done)\n" + domenu menu "$(i18n "Select the hard drive to use")" 14 55 7 $(finddisks _) 2>$ANSWER || return 1 DISC=$(cat $ANSWER) else DISC=$DISCS @@ -1382,13 +1388,13 @@ mainmenu() { [ "$(which mkfs.xfs 2>/dev/null)" ] && FSOPTS="$FSOPTS xfs XFS" [ "$(which mkfs.jfs 2>/dev/null)" ] && FSOPTS="$FSOPTS jfs JFS" while [ "$BOOT_PART_SET" = "" ]; do - dodialog inputbox "Enter the size (MegaByte/MB) of your /boot partition,\n(minimum value is 16).\n\nDisk space left: $DISC_SIZE (MegaByte/MB)" 8 65 "32" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the size (MegaByte/MB) of your %s partition" "/boot"),\n($(i18n "minimum value is") 16).\n\n$(i18n "Disk space left"): $DISC_SIZE ($(i18n "MegaByte/MB"))" 8 65 "32" 2>$ANSWER || return 1 BOOT_PART_SIZE="$(cat $ANSWER)" if [ "$BOOT_PART_SIZE" = "" ]; then - dodialog msgbox "ERROR: You have entered a wrong size, please enter again." + dodialog msgbox "$(i18n "ERROR"): $(i18n "You have entered a wrong size, please enter again.")" else if [ "$BOOT_PART_SIZE" -ge "$DISC_SIZE" -o "$BOOT_PART_SIZE" -lt "16" -o "$SBOOT_PART_SIZE" = "$DISC_SIZE" ]; then - dodialog msgbox "ERROR: You have entered a wrong size, please enter again." + dodialog msgbox "$(i18n "ERROR"): $(i18n "You have entered a wrong size, please enter again.")" else BOOT_PART_SET=1 fi @@ -1396,13 +1402,13 @@ mainmenu() { done DISC_SIZE=$(($DISC_SIZE-$BOOT_PART_SIZE)) while [ "$SWAP_PART_SET" = "" ]; do - dodialog inputbox "Enter the size (MegaByte/MB) of your swap partition,\n(minimum value is > 0).\n\nDisk space left: $DISC_SIZE (MegaByte/MB)" 8 65 "256" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the size (MegaByte/MB) of your %s partition" "swap"),\n($(i18n "minimum value is") > 0).\n\n$(i18n "Disk space left"): $DISC_SIZE ($(i18n "MegaByte/MB"))" 8 65 "256" 2>$ANSWER || return 1 SWAP_PART_SIZE=$(cat $ANSWER) if [ "$SWAP_PART_SIZE" = "" -o "$SWAP_PART_SIZE" = "0" ]; then - dodialog msgbox "ERROR: You have entered a wrong size, please enter again." + dodialog msgbox "$(i18n "ERROR"): $(i18n "You have entered a wrong size, please enter again.")" else if [ "$SWAP_PART_SIZE" -ge "$DISC_SIZE" ]; then - dodialog msgbox "ERROR: You have entered a wrong size, please enter again." + dodialog msgbox "$(i18n "ERROR"): $(i18n "You have entered a wrong size, please enter again.")" else SWAP_PART_SET=1 fi @@ -1410,27 +1416,27 @@ mainmenu() { done DISC_SIZE=$(($DISC_SIZE-$SWAP_PART_SIZE)) while [ "$ROOT_PART_SET" = "" ]; do - dodialog inputbox "Enter the size (MegaByte/MB) of your / partition,\nthe /home partition will take all the left space.\n\nDisk space left: $DISC_SIZE (MegaByte/MB)" 8 65 "7500" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the size (MegaByte/MB) of your %s partition" "/"),\n$(gettext "the /home partition will take all the left space.")\n\n$(i18n "Disk space left"): $DISC_SIZE ($(i18n "MegaByte/MB"))" 8 65 "7500" 2>$ANSWER || return 1 ROOT_PART_SIZE=$(cat $ANSWER) if [ "$ROOT_PART_SIZE" = "" -o "$ROOT_PART_SIZE" = "0" ]; then - dodialog msgbox "ERROR: You have entered a wrong size, please enter again." + dodialog msgbox "$(i18n "ERROR"): $(i18n "You have entered a wrong size, please enter again.")" else if [ "$ROOT_PART_SIZE" -ge "$DISC_SIZE" ]; then - dodialog msgbox "ERROR: You have entered a wrong size, please enter again." + dodialog msgbox "$(i18n "ERROR"): $(i18n "You have entered a wrong size, please enter again.")" else - dodialog yesno "$(($DISC_SIZE-$ROOT_PART_SIZE)) (MegaByte/MB) will be used for your /home partition?" "" "" && ROOT_PART_SET=1 + dodialog yesno "$(($DISC_SIZE-$ROOT_PART_SIZE)) ($(i18n "MegaByte/MB")) $(i18n "will be used for your /home partition?")" "" "" && ROOT_PART_SET=1 fi fi done while [ "$CHOSEN_FS" = "" ]; do - domenu menu "Select a filesystem for / and /home" 13 45 6 $FSOPTS 2>$ANSWER || return 1 + domenu menu "$(i18n "Select a filesystem for / and /home")" 13 45 6 $FSOPTS 2>$ANSWER || return 1 FSTYPE=$(cat $ANSWER) - dodialog yesno "$FSTYPE will be used for / and /home?" "" "" && CHOSEN_FS=1 + dodialog yesno "$FSTYPE $(i18n "will be used for / and /home?")" "" "" && CHOSEN_FS=1 done SET_DEFAULTFS=1 done REAL_DEFAULTFS=$(echo $DEFAULTFS | sed -e "s|/:7500:ext3|/:$ROOT_PART_SIZE:$FSTYPE|g" -e "s|/home:\*:ext3|/home:\*:$FSTYPE|g" -e "s|swap:256|swap:$SWAP_PART_SIZE|g" -e "s|/boot:32|/boot:$BOOT_PART_SIZE|g") - dodialog yesno "$DISC will be COMPLETELY ERASED! Are you absolutely sure?" "" "" "default=no" \ + dodialog yesno "$(i18n "%s will be COMPLETELY ERASED! Are you absolutely sure?" $DISC)" "" "" "default=no" \ && mksimplefs $DISC "$REAL_DEFAULTFS" ;; "2") partition ;; @@ -1450,32 +1456,32 @@ mainmenu() { HWDETECT="" HWPARAMETER="" DSDT_ENABLE="" - dodialog yesno "PRECONFIGURATION?\n-----------------\n\nDo you want to use 'hwdetect' for:\n'/etc/rc.conf' and '/etc/mkinitcpio.conf'?\n\nThis ensures consistent ordering of your hard disk controllers,\nnetwork and sound devices.\n\nIt is recommended to say 'YES' here." 18 70 && HWDETECT="yes" + dodialog yesno "$(i18n "PRECONFIGURATION")?\n-----------------\n\n$(i18n "Do you want to use 'hwdetect' for"):\n'/etc/rc.conf' $(i18n "and") '/etc/mkinitcpio.conf'?\n\n$(i18n "This ensures consistent ordering of your hard disk controllers,\n network and sound devices.")\n\n$(i18n "It is recommended to say 'YES' here.")" 18 70 && HWDETECT="yes" if [ "$HWDETECT" = "yes" ]; then if /usr/bin/vmware-detect; then HWPARAMETER="$HWPARAMETER --vmware" fi grep -qw ide-legacy /proc/cmdline && HWPARAMETER="$HWPARAMETER --ide-legacy" - dodialog yesno "Do you need support for booting from usb devices?" "" "" default=no && HWPARAMETER="$HWPARAMETER --usb" - dodialog yesno "Do you need support for booting from firewire devices?" "" "" default=no && HWPARAMETER="$HWPARAMETER --fw" - dodialog yesno "Do you need support for booting from pcmcia devices?" "" "" default=no && HWPARAMETER="$HWPARAMETER --pcmcia" - dodialog yesno "Do you need support for booting from nfs shares?" "" "" default=no && HWPARAMETER="$HWPARAMETER --nfs" - dodialog yesno "Do you need support for booting from software raid arrays?" "" "" default=no && HWPARAMETER="$HWPARAMETER --raid" + dodialog yesno "$(i18n "Do you need support for booting from %s devices?" "usb")" "" "" default=no && HWPARAMETER="$HWPARAMETER --usb" + dodialog yesno "$(i18n "Do you need support for booting from %s devices?" "firewire")" "" "" default=no && HWPARAMETER="$HWPARAMETER --fw" + dodialog yesno "$(i18n "Do you need support for booting from %s devices?" "pcmcia")" "" "" default=no && HWPARAMETER="$HWPARAMETER --pcmcia" + dodialog yesno "$(i18n "Do you need support for booting from nfs shares?")" "" "" default=no && HWPARAMETER="$HWPARAMETER --nfs" + dodialog yesno "$(i18n "Do you need support for booting from software raid arrays?")" "" "" default=no && HWPARAMETER="$HWPARAMETER --raid" if [ -e $DESTDIR/lib/initcpio/hooks/raid-partitions ]; then - dodialog yesno "Do you need support for booting from software raid mdp/partition arrays?" "" "" default=no && HWPARAMETER="$HWPARAMETER --raid-partitions" + dodialog yesno "$(i18n "Do you need support for booting from software raid mdp/partition arrays?")" "" "" default=no && HWPARAMETER="$HWPARAMETER --raid-partitions" fi - dodialog yesno "Do you need support for booting from lvm2 volumes?" "" "" default=no && HWPARAMETER="$HWPARAMETER --lvm2" - dodialog yesno "Do you need support for booting from encrypted volumes?" "" "" default=no && HWPARAMETER="$HWPARAMETER --encrypt" - dodialog yesno "Do you need support for booting the kernel with a custom DSDT file?" "" "" default=no && DSDT_ENABLE=1 + dodialog yesno "$(i18n "Do you need support for booting from lvm2 volumes?")" "" "" default=no && HWPARAMETER="$HWPARAMETER --lvm2" + dodialog yesno "$(i18n "Do you need support for booting from encrypted volumes?")" "" "" default=no && HWPARAMETER="$HWPARAMETER --encrypt" + dodialog yesno "$(i18n "Do you need support for booting the kernel with a custom DSDT file?")" "" "" default=no && DSDT_ENABLE=1 if [ "$DSDT_ENABLE" = "1" ]; then while [ "$DSDT" = "" ]; do - dodialog inputbox "Enter the custom DSDT file (with full path)" 8 65 "" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the custom DSDT file (with full path)")" 8 65 "" 2>$ANSWER || return 1 DSDT=$(cat $ANSWER) if [ -s "$DSDT" ]; then cp $DSDT $DESTDIR/lib/initcpio/custom.dsdt HWPARAMETER="$HWPARAMETER --dsdt" else - dodialog msgbox "ERROR: You have entered a wrong file name, please enter again." + dodialog msgbox "$(i18n "ERROR"): $(i18n "You have entered a wrong file name, please enter again.")" DSDT="" fi done @@ -1501,13 +1507,13 @@ mainmenu() { #fi fi if [ -s /tmp/.keymap ]; then - dodialog yesno "Do you want to use the keymap: $(cat /tmp/.keymap | sed -e 's/\..*//g') in rc.conf?" "" "" && sed -i -e "s/^KEYMAP=.*/KEYMAP=\"$(cat /tmp/.keymap | sed -e 's/\..*//g')\"/g" ${DESTDIR}/etc/rc.conf + dodialog yesno "$(i18n "Do you want to use the keymap"): $(cat /tmp/.keymap | sed -e 's/\..*//g') $(i18n "in %s" "rc.conf")?" "" "" && sed -i -e "s/^KEYMAP=.*/KEYMAP=\"$(cat /tmp/.keymap | sed -e 's/\..*//g')\"/g" ${DESTDIR}/etc/rc.conf fi if [ -s /tmp/.font ]; then - dodialog yesno "Do you want to use the consolefont: $(cat /tmp/.font | sed -e 's/\..*//g') in rc.conf?" "" "" && sed -i -e "s/^CONSOLEFONT=.*/CONSOLEFONT=\"$(cat /tmp/.font | sed -e 's/\..*//g')\"/g" ${DESTDIR}/etc/rc.conf + dodialog yesno "$(i18n "Do you want to use the consolefont"): $(cat /tmp/.font | sed -e 's/\..*//g') $(i18n "in %s" "rc.conf")?" "" "" && sed -i -e "s/^CONSOLEFONT=.*/CONSOLEFONT=\"$(cat /tmp/.font | sed -e 's/\..*//g')\"/g" ${DESTDIR}/etc/rc.conf fi if [ "$S_NET" = "1" ]; then - dodialog yesno "Do you want to use the previous network settings in rc.conf and resolv.conf?\nIf you used Proxy settings, they will be written to /etc/profile.d/proxy" "" "" && ( + dodialog yesno "$(i18n "Do you want to use the previous network settings in rc.conf and resolv.conf?\nIf you used Proxy settings, they will be written to /etc/profile.d/proxy")" "" "" && ( if [ "$S_DHCP" != "1" ]; then sed -i -e "s#eth0=\"eth0#$INTERFACE=\"$INTERFACE#g" ${DESTDIR}/etc/rc.conf sed -i -e "s# 192.168.0.2 # $IPADDR #g" ${DESTDIR}/etc/rc.conf @@ -1538,19 +1544,19 @@ mainmenu() { else DEFAULT="" fi - dialog $DEFAULT --backtitle "$TITLE" --menu "Configuration" 17 80 10 \ - "/etc/rc.conf" "System Config" \ - "/etc/fstab" "Filesystem Mountpoints" \ - "/etc/mkinitcpio.conf" "Initramfs Config" \ - "/etc/modprobe.conf" "Kernel Modules (for 2.6.x)" \ - "/etc/resolv.conf" "DNS Servers" \ - "/etc/hosts" "Network Hosts" \ - "/etc/hosts.deny" "Denied Network Services" \ - "/etc/hosts.allow" "Allowed Network Services" \ - "/etc/locale.gen" "Glibc Locales" \ - "Root-Password" "Set the root password" \ - "Pacman-Mirror" "Set the primary pacman mirror" \ - "_" "Return to Main Menu" 2>$ANSWER + dialog $DEFAULT --backtitle "$TITLE" --menu "$(i18n "Configuration")" 17 80 10 \ + "/etc/rc.conf" "$(i18n "System Config")" \ + "/etc/fstab" "$(i18n "Filesystem Mountpoints")" \ + "/etc/mkinitcpio.conf" "$(i18n "Initramfs Config")" \ + "/etc/modprobe.conf" "$(i18n "Kernel Modules (for 2.6.x)")" \ + "/etc/resolv.conf" "$(i18n "DNS Servers")" \ + "/etc/hosts" "$(i18n "Network Hosts")" \ + "/etc/hosts.deny" "$(i18n "Denied Network Services")" \ + "/etc/hosts.allow" "$(i18n "Allowed Network Services")" \ + "/etc/locale.gen" "$(i18n "Glibc Locales")" \ + "Root-Password" "$(i18n "Set the root password")" \ + "Pacman-Mirror" "$(i18n "Set the primary pacman mirror")" \ + "_" "$(i18n "Return to Main Menu")" 2>$ANSWER FILE=$(cat $ANSWER) if [ "$FILE" = "_" -o "$FILE" = "" ]; then @@ -1574,7 +1580,7 @@ mainmenu() { DONE=1 else if [ "$FILE" = "/etc/mkinitcpio.conf" ]; then - dodialog msgbox "The mkinitcpio.conf file controls which modules will be placed into the initramfs for your system's kernel.\n\n- Non US keymap users should add 'keymap' to HOOKS= array\n- USB keyboard users should add 'usbinput' to HOOKS= array\n- If you install under VMWARE add 'BusLogic' to MODULES= array\n- raid, lvm2, encrypt are not enabled by default\n- 2 or more disk controllers, please specify the correct module\n loading order in MODULES= array \n\nMost of you will not need to change anything in this file." 18 70 + dodialog msgbox "$(i18n "The mkinitcpio.conf file controls which modules will be placed into the initramfs for your system's kernel.\n\n- Non US keymap users should add 'keymap' to HOOKS= array\n- USB keyboard users should add 'usbinput' to HOOKS= array\n- If you install under VMWARE add 'BusLogic' to MODULES= array\n- raid, lvm2, encrypt are not enabled by default\n- 2 or more disk controllers, please specify the correct module\n loading order in MODULES= array \n\nMost of you will not need to change anything in this file.")" 18 70 HOOK_ERROR="" fi #if [ "$FILE" = "/etc/mkinitcpio.d/kernel26-fallback.conf" ]; then @@ -1598,23 +1604,23 @@ mainmenu() { else SAMEMIRROR="" if [ "$MODE" = "ftp" -a "${SYNC_URL}" != "" ]; then - dodialog yesno "Would you like to use the same MIRROR you used for installation?" && SAMEMIRROR="yes" + dodialog yesno "$(i18n "Would you like to use the same MIRROR you used for installation?")" && SAMEMIRROR="yes" fi for i in ${DESTDIR}/etc/pacman.d/*; do sed -i -e 's/^#Server/Server/g' $i done if ! [ "$SAMEMIRROR" = "yes" ]; then - dodialog msgbox "WARNING:\n\n- Please keep in mind ftp.archlinux.org is throttled!\n- Please select another mirror to get full download speed." 18 70 + dodialog msgbox "$(i18n "WARNING"):\n\n- $(i18n "Please keep in mind ftp.archlinux.org is throttled!\n- Please select another mirror to get full download speed.")" 18 70 PAC_MIRRORS=$(cat ${DESTDIR}/etc/pacman.d/mirrorlist | cut -d' ' -f3 | grep ^[a-z] | cut -d'/' --fields="1 2 3" | sed 's|$| _|g') - domenu menu "Select the primary Pacman mirror" 14 55 7 $PAC_MIRRORS "Custom" "_" 2>$ANSWER || return 1 + domenu menu "$(i18n "Select the primary Pacman mirror")" 14 55 7 $PAC_MIRRORS "Custom" "_" 2>$ANSWER || return 1 PAC_SYNC_SERVER=$(cat $ANSWER) if [ "$PAC_SYNC_SERVER" = "Custom" ]; then - dodialog inputbox "Enter the server hostname/ip" 8 65 "ftp://ftp.server.org" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the server hostname/ip")" 8 65 "ftp://ftp.server.org" 2>$ANSWER || return 1 PAC_SYNC_SERVER=$(cat $ANSWER) if [ "$(uname -m)" = "x86_64" ]; then - dodialog inputbox "Enter the path to Arch Linux packages" 8 65 "/core/os/x86_64" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the path to Arch Linux packages")" 8 65 "/core/os/x86_64" 2>$ANSWER || return 1 else - dodialog inputbox "Enter the path to Arch Linux packages" 8 65 "/core/os/i686" 2>$ANSWER || return 1 + dodialog inputbox "$(i18n "Enter the path to Arch Linux packages")" 8 65 "/core/os/i686" 2>$ANSWER || return 1 fi PAC_SYNC_SERVER=$PAC_SYNC_SERVER$(cat $ANSWER) for i in ${DESTDIR}/etc/pacman.d/*; do @@ -1651,7 +1657,7 @@ mainmenu() { [ -e ${DESTDIR}/lib/initcpio/install/$i ] || HOOK_ERROR=1 done if [ "$HOOK_ERROR" = "1" ]; then - dodialog msgbox "ERROR: Detected error in 'HOOKS=' line, please correct HOOKS= in /etc/mkinitcpio.conf!" 18 70 + dodialog msgbox "$(i18n "ERROR"): $(i18n "Detected error in 'HOOKS=' line, please correct HOOKS= in /etc/mkinitcpio.conf!")" 18 70 fi fi #if [ "$FILE" = "/etc/mkinitcpio.d/kernel26-fallback.conf" ]; then @@ -1702,10 +1708,10 @@ mainmenu() { #"5") #dokernel ;; "5") - dialog --backtitle "$TITLE" --menu "Which bootloader would you like to use? Grub is the Arch default.\n\n" \ + dialog --backtitle "$TITLE" --menu "$(i18n "Which bootloader would you like to use? Grub is the Arch default.")\n\n" \ 10 55 2 \ - "GRUB" "Use the GRUB bootloader (default)" \ - "LILO" "Use the LILO bootloader" 2>$ANSWER + "GRUB" "$(i18n "Use the GRUB bootloader (default)")" \ + "LILO" "$(i18n "Use the LILO bootloader")" 2>$ANSWER case $(cat $ANSWER) in "GRUB") dogrub ;; "LILO") dolilo ;; @@ -1722,9 +1728,9 @@ mainmenu() { esac } -dodialog msgbox "Welcome to the Arch Linux Installation program. The install process is fairly straightforward, and you should run through the options in the order they are presented. If you are unfamiliar with partitioning/making filesystems, you may want to consult some documentation before continuing. You can view all output from commands by viewing your VC5 console (ALT-F5). ALT-F1 will bring you back here." 14 65 +dodialog msgbox "$(i18n "Welcome to the Arch Linux Installation program. The install process is fairly straightforward, and you should run through the options in the order they are presented. If you are unfamiliar with partitioning/making filesystems, you may want to consult some documentation before continuing. You can view all output from commands by viewing your VC5 console (ALT-F5). ALT-F1 will bring you back here.")" 14 65 -dialog --backtitle "$TITLE" --menu "Please select an installation source" 10 35 3 \ +dialog --backtitle "$TITLE" --menu "$(i18n "Please select an installation source")" 10 35 3 \ "1" "CD-ROM or OTHER SOURCE" \ "2" "FTP/HTTP" 2>$ANSWER || abort @@ -1738,10 +1744,10 @@ case $(cat $ANSWER) in esac if [ "$MODE" = "cd" ]; then - TITLE="Arch Linux CDROM or OTHER SOURCE Installation" + TITLE="$(i18n "Arch Linux CDROM or OTHER SOURCE Installation")" else - TITLE="Arch Linux FTP/HTTP Installation" - dodialog msgbox "If you wish to load your ethernet modules manually, please do so now (consoles 1 thru 4 are active)." 12 65 + TITLE="$(i18n "Arch Linux FTP/HTTP Installation")" + dodialog msgbox "$(i18n "If you wish to load your ethernet modules manually, please do so now (consoles 1 thru 4 are active).")" 12 65 fi loop() {