# HG changeset patch # User Eric Joseph-Alexandre # Date 1314783756 -7200 # Node ID c5c6fc9ab9eb44c53cab75d4af5eaea0db441a3b # Parent b65e12e46feb0f5df6c97dd1580ce643c877af4e Add i18n support to tazusb diff -r b65e12e46feb -r c5c6fc9ab9eb po/tazusb/fr.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/po/tazusb/fr.po Wed Aug 31 11:42:36 2011 +0200 @@ -0,0 +1,277 @@ +# +# Copyright (C) 2011 +# This file is distributed under the same license as the TazUSB package. +# Eric Joseph-Alexandre , 2011. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: TazUSB 3.0\n" +"Report-Msgid-Bugs-To: erjo@slitaz.org\n" +"POT-Creation-Date: 2011-06-07 12:18+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Eric Joseph-Alexandre \n" +"Language-Team: LANGUAGE \n" +"Language: Franch\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: tazusbbox:50 +msgid "Ok" +msgstr "" + +#: tazusb:52 +msgid "Failed" +msgstr "" + +#: tazusb:53 +msgid "ISO to USB (Optional default is CDROM)" +msgstr "" + +#: tazusb:61 +msgid "This program requires being run as root." +msgstr "" + +#: tazusb:78 +msgid "" +"Please specify the target USB device to $COMMAND. You can type 'list' to\n" +"get a list of devices, type 'exit' or give an empty value to exit.\n" +"\n" +"Device to use : " +msgstr "" + +#: tazusb:84 +msgid "Device to use : " +msgstr "" + +#: tazusb:87 +msgid "No specified device or exit." +msgstr "" + +#: tazusb:99 +msgid "Unable to find device: $DEVICE" +msgstr "" + +#: tazusb:114 +msgid "Please specify a label for the partition (TazUSB): " +msgstr "" + +#: tazusb:121 +msgid "Label : $label" +msgstr "" + +#: tazusb:122 +msgid "Mkfs : mkfs.ext3 -L \"$label\" $DEVICE" +msgstr "" + +#: tazusb:131 +msgid "Please specify a label for the partition (TazUSB): " +msgstr "" + +#: tazusb:142 +msgid "Please specify a filesystem type ext2, ext3 or fat32 (ext3): " +msgstr "" + +#: tazusb:153 +msgid "" +"Please specify the filesystem type to $COMMAND.\n" +"Available formats are ext3(default), ext2 or fat32.\n" +"Press enter to keep the default value.\n" +"\n" +"File system type : " +msgstr "" + +#: tazusb:175 +msgid "\nProcessing..." +msgstr "" + +#: tazusb:176 +msgid "Label : $label" +msgstr "" + +#: tazusb:177 +msgid "Mkfs : mkfs.$FS -L \"$label\" $DEVICE" +msgstr "" + +#: tazusb:183 +msgid "Processing..." +msgstr "" + +#: tazusb:184 +msgid "Label : $label" +msgstr "" + +#: tazusb:185 +msgid "Mkfs : mkdosfs -F 32 -n \"$label\" $DEVICE" +msgstr "" + +#: tazusb:189 +msgid "Can't find mkdosfs tool.\nWould you like to install dosfstools from repository [y/N] ? " +msgstr "" + +#: tazusb:199 +msgid "Sorry. Filesystem $FS is not supported." +msgstr "" + +#: tazusb:214 +msgid "Unmounting USB target device..." +msgstr "" + +#: tazusb:222 +msgid "Mounting USB target device..." +msgstr "" + +#: tazusb:241 +msgid "Unable to mount cdrom or to find a filesystem on it (rootfs.gz)." +msgstr "" + +#: tazusb:262 +msgid "Mounting `basename $ISO`..." +msgstr "" + +#: tazusb:267 +msgid "Unable to mount iso or to find a filesystem on it (rootfs.gz)." +msgstr "" + +#: tazusb:275 +msgid "Copying needed files from cdrom..." +msgstr "" + +#: tazusb:294 +msgid "Installing a new MBR to: $DISK" +msgstr "" + +#: tazusb:299 +msgid "No new MBR installed to: $DISK" +msgstr "" + +#: tazusb:317 +msgid "Installing bootloader: $ST" +msgstr "" + +#: tazusb:371 +msgid "Do you want to exit Tazusb or reboot system (Exit/reboot) ? " +msgstr "" + +#: tazusb:394 +msgid "Setting $DEVICE as bootable..." +msgstr "" + +#: tazusb:409 +msgid "Gen swap" +msgstr "" + +#: tazusb:411 +msgid "" +"Generate a swap file in /home/swap that will be activated on each boot to have\n" +"more memory available (Empty value to exit).\n" +"\n" +"Swap file in Mb : " +msgstr "" + +#: tazusb:417 +msgid "Empty value. Exiting..." +msgstr "" + +#: tazusb:437 +msgid "Clean" +msgstr "" + +#: tazusb:439 +msgid "Remove old rootfs.gz.unixtimestamp backup filesystems to free up disk space." +msgstr "" + +#: tazusb:443 +msgid "Do you wish to remove: `basename $file` (Yes/no/exit) ? " +msgstr "" + +#: tazusb:451 +msgid "No filesystems selected, exiting..." +msgstr "" + +#: tazusb:471 +msgid "Write filesystem" +msgstr "" + +#: tazusb:473 +msgid "" +"The command writefs will write all the current filesystem into a suitable cpio\" +"archive (rootfs.gz) usable on a bootable LiveUSB media.\n" +"\n" +"Archive compression: $COMPRESSION" +msgstr "" + +#: tazusb:483 +msgid "Do you wish to remove the sound card selection (No/yes/exit) ? " +msgstr "" + +#: tazusb:489 +msgid "Removing current sound card selection..." +msgstr "" + +#: tazusb:493 +msgid "Keeping current sound card selection..." +msgstr "" + +#: tazusb:503 +msgid "Removing current screen resolution..." +msgstr "" + +#: tazusb:506 +msgid "Keeping current screen resolution..." +msgstr "" + +#: tazusb:520 +msgid "Creating rootfs.gz with lzma compression... " +msgstr "" + +#: tazusb:524 +msgid "Creating rootfs.gz with gzip compression... " +msgstr "" + +#: tazusb:528 +msgid "Creating rootfs.gz without compression... " +msgstr "" + +#: tazusb:537 +msgid "Moving rootfs.gz to media. Remember to unmount for delayed writes!" +msgstr "" + +#: tazusb:547 +msgid "rootfs.gz is located in /" +msgstr "" + +#: tazusb:551 +msgid "Root filesystem size: $size" +msgstr "" + +#: tazusb:553 +msgid "ENTER to continue..." +msgstr "" + +#: tazusb:559 +msgid "Format a device" +msgstr "" + +#: tazusb:568 +msgid "Device : $DEVICE" +msgstr "" + +#: tazusb:576 +msgid "Device $label ($DEVICE) is ready to use as LiveUSB and/or /home partition." +msgstr "" + +#: tazusb:583 +msgid "Gen a LiveUSB media" +msgstr "" + +#: tazusb:611 +msgid "Please specify a valid filename on the command line." +msgstr "" + +#: tazusb:615 +msgid "Copy ISO file to SliTaz LiveUSB media" +msgstr "" + + diff -r b65e12e46feb -r c5c6fc9ab9eb po/tazusb/tazusb.pot --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/po/tazusb/tazusb.pot Wed Aug 31 11:42:36 2011 +0200 @@ -0,0 +1,277 @@ +# +# Copyright (C) 2011 +# This file is distributed under the same license as the TazUSB package. +# Eric Joseph-Alexandre , 2011. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: TazUSB 3.0\n" +"Report-Msgid-Bugs-To: erjo@slitaz.org\n" +"POT-Creation-Date: 2011-06-07 12:18+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Eric Joseph-Alexandre \n" +"Language-Team: LANGUAGE \n" +"Language: Franch\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: tazusbbox:50 +msgid "Ok" +msgstr "" + +#: tazusb:52 +msgid "Failed" +msgstr "" + +#: tazusb:53 +msgid "ISO to USB (Optional default is CDROM)" +msgstr "" + +#: tazusb:61 +msgid "This program requires being run as root." +msgstr "" + +#: tazusb:78 +msgid "" +"Please specify the target USB device to $COMMAND. You can type 'list' to\n" +"get a list of devices, type 'exit' or give an empty value to exit.\n" +"\n" +"Device to use : " +msgstr "" + +#: tazusb:84 +msgid "Device to use : " +msgstr "" + +#: tazusb:87 +msgid "No specified device or exit." +msgstr "" + +#: tazusb:99 +msgid "Unable to find device: $DEVICE" +msgstr "" + +#: tazusb:114 +msgid "Please specify a label for the partition (TazUSB): " +msgstr "" + +#: tazusb:121 +msgid "Label : $label" +msgstr "" + +#: tazusb:122 +msgid "Mkfs : mkfs.ext3 -L \"$label\" $DEVICE" +msgstr "" + +#: tazusb:131 +msgid "Please specify a label for the partition (TazUSB): " +msgstr "" + +#: tazusb:142 +msgid "Please specify a filesystem type ext2, ext3 or fat32 (ext3): " +msgstr "" + +#: tazusb:153 +msgid "" +"Please specify the filesystem type to $COMMAND.\n" +"Available formats are ext3(default), ext2 or fat32.\n" +"Press enter to keep the default value.\n" +"\n" +"File system type : " +msgstr "" + +#: tazusb:175 +msgid "\nProcessing..." +msgstr "" + +#: tazusb:176 +msgid "Label : $label" +msgstr "" + +#: tazusb:177 +msgid "Mkfs : mkfs.$FS -L \"$label\" $DEVICE" +msgstr "" + +#: tazusb:183 +msgid "Processing..." +msgstr "" + +#: tazusb:184 +msgid "Label : $label" +msgstr "" + +#: tazusb:185 +msgid "Mkfs : mkdosfs -F 32 -n \"$label\" $DEVICE" +msgstr "" + +#: tazusb:189 +msgid "Can't find mkdosfs tool.\nWould you like to install dosfstools from repository [y/N] ? " +msgstr "" + +#: tazusb:199 +msgid "Sorry. Filesystem $FS is not supported." +msgstr "" + +#: tazusb:214 +msgid "Unmounting USB target device..." +msgstr "" + +#: tazusb:222 +msgid "Mounting USB target device..." +msgstr "" + +#: tazusb:241 +msgid "Unable to mount cdrom or to find a filesystem on it (rootfs.gz)." +msgstr "" + +#: tazusb:262 +msgid "Mounting `basename $ISO`..." +msgstr "" + +#: tazusb:267 +msgid "Unable to mount iso or to find a filesystem on it (rootfs.gz)." +msgstr "" + +#: tazusb:275 +msgid "Copying needed files from cdrom..." +msgstr "" + +#: tazusb:294 +msgid "Installing a new MBR to: $DISK" +msgstr "" + +#: tazusb:299 +msgid "No new MBR installed to: $DISK" +msgstr "" + +#: tazusb:317 +msgid "Installing bootloader: $ST" +msgstr "" + +#: tazusb:371 +msgid "Do you want to exit Tazusb or reboot system (Exit/reboot) ? " +msgstr "" + +#: tazusb:394 +msgid "Setting $DEVICE as bootable..." +msgstr "" + +#: tazusb:409 +msgid "Gen swap" +msgstr "" + +#: tazusb:411 +msgid "" +"Generate a swap file in /home/swap that will be activated on each boot to have\n" +"more memory available (Empty value to exit).\n" +"\n" +"Swap file in Mb : " +msgstr "" + +#: tazusb:417 +msgid "Empty value. Exiting..." +msgstr "" + +#: tazusb:437 +msgid "Clean" +msgstr "" + +#: tazusb:439 +msgid "Remove old rootfs.gz.unixtimestamp backup filesystems to free up disk space." +msgstr "" + +#: tazusb:443 +msgid "Do you wish to remove: `basename $file` (Yes/no/exit) ? " +msgstr "" + +#: tazusb:451 +msgid "No filesystems selected, exiting..." +msgstr "" + +#: tazusb:471 +msgid "Write filesystem" +msgstr "" + +#: tazusb:473 +msgid "" +"The command writefs will write all the current filesystem into a suitable cpio\" +"archive (rootfs.gz) usable on a bootable LiveUSB media.\n" +"\n" +"Archive compression: $COMPRESSION" +msgstr "" + +#: tazusb:483 +msgid "Do you wish to remove the sound card selection (No/yes/exit) ? " +msgstr "" + +#: tazusb:489 +msgid "Removing current sound card selection..." +msgstr "" + +#: tazusb:493 +msgid "Keeping current sound card selection..." +msgstr "" + +#: tazusb:503 +msgid "Removing current screen resolution..." +msgstr "" + +#: tazusb:506 +msgid "Keeping current screen resolution..." +msgstr "" + +#: tazusb:520 +msgid "Creating rootfs.gz with lzma compression... " +msgstr "" + +#: tazusb:524 +msgid "Creating rootfs.gz with gzip compression... " +msgstr "" + +#: tazusb:528 +msgid "Creating rootfs.gz without compression... " +msgstr "" + +#: tazusb:537 +msgid "Moving rootfs.gz to media. Remember to unmount for delayed writes!" +msgstr "" + +#: tazusb:547 +msgid "rootfs.gz is located in /" +msgstr "" + +#: tazusb:551 +msgid "Root filesystem size: $size" +msgstr "" + +#: tazusb:553 +msgid "ENTER to continue..." +msgstr "" + +#: tazusb:559 +msgid "Format a device" +msgstr "" + +#: tazusb:568 +msgid "Device : $DEVICE" +msgstr "" + +#: tazusb:576 +msgid "Device $label ($DEVICE) is ready to use as LiveUSB and/or /home partition." +msgstr "" + +#: tazusb:583 +msgid "Gen a LiveUSB media" +msgstr "" + +#: tazusb:611 +msgid "Please specify a valid filename on the command line." +msgstr "" + +#: tazusb:615 +msgid "Copy ISO file to SliTaz LiveUSB media" +msgstr "" + + diff -r b65e12e46feb -r c5c6fc9ab9eb tazusb --- a/tazusb Sun Jun 19 18:40:36 2011 +0200 +++ b/tazusb Wed Aug 31 11:42:36 2011 +0200 @@ -5,7 +5,14 @@ # bootable media and/or USB /home partition, such as flash keys, SD card or # USB harddisk. Authors : see AUTHORS # -VERSION=3.0 +VERSION=3.0.1 + +# Include gettext helper script. +. /usr/bin/gettext.sh + +# Export package name for gettext. +TEXTDOMAIN='tazusb' +export TEXTDOMAIN COMMAND=$1 TARGET_ROOT=/media/flash @@ -20,18 +27,18 @@ # Print the usage. usage () { - echo -e "\nSliTaz Live USB - Version: $VERSION\n + echo -e "`gettext \"\nSliTaz Live USB - Version:\"` $VERSION\n \033[1mUsage: \033[0m `basename $0` [command] [compression|device] -\033[1mCommands: \033[0m\n - usage Print this short usage. - writefs Write the current filesystem to rootfs.gz. - tazSupported compression: lzma. gzip, none. - format Format and label device with ext3, ext2 or fat32 filesystem - (for LiveUSB or /home). Default is ext3. - gen-liveusb Generate a bootable LiveUSB using files from the LiveCD. - gen-swap Create or recreate and activate additional swap memory. - gen-iso2usb Generate a bootable LiveUSB using files from ISO file. - clean Remove old backup filesystems to free disk space.\n" +\033[1m`gettext \"Commands: \"`\033[0m\n + usage `gettext \"Print this short usage.\"` + writefs `gettext \"Write the current filesystem to rootfs.gz. + tazSupported compression: lzma. gzip, none.\"` + format `gettext \"Format and label device with ext3, ext2 or fat32 filesystem + (for LiveUSB or /home). Default is ext3.\"` + gen-liveusb `gettext \"Generate a bootable LiveUSB using files from the LiveCD.\"` + gen-swap `gettext \"Create or recreate and activate additional swap memory.\"` + gen-iso2usb `gettext \"Generate a bootable LiveUSB using files from ISO file.\"` + clean `gettext \"Remove old backup filesystems to free disk space.\"`\n" } # Status function. @@ -40,9 +47,9 @@ local CHECK=$? echo -en "\\033[70G[ " if [ $CHECK = 0 ]; then - echo -en "\\033[1;33mOK" + echo -en "\\033[1;33m`gettext \"OK\"`" else - echo -en "\\033[1;31mFailed" + echo -en "\\033[1;31m`gettext \"Failed\"`" fi echo -e "\\033[0;39m ]" } @@ -51,7 +58,9 @@ check_root() { if test $(id -u) != 0 ; then - echo -e "\nThis program requires being run as root.\n" + # echo -e "\nThis program requires being run as root.\n" + gettext "This program requires being run as root." + echo "" exit 0 fi } @@ -67,17 +76,19 @@ # We need a USB media to install. ask_for_device() { - echo -n "\ + gettext "\ Please specify the target USB device to $COMMAND. You can type 'list' to get a list of devices, type 'exit' or give an empty value to exit. Device to use : "; read anser while [ "$anser" == "list" ]; do fdisk_list - echo -n "Device to use : "; read anser + gettext "Device to use : "; read anser done if [ "$anser" = "" -o "$anser" = "exit" ]; then - echo -e "\nNo specified device or exit.\n" + echo "" + gettext "No specified device or exit." + echo "" exit 0 else DEVICE=$anser @@ -89,7 +100,9 @@ { IFDEV=`fdisk -l | grep $DEVICE` if [ -z "$IFDEV" ]; then - echo -e "\nUnable to find device: $DEVICE\n" + echo "" + gettext "Unable to find device: $DEVICE" + echo "" exit 0 fi } @@ -104,15 +117,15 @@ # Format target device and label partition. mkfs_ext3() { - echo -n "Please specify a label for the partition (TazUSB): " + gettext "Please specify a label for the partition (TazUSB): " read label if [ -z $label ]; then label=TazUSB fi - echo "Label : $label" - echo "Mkfs : mkfs.ext3 -L \"$label\" $DEVICE" + gettext "Label : $label"; echo "" + gettext "Mkfs : mkfs.ext3 -L \"$label\" $DEVICE" ; echo "" echo "" && sleep 2 mkfs.ext3 -L "$label" $DEVICE @@ -121,7 +134,7 @@ # Get label for device get_label() { - echo -n "Please specify a label for the partition (TazUSB): " + gettext "Please specify a label for the partition (TazUSB): " read label if [ -z $label ]; then @@ -132,7 +145,7 @@ # Get fs type. Supported fs are ext3, ext2, fat32 get_fs_type() { - echo -n "Please specify a filesystem type ext2, ext3 or fat32 (ext3): " + gettext "Please specify a filesystem type ext2, ext3 or fat32 (ext3): " read fs_type if [ -z $fs_type ]; then @@ -143,7 +156,7 @@ # We can chose the filesystem type. ask_for_fs_type() { - echo -n "\ + gettext "\ Please specify the filesystem type to $COMMAND. Available formats are ext3(default), ext2 or fat32. Press enter to keep the default value. @@ -165,21 +178,21 @@ FS=$(echo $fs_type | tr [A-Z] [a-z]) case "$FS" in ext3|ext2) - echo -e "\nProcessing..." - echo "Label : $label" - echo "Mkfs : mkfs.$FS -L \"$label\" $DEVICE" + echo ""; gettext "Processing..." ; echo "" + gettext "Label : $label" ; echo "" + gettext "Mkfs : mkfs.$FS -L \"$label\" $DEVICE" echo "" && sleep 2 mkfs.$@ -L "$label" $DEVICE > $LOG 2>&1 ;; [Ff]at32) if [ -x /sbin/mkdosfs ];then - echo -e "\nProcessing..." - echo "Label : $label" - echo "Mkfs : mkdosfs -F 32 -n \"$label\" $DEVICE" + echo "" ; gettext "Processing..."; echo "" + gettext "Label : $label" ; echo "" + gettext "Mkfs : mkdosfs -F 32 -n \"$label\" $DEVICE"; echo "" echo "" && sleep 2 mkdosfs -F 32 -n "$label" $DEVICE else - echo -ne "Can't find mkdosfs tool.\nWould you like to install dosfstools from repository [y/N] ? "; read answer + gettext "Can't find mkdosfs tool.\nWould you like to install dosfstools from repository [y/N] ? "; read answer case $answer in y|Y) yes | tazpkg get-install dosfstools && make_fs fat32;; @@ -189,7 +202,7 @@ fi ;; *) - echo "Sorry. Filesystem $FS is not supported." + gettext "Sorry. Filesystem $FS is not supported."; echo "" exit esac } @@ -204,7 +217,7 @@ # Device could be mounted elsewhere, so unmount if mount | grep -q $DEVICE; then - echo "Unmounting USB target device..." + gettext "Unmounting USB target device..."; echo "" umount $DEVICE fi } @@ -212,7 +225,7 @@ # Mount an existing USB device. mount_target_usb() { - echo "Mounting USB target device..." + gettext "Mounting USB target device..." ; echo "" mkdir -p $TARGET_ROOT mount $DEVICE $TARGET_ROOT 2>/dev/null } @@ -220,7 +233,7 @@ # Mount SliTaz LiveCD to get needed files. mount_cdrom() { - echo "Mounting cdrom device..." + gettext "Mounting cdrom device..."; echo "" if mount | grep /media/cdrom; then umount /media/cdrom @@ -231,7 +244,7 @@ if [ ! -f /media/cdrom/boot/rootfs.gz -a \ ! -f /media/cdrom/boot/rootfs1.gz ]; then - echo -e "\nUnable to mount cdrom or to find a filesystem on it (rootfs.gz).\n" + echo ""; gettext "Unable to mount cdrom or to find a filesystem on it (rootfs.gz)."; ehco "" exit 0 fi } @@ -252,12 +265,12 @@ OPTIONS="" fi - echo "Mounting `basename $ISO`..." + gettext "Mounting `basename $ISO`..."; echo "" mount $OPTIONS $ISO /media/cdrom 2>/dev/null if [ ! -f /media/cdrom/boot/rootfs.gz -a \ ! -f /media/cdrom/boot/rootfs1.gz ]; then - echo -e "\nUnable to mount iso or to find a filesystem on it (rootfs.gz).\n" + gettext "Unable to mount iso or to find a filesystem on it (rootfs.gz)."; echo "" exit 0 fi } @@ -265,7 +278,7 @@ # All needed files are in the boot directory of the cdrom. copy_cdrom_files() { - echo -n "Copying needed files from cdrom..." + gettext "Copying needed files from cdrom..." mkdir -p $TARGET_ROOT/boot cp /media/cdrom/boot/bzImage $TARGET_ROOT/boot rem=0 @@ -284,12 +297,12 @@ # MBR DISK=${DEVICE%[1-99]} if [ -f /usr/share/boot/mbr.bin ]; then - echo -n "Installing a new MBR to: $DISK" + gettext "Installing a new MBR to: $DISK" cat /usr/share/boot/mbr.bin > $DISK status else # Skip MBR install (tazpkg get-install syslinux-extra ? and then cat) - echo "No new MBR installed to: $DISK" + gettext "No new MBR installed to: $DISK"; echo "" fi } @@ -307,7 +320,7 @@ STE=conf fi - echo "Installing bootloader: $ST" + gettext "Installing bootloader: $ST"; echo "" mkdir -p $TARGET_ROOT/boot/$ST $STC @@ -361,7 +374,7 @@ { echo "===============================================================================" echo "" - echo -n "Do you want to exit Tazusb or reboot system (Exit/reboot) ? " + gettext "Do you want to exit Tazusb or reboot system (Exit/reboot) ? " read anser if [ "$anser" == "reboot" ]; then umount $TARGET_ROOT @@ -384,7 +397,7 @@ # If not set, set bootable if [ "$ISSET" == "" ]; then umount $TARGET_ROOT 2>/dev/null - echo -n "Setting $DEVICE as bootable..." + gettext "Setting $DEVICE as bootable..." fdisk $DISK >/dev/null << EOF a 1 @@ -399,15 +412,15 @@ gen_swap_file() { echo "" - echo -en "\033[1mGen swap\033[0m -=============================================================================== -Generate a swap file in /home/swap that will be activated on each boot to have + echo -en "\033[1m`gettext \"Gen swap\"`\033[0m +===============================================================================" +gettext "Generate a swap file in /home/swap that will be activated on each boot to have more memory available (Empty value to exit). Swap file in Mb : " read size if [ -z "$size" ]; then - echo -e "\nEmpty value. Exiting...\n" + gettext "Empty value. Exiting..."; echo "" exit 0 fi cd /home @@ -427,13 +440,13 @@ clean_usb() { echo "" - echo -en "\033[1mClean\033[0m -=============================================================================== -Remove old rootfs.gz.unixtimestamp backup filesystems to free up disk space.\n\n" + echo -en "\033[1m`gettext \"Clean\"`\033[0m +===============================================================================" +gettext "Remove old rootfs.gz.unixtimestamp backup filesystems to free up disk space."; echo -e "\n\n" # Locate and interactively remove old filesystems from /home directory for file in `find /home/boot/rootfs.gz.[0-9]*` do - echo -n "Do you wish to remove: `basename $file` (Yes/no/exit) ? " + gettext "Do you wish to remove: `basename $file` (Yes/no/exit) ? " read answer case $answer in e|E|"exit"|Exit) @@ -441,7 +454,7 @@ y|Y|yes|Yes) rm -f $file ;; *) - echo -en "No filesystems selected, exiting...\n" ;; + gettext "No filesystems selected, exiting..." ; echo "" ;; esac done } @@ -461,9 +474,9 @@ fi # Start info echo "" - echo -e "\033[1mWrite filesystem\033[0m -=============================================================================== -The command writefs will write all the current filesystem into a suitable cpio + echo -e "\033[1m`gettext \nWrite filesystem\"`\033[0m +===============================================================================" +gettext "The command writefs will write all the current filesystem into a suitable cpio archive (rootfs.gz) usable on a bootable LiveUSB media. Archive compression: $COMPRESSION" @@ -473,30 +486,30 @@ rm /var/cache/tazpkg/* -r -f # Optionally remove sound card selection - echo -n "Do you wish to remove the sound card selection (No/yes/exit) ? " + gettext "Do you wish to remove the sound card selection (No/yes/exit) ? " read anser case $anser in e|E|"exit"|Exit) exit 0 ;; y|Y|yes|Yes) - echo -n "Removing current sound card selection..." + gettext "Removing current sound card selection..." rm -f /var/lib/sound-card-driver rm -f /var/lib/alsa/asound.state ;; *) - echo -n "Keeping current sound card selection..." ;; + gettext "Keeping current sound card selection..." ;; esac status # Optionally remove screen resolution - echo -n "Do you wish to remove the screen resolution (No/yes/exit) ? " + gettext "Do you wish to remove the screen resolution (No/yes/exit) ? " read anser case $anser in e|E|"exit"|Exit) exit 0 ;; y|Y|yes|Yes) - echo -n "Removing current screen resolution..." + gettext "Removing current screen resolution..." rm -f /etc/X11/screen.conf ;; *) - echo -n "Keeping current screen resolution..." ;; + gettext "Keeping current screen resolution..." ;; esac status @@ -510,15 +523,15 @@ # Generate initramfs with specified compression if [ "$COMPRESSION" = "lzma" ]; then - echo -n "Creating rootfs.gz with lzma compression... " + gettext "Creating rootfs.gz with lzma compression... " cat /tmp/list | cpio -o -H newc | lzma e -si -so > /rootfs.gz elif [ "$COMPRESSION" = "gzip" ]; then - echo -n "Creating rootfs.gz with gzip compression... " + gettext "Creating rootfs.gz with gzip compression... " cat /tmp/list | cpio -o -H newc | gzip -9 > /rootfs.gz else - echo -n "Creating rootfs.gz without compression... " + gettext "Creating rootfs.gz without compression... " cat /tmp/list | cpio -o -H newc > /rootfs.gz fi @@ -527,7 +540,7 @@ # If the bootable medium is where it should be, copy across if (test -e /home/boot/bzImage); then - echo "Moving rootfs.gz to media. Remember to unmount for delayed writes!" + gettext "Moving rootfs.gz to media. Remember to unmount for delayed writes!"; echo "" # Move the old filesystem with the unix timestamp for reference if (test -e /home/boot/previous.gz); then @@ -537,19 +550,20 @@ mv /home/boot/rootfs.gz /home/boot/previous.gz mv /rootfs.gz /home/boot/. else - echo "rootfs.gz is located in /" + gettext "rootfs.gz is located in /"; echo "" fi echo "===============================================================================" - echo "Root filesystem size: $size" + gettext "Root filesystem size: $size"; echo "" echo "" - echo -en "----\nENTER to continue..."; read i + echo "----" + gettext "ENTER to continue..."; read i ;; format) # Format a partition. check_root echo "" - echo -e "\033[1mFormat a device\033[0m" + echo -e "\033[1m`gettext \"Format a device\"`\033[0m" echo "===============================================================================" DEVICE=$2 label=$3 @@ -566,14 +580,14 @@ make_fs "$fs_type" # mkfs_ext3 echo "===============================================================================" - echo "Device $label ($DEVICE) is ready to use as LiveUSB and/or /home partition." + gettext "Device $label ($DEVICE) is ready to use as LiveUSB and/or /home partition." echo "" ;; gen-liveusb) # Generate a LiveUSB media using files from a LiveCD. check_root echo "" - echo -e "\033[1mGen a LiveUSB media\033[0m" + echo -e "\033[1m`gettext \"Gen a LiveUSB media\"`\033[0m" echo "===============================================================================" DEVICE=$2 if [ -z $DEVICE ]; then @@ -601,11 +615,11 @@ # Check if file exists ISO=$2 if [ -z $ISO ] || [ ! -f $ISO ]; then - echo -e "\nPlease specify a valid filename on the command line.\n" + gettext "Please specify a valid filename on the command line."; echo "" exit 1 fi echo "" - echo -e "\033[1mCopy ISO file to SliTaz LiveUSB media\033[0m" + echo -e "\033[1m`gettext \"Copy ISO file to SliTaz LiveUSB media\"`\033[0m" echo "===============================================================================" echo "" DEVICE=$3