]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-mkstandalone.in: Fix help messages. Gettextize.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 3 Feb 2012 10:42:22 +0000 (11:42 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 3 Feb 2012 10:42:22 +0000 (11:42 +0100)
* util/grub-install.in: Gettextize.
* util/grub-mkconfig.in: Likewise.
* util/grub-mkconfig_lib.in: Replace gettext with echo -n and not echo
if not available.
(grub_warn): Gettextize.
* util/grub-mknetdir.in: Gettextize.
* util/grub-mkrescue.in: Likewise.
* util/grub-mkstandalone.in: Likewise.
* util/grub-reboot.in: Likewise.
* util/grub-set-default.in: Likewise.
* util/grub.d/00_header.in: Likewise.
* util/grub.d/10_hurd.in: Likewise.
* util/grub.d/10_kfreebsd.in: Likewise.
* util/grub.d/10_linux.in: Likewise.
* util/grub.d/10_netbsd.in: Likewise.
* util/grub.d/10_windows.in: Likewise.
* util/grub.d/20_linux_xen.in: Likewise.
* util/grub.d/30_os-prober.in: Likewise.
* po/POTFILES-shell.in: Regenerate.

18 files changed:
ChangeLog
po/POTFILES-shell.in
util/grub-install.in
util/grub-mkconfig.in
util/grub-mkconfig_lib.in
util/grub-mknetdir.in
util/grub-mkrescue.in
util/grub-mkstandalone.in
util/grub-reboot.in
util/grub-set-default.in
util/grub.d/00_header.in
util/grub.d/10_hurd.in
util/grub.d/10_kfreebsd.in
util/grub.d/10_linux.in
util/grub.d/10_netbsd.in
util/grub.d/10_windows.in
util/grub.d/20_linux_xen.in
util/grub.d/30_os-prober.in

index 60a2cbaf4c3662a4375999d949dc9007e9a8289c..a62dc564a3b1e7b3d450ae33e6f19b905f3316ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2012-02-03  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-mkstandalone.in: Fix help messages. Gettextize.
+       * util/grub-install.in: Gettextize.
+       * util/grub-mkconfig.in: Likewise.
+       * util/grub-mkconfig_lib.in: Replace gettext with echo -n and not echo
+       if not available.
+       (grub_warn): Gettextize.
+       * util/grub-mknetdir.in: Gettextize.
+       * util/grub-mkrescue.in: Likewise.
+       * util/grub-mkstandalone.in: Likewise.
+       * util/grub-reboot.in: Likewise.
+       * util/grub-set-default.in: Likewise.
+       * util/grub.d/00_header.in: Likewise.
+       * util/grub.d/10_hurd.in: Likewise.
+       * util/grub.d/10_kfreebsd.in: Likewise.
+       * util/grub.d/10_linux.in: Likewise.
+       * util/grub.d/10_netbsd.in: Likewise.
+       * util/grub.d/10_windows.in: Likewise.
+       * util/grub.d/20_linux_xen.in: Likewise.
+       * util/grub.d/30_os-prober.in: Likewise.
+       * po/POTFILES-shell.in: Regenerate.
+
 2012-02-03  Richard Laager <rlaager@wiktel.com>
 
        * util/grub-mkimage.c (main): Fix format-security warning.
index 70c2a3fd4967a80682d722e16c22d0f3e1228d4c..46c589f03afe2dbeae24a2cb1c4a31bf827732bd 100644 (file)
@@ -1,7 +1,21 @@
-# List of files which contain translatable strings.  Only files written in
-# Shell language are included here.
+util/grub.d/00_header.in
 util/grub.d/10_hurd.in
+util/grub.d/10_illumos.in
 util/grub.d/10_kfreebsd.in
 util/grub.d/10_linux.in
 util/grub.d/10_netbsd.in
+util/grub.d/10_windows.in
 util/grub.d/20_linux_xen.in
+util/grub.d/30_os-prober.in
+util/grub.d/40_custom.in
+util/grub.d/41_custom.in
+util/grub-install.in
+util/grub-kbdcomp.in
+util/grub-mkconfig.in
+util/grub-mkconfig_lib.in
+util/grub-mknetdir.in
+util/grub-mkrescue.in
+util/grub-mkstandalone.in
+util/grub-reboot.in
+util/grub-set-default.in
+util/powerpc/ieee1275/grub-mkrescue.in
index 9d219bb9371b3b209ec42715a3801874ef06db1b..2cec0c4ca4a56a7ec1b23627e0b73c58377d3341 100644 (file)
@@ -79,63 +79,53 @@ else
     disk_module=native
 fi
 
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
 # Usage: usage
 # Print the usage.
 usage () {
-if [ "${target_cpu}-${platform}" = "i386-pc" ] \
-    || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]; then
-    cat <<EOF
-Usage: $self [OPTION] install_device
-EOF
-else
-    cat <<EOF
-Usage: $self [OPTION] [install_device]
-EOF
-fi
-cat <<EOF
-Install GRUB on your drive.
-
-  -h, --help              print this message and exit
-  -v, --version           print the version information and exit
-  --modules=MODULES       pre-load specified modules MODULES
-  --boot-directory=DIR    install GRUB images under the directory DIR/@grubdirname@
-                          instead of the $grubdir directory
-  --grub-setup=FILE       use FILE as grub-setup
-  --grub-mkimage=FILE     use FILE as grub-mkimage
-  --grub-mkrelpath=FILE   use FILE as grub-mkrelpath
-  --grub-mkdevicemap=FILE use FILE as grub-mkdevicemap
-  --grub-probe=FILE       use FILE as grub-probe
-  --no-floppy             do not probe any floppy drive
-  --allow-floppy          Make the drive also bootable as floppy 
-                          (default for fdX devices). May break on some BIOSes.
-  --recheck               delete device map if it already exists
-  --force                 install even if problems are detected
-EOF
+    if [ "${target_cpu}-${platform}" = "i386-pc" ] \
+       || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]; then
+       gettext_printf "Usage: %s [OPTION] install_device" "$self"
+    else
+       gettext_printf "Usage: %s [OPTION] [install_device]" "$self"
+    fi
+    echo
+    gettext "Install GRUB on your drive." ; echo
+    echo
+    printf "  -h, --help              %s\n" "$(gettext "print this message and exit")"
+    printf "  -v, --version           %s\n" "$(gettext "print the version information and exit")"
+    printf "  --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
+    dirmsg="$(printf "install GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
+    printf "  --boot-directory=%-7s%s\n" "$(gettext "DIR")" "$dirmsg"
+    printf "  --grub-setup=%-11s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-setup")"
+    printf "  --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
+    printf "  --grub-mkrelpath=%-7s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkrelpath")"
+    printf "  --grub-mkdevicemap=%-5s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkdevicemap")"
+    printf "  --grub-probe=%-11s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-probe")"
+    printf "  --no-floppy             %s\n" "$(gettext "do not probe any floppy drive")"
+    printf "  --allow-floppy          %s\n" "$(gettext "Make the drive also bootable as floppy (default for fdX devices). May break on some BIOSes.")"
+    printf "  --recheck               %s\n" "$(gettext "delete device map if it already exists")"
+    printf "  --force                 %s\n" "$(gettext "install even if problems are detected")"
 if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
-    cat <<EOF
-  --disk-module=MODULE    disk module to use (biosdisk or native)
-EOF
+    printf "  --disk-module=%-10s%s\n" "$(gettext "MODULE")" "$(gettext "disk module to use (biosdisk or native)")"
 fi
 if [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ] ; then
-    cat <<EOF
-  --no-nvram              don't update the boot-device NVRAM variable
-EOF
+    printf "  --no-nvram              %s\n" "$(gettext "don't update the boot-device NVRAM variable")"
 fi
 if [ "${platform}" = "efi" ]; then
-    cat <<EOF
-   --removable             the installation device is removable
-   --bootloader-id=ID      the ID of bootloader.
-EOF
-fi
-    cat <<EOF
-
-INSTALL_DEVICE can be a GRUB device name or a system device filename.
-
-$self copies GRUB images into $grubdir, and uses grub-setup
-to install grub into the boot sector.
 
-Report bugs to <bug-grub@gnu.org>.
-EOF
+    printf "   --removable             %s\n" "$(gettext "the installation device is removable")"
+    printf "   --bootloader-id=%-8s%s\n" "$(gettext "ID")" "$(gettext "the ID of bootloader.")"
+fi
+echo
+gettext "INSTALL_DEVICE must be system device filename.";echo
+echo
+
+gettext_printf "%s copies GRUB images into %s, and uses grub-setup
+to install grub into the boot sector.\n" "$self" "$grubdir";echo
+echo
+gettext "Report bugs to <bug-grub@gnu.org>."; echo
 }
 
 argument () {
@@ -265,8 +255,6 @@ do
     esac
 done
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
-
 if test "x$install_device" = x && ([ "${target_cpu}-${platform}" = "i386-pc" ] \
     || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]); then
     echo "install_device not specified." 1>&2
index c7175586d1062e03fed6143107a3c7c5216317f1..c876a4e4c49b45cf47e749717d9c5c04c1e28f19 100644 (file)
@@ -42,19 +42,19 @@ grub_script_check="${bindir}/`echo grub-script-check | sed "${transform}"`"
 
 GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"`
 
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
 # Usage: usage
 # Print the usage.
 usage () {
-    cat <<EOF
-Usage: $self [OPTION]
-Generate a grub config file
-
-  -o, --output=FILE       output generated config to FILE [default=stdout]
-  -h, --help              print this message and exit
-  -v, --version           print the version information and exit
-
-Report bugs to <bug-grub@gnu.org>.
-EOF
+    gettext_printf "Usage: %s [OPTION]\n" "$self"
+    gettext "Generate a grub config file"; echo
+    echo
+    printf "  -o, --output=%-11s%s\n" "$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")"
+    printf "  -h, --help              %s\n" "$(gettext "print this message and exit")"
+    printf "  -v, --version           %s\n" "$(gettext "print the version information and exit")"
+    echo
+    gettext "Report bugs to <bug-grub@gnu.org>."; echo
 }
 
 argument () {
@@ -62,7 +62,7 @@ argument () {
   shift
 
   if test $# -eq 0; then
-      echo "$0: option requires an argument -- '$opt'" 1>&2
+      gettext_printf "%s: option requires an argument -- '%s'" "$0" "$opt" 1>&2
       exit 1
   fi
   echo $1
@@ -87,7 +87,7 @@ do
        grub_cfg=`echo "$option" | sed 's/--output=//'`
        ;;
     -*)
-       echo "Unrecognized option \`$option'" 1>&2
+       gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
        usage
        exit 1
        ;;
@@ -113,7 +113,7 @@ if [ "$EUID" != 0 ] ; then
       done ;;
   esac
   if [ $root != t ] ; then
-    echo "$self: You must run this as root" >&2
+    gettext_printf "%s: You must run this as root\n" "$self" >&2
     exit 1
   fi
 fi
@@ -122,7 +122,7 @@ set $grub_probe dummy
 if test -f "$1"; then
     :
 else
-    echo "$1: Not found." 1>&2
+    gettext_print "%s: Not found.\n" "$1" 1>&2
     exit 1
 fi
 
@@ -184,7 +184,7 @@ for x in ${GRUB_TERMINAL_OUTPUT}; do
        fi
        if [ -z "${GRUB_FONT_PATH}" ] ; then
            if [ "x$termoutdefault" != "x1" ]; then
-               echo "No font for gfxterm found." >&2 ; exit 1
+               gettext "No font for gfxterm found." >&2; echo >&2 ; exit 1
            fi
            GRUB_TERMINAL_OUTPUT=
        fi
@@ -253,10 +253,11 @@ if test "x${grub_cfg}" != "x"; then
 
   # Allow this to fail, since /boot/grub/ might need to be fatfs to support some
   # firmware implementations (e.g. OFW or EFI).
-  chmod 400 ${grub_cfg}.new || grub_warn "Could not make ${grub_cfg}.new readable by only root.\
-  This means that if the generated config contains a password it is readable by everyone"
+  chmod 400 ${grub_cfg}.new || grub_warn "$(gettext_printf "Could not make %s \
+readable by only root. This means that if the generated config contains a password it is readable by everyone" "${grub_cfg}.new")"
 fi
-echo "Generating grub.cfg ..." >&2
+gettext "Generating grub.cfg ..." >&2
+echo >&2
 
 cat << EOF
 #
@@ -286,14 +287,15 @@ done
 
 if test "x${grub_cfg}" != "x" ; then
   if ! ${grub_script_check} ${grub_cfg}.new; then
-    echo "Syntax errors are detected in generated GRUB config file." >&2
-    echo "Ensure that there are no errors in /etc/default/grub" >&2
-    echo "and /etc/grub.d/* files or please file a bug report with" >&2
-    echo "${grub_cfg}.new file attached." >&2
+    gettext_printf "Syntax errors are detected in generated GRUB config file.
+Ensure that there are no errors in /etc/default/grub
+and /etc/grub.d/* files or please file a bug report with
+%s file attached." "${grub_cfg}.new" >&2
   else
     # none of the children aborted with error, install the new grub.cfg
     mv -f ${grub_cfg}.new ${grub_cfg}
   fi
 fi
 
-echo "done" >&2
+gettext "done" >&2
+echo >&2
index 0b77dc38c2e8b367b1ca143110f2231395333ba4..c1573379c6ace71d76d782eefd55ce32b6bda509 100644 (file)
@@ -32,14 +32,16 @@ if test "x$grub_mkrelpath" = x; then
 fi
 
 if $(which gettext >/dev/null 2>/dev/null) ; then
-  gettext="gettext"
+  :
 else
-  gettext="echo"
+  gettext () {
+     echo -n "$@"
+  }
 fi
 
 grub_warn ()
 {
-  echo "Warning: $@" >&2
+  echo "$(gettext "Warning:")" "$@" >&2
 }
 
 make_system_path_relative_to_its_root ()
@@ -228,7 +230,7 @@ version_find_latest ()
 # printf; so this turns ' into \'.  Note that you must use the output of
 # this function in a printf format string.
 gettext_quoted () {
-  "$gettext" "$@" | sed "s/'/'\\\\\\\\''/g"
+  gettext "$@" | sed "s/'/'\\\\\\\\''/g"
 }
 
 # Run the first argument through gettext_quoted, and then pass that and all
index 4f4061621db0129a144e3ca316df66efc38e6815..e93db7ff9f0f2a04243e8546c453b91c78faed9c 100644 (file)
@@ -29,6 +29,7 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 host_os=@host_os@
 pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
+datadir="@datadir@"
 
 self=`basename $0`
 
@@ -51,24 +52,24 @@ efi32_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-efi"
 efi64_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi"
 itanium_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/ia64-efi"
 
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
 # Usage: usage
 # Print the usage.
 usage () {
-    cat <<EOF
-Usage: $self [OPTION] install_device
-Install GRUB on your drive.
-
-  -h, --help              print this message and exit
-  -v, --version           print the version information and exit
-  --modules=MODULES       pre-load specified modules MODULES
-  --net-directory=DIR     root directory of TFTP server
-  --subdir=DIR            relative subdirectory on network server
-  --grub-mkimage=FILE     use FILE as grub-mkimage
-
-$self copies GRUB images into net_directory/subdir/target_cpu-platform
-
-Report bugs to <bug-grub@gnu.org>.
-EOF
+    gettext_printf "Usage: %s [OPTION] install_device\n" "$self"
+    gettext; echo "Install GRUB on your drive."; echo
+    echo
+    printf "  -h, --help              %s\n" "$(gettext "print this message and exit")"
+    printf "  -v, --version           %s\n" "$(gettext "print the version information and exit")"
+    printf "  --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
+    printf "  --net-directory=%-8s%s\n" "$(gettext "DIR")" "$(gettext "root directory of TFTP server")"
+    printf "  --subdir=%-15s%s\n" "$(gettext "DIR")" "$(gettext "relative subdirectory on network server")"
+    printf "  --grub-mkimage=%-9s%s" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
+    echo
+    gettext_printf "%s copies GRUB images into net_directory/subdir/target_cpu-platform\n" "$self" 
+    echo
+    gettext "Report bugs to <bug-grub@gnu.org>."; echo
 }
 
 argument () {
@@ -76,7 +77,7 @@ argument () {
   shift
 
   if test $# -eq 0; then
-      echo "$0: option requires an argument -- '$opt'" 1>&2
+      gettext_printf "%s: option requires an argument -- '%s'\n" "$0" "$opt" 1>&2
       exit 1
   fi
   echo $1
@@ -138,7 +139,7 @@ do
        ;;
 
     -*)
-       echo "Unrecognized option \`$option'" 1>&2
+       gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
        usage
        exit 1
        ;;
@@ -156,7 +157,7 @@ set $grub_mkimage dummy
 if test -f "$1"; then
     :
 else
-    echo "$1: Not found." 1>&2
+    gettext_printf "%s: Not found.\n" "$1" 1>&2
     exit 1
 fi
 
@@ -215,7 +216,7 @@ process_input_dir ()
         *-efi) mkimage_target="${platform}";
                  netmodules="efinet";
                  ext=efi ;;
-        *) echo Unsupported platform ${platform};
+        *) gettext_printf "Unsupported platform %s\n" ${platform};
            exit 1;;
     esac
 
@@ -224,7 +225,7 @@ source ${subdir}/grub.cfg
 EOF
 
     "$grub_mkimage" ${config_opt} -d "${input_dir}" -O ${mkimage_target} "--output=${grubdir}/core.$ext" "--prefix=$prefix" $modules $netmodules tftp || exit 1
-    echo "Netboot directory for ${platform} created. Configure your DHCP server to point to ${subdir}/${platform}/core.$ext"
+    gettext_printf "Netboot directory for %s created. Configure your DHCP server to point to %s\n" "${platform}" "${subdir}/${platform}/core.$ext"
 }
 
 if [ "${override_dir}" = "" ] ; then
index ccad5e0d93a1c147f344f0992ef1b2027f4be2a7..9c0e9085f8f4405cb7ee1fabcb775f550b9527f3 100644 (file)
@@ -29,6 +29,7 @@ libdir="@libdir@"
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
+datadir="@datadir@"
 pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
 
 self=`basename $0`
@@ -45,29 +46,29 @@ grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`"
 
 xorriso=xorriso
 
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
 # Usage: usage
 # Print the usage.
 usage () {
-    cat <<EOF
-Usage: $self [OPTION] SOURCE...
-Make GRUB rescue image.
-
-  -h, --help              print this message and exit
-  -v, --version           print the version information and exit
-  -o, --output=FILE       save output in FILE [required]
-  --modules=MODULES       pre-load specified modules MODULES
-  --rom-directory=DIR     save rom images in DIR [optional]
-  --xorriso=FILE          use FILE as xorriso [optional]
-  --grub-mkimage=FILE     use FILE as grub-mkimage
-
-$self generates a bootable rescue image with specified source files, source
-directories, or mkisofs options listed by: xorriso -as mkisofs -help
-
-Option -- switches to native xorriso command mode.
-
-Report bugs to <bug-grub@gnu.org>.
-Mail xorriso support requests to <bug-xorriso@gnu.org>.
-EOF
+    gettext_printf "Usage: %s [OPTION] SOURCE...\n" "$self"
+    gettext "Make GRUB rescue image."; echo
+    echo
+    printf "  -h, --help              %s\n" "$(gettext "print this message and exit")"
+    printf "  -v, --version           %s\n" "$(gettext "print the version information and exit")"
+    printf "  -o, --output=%-11s%s\n" "$(gettext FILE)" "$(gettext "save output in FILE [required]")"
+    printf "  --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
+    printf "  --rom-directory=%-8s%s\n" "$(gettext "DIR")" "$(gettext "save rom images in DIR [optional]")"
+    printf "  --xorriso=%-14s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as xorriso [optional]")"
+    printf "  --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
+    echo
+    gettext_printf "%s generates a bootable rescue image with specified source files, source
+directories, or mkisofs options listed by: xorriso -as mkisofs -help" "$self"
+    echo
+    gettext "Option -- switches to native xorriso command mode."; echo
+    echo
+    gettext "Report bugs to <bug-grub@gnu.org>."; echo
+    gettext "Mail xorriso support requests to <bug-xorriso@gnu.org>."; echo
 }
 
 argument () {
@@ -75,7 +76,7 @@ argument () {
   shift
 
   if test $# -eq 0; then
-      echo "$0: option requires an argument -- '$opt'" 1>&2
+      gettext_printf "%s: option requires an argument -- '%s'\n" "$0" "$opt" 1>&2
       exit 1
   fi
   echo $1
@@ -139,7 +140,8 @@ do
 done
 
 if [ "x${output_image}" = x ] ; then
-  echo "output file must be given" >&2
+  gettext "output file must be given" >&2
+  echo >&2
   usage
   exit 1
 fi
@@ -148,7 +150,7 @@ set $grub_mkimage dummy
 if test -f "$1"; then
     :
 else
-    echo "$1: Not found." 1>&2
+    gettext_printf "%s: Not found.\n" "$1" 1>&2
     exit 1
 fi
 
@@ -187,7 +189,7 @@ make_image ()
        return;
     fi
 
-    echo "Enabling $2 support ..."
+    gettext_printf "Enabling %s support ...\n" "$2"
 
     memdisk_img=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
     memdisk_dir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
@@ -255,7 +257,7 @@ grub_mkisofs_arguments="${grub_mkisofs_arguments} --modification-date=$(echo ${i
 
 # build BIOS core.img
 if test -e "${pc_dir}" ; then
-    echo "Enabling BIOS support ..."
+    gettext_printf "Enabling %s support ...\n" "BIOS"
     core_img=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
     $grub_mkimage -O i386-pc -d ${pc_dir}/ -o ${core_img} --prefix=/boot/grub/i386-pc \
         iso9660 biosdisk
index 13cf9df7ba1a79c1ff5d698c069c71a6778904c8..3cb3eb30cd0cae065f33f9c88163b8b15fdce210 100644 (file)
@@ -2,7 +2,7 @@
 set -e
 
 # Make GRUB rescue image
-# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010  Free Software Foundation, Inc.
+# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -30,6 +30,7 @@ PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
+datadir="@datadir@"
 
 self=`basename $0`
 
@@ -39,27 +40,31 @@ format=
 grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`"
 source=
 
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
 # Usage: usage
 # Print the usage.
 usage () {
-    cat <<EOF
-Usage: $self [OPTION] SOURCE...
-Make GRUB rescue image.
-
-  -h, --help              print this message and exit
-  -v, --version           print the version information and exit
-  -o, --output=FILE       save output in FILE [required]
-  -d, --directory=DIR     use images and modules under DIR [default=%s/@platform@]
-  -O, --format=FORMAT     generate an image in format
-                          available formats: %s
-  -C, --compression=(xz|none|auto)  choose the compression to use
-  --modules=MODULES       pre-load specified modules MODULES
-  --grub-mkimage=FILE     use FILE as grub-mkimage
-
-$self generates a standalone image (containing all modules) in the selected format
-
-Report bugs to <bug-grub@gnu.org>.
-EOF
+    formats="i386-coreboot i386-multiboot i386-pc i386-pc-pxe i386-efi i386-ieee1275 i386-qemu x86_64-efi mipsel-yeeloong-flash mipsel-fuloong2f-flash mipsel-loongson-elf powerpc-ieee1275 sparc64-ieee1275-raw sparc64-ieee1275-aout ia64-efi mips-arc mipsel-qemu_mips-elf mips-qemu_mips-flash  mipsel-qemu_mips-flash  mips-qemu_mips-elf"
+    gettext_printf "Usage: %s [OPTION] SOURCE...\n" "$self"
+    gettext "Make GRUB rescue image."; echo
+    echo
+    printf "  -h, --help              %s\n" "$(gettext "print this message and exit")"
+    printf "  -v, --version           %s\n" "$(gettext "print the version information and exit")"
+    printf "  -o, --output=%-11s%s\n" "$(gettext FILE)" "$(gettext "save output in FILE [required]")"
+    dir_msg="$(gettext_printf "use images and modules under DIR  [default=%s/<platform>]" "${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})")"
+    printf "  -d, --directory=%-8s%s\n" \
+       "DIR" "$dir_msg"
+    printf     "  -O, --format=%-11s%s" "$(gettext "FORMAT")" "$(gettext "generate an image in format")"; echo
+    printf "                          %s %s\n" "$(gettext "available formats:")" "$formats"
+    echo
+    printf     "  -C, --compression=(xz|none|auto)  %s\n" "$(gettext "choose the compression to use")"
+    printf "  --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
+    printf "  --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
+    echo
+    gettext_printf "%s generates a standalone image (containing all modules) in the selected format" "$self"
+    echo
+    gettext "Report bugs to <bug-grub@gnu.org>."; echo
 }
 
 argument () {
@@ -67,7 +72,7 @@ argument () {
   shift
 
   if test $# -eq 0; then
-      echo "$0: option requires an argument -- '$opt'" 1>&2
+      gettext_printf "%s: option requires an argument -- '%s'\n" "$0" "$opt" 1>&2
       exit 1
   fi
   echo $1
@@ -123,14 +128,15 @@ do
 done
 
 if [ "x${output_image}" = x ] ; then
-  echo "output file must be given" >&2
+  gettext "output file must be specified" >&2
+  echo >&2
   usage
   exit 1
 fi
 
 if [ "x${format}" = x ] ; then
-  echo "format must be given" >&2
-  usage
+  gettext "format must be specified" >&2
+  echo >&2
   exit 1
 fi
 
index 929cf52028fc0a770ac565800ac41efd5e4a4a5c..b003de10ab9ff58a5829994d6ba9e0c6d28c9fdd 100644 (file)
@@ -24,6 +24,7 @@ exec_prefix=@exec_prefix@
 bindir=@bindir@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
+datadir="@datadir@"
 
 self=`basename $0`
 
@@ -32,22 +33,22 @@ rootdir=
 bootdir=
 grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
 
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
 # Usage: usage
 # Print the usage.
 usage () {
-    cat <<EOF
-Usage: $self [OPTION] entry
-Set the default boot entry for GRUB, for the next boot only.
-
-  -h, --help              print this message and exit
-  -v, --version           print the version information and exit
-  --boot-directory=DIR    expect GRUB images under the directory DIR/@grubdirname@
-                          instead of the $grubdir directory
-
-ENTRY is a number or a menu item title.
-
-Report bugs to <bug-grub@gnu.org>.
-EOF
+    gettext_printf "Usage: %s [OPTION] entry" "$self"
+    gettext "Set the default boot entry for GRUB, for the next boot only."; echo
+    echo
+    printf "  -h, --help              %s\n" "$(gettext "print this message and exit")"
+    printf "  -v, --version           %s\n" "$(gettext "print the version information and exit")"
+    dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
+    printf "  --boot-directory=%-7s%s\n" "$(gettext "DIR")" "$dirmsg"
+    echo
+    gettext "ENTRY is a number or a menu item title."; echo
+    echo
+    gettext "Report bugs to <bug-grub@gnu.org>."; echo
 }
 
 argument () {
@@ -55,7 +56,7 @@ argument () {
   shift
 
   if test $# -eq 0; then
-      echo "$0: option requires an argument -- '$opt'" 1>&2
+      gettext_printf "%s: option requires an argument -- '%s'\n" "$0" "$opt" 1>&2
       exit 1
   fi
   echo $1
@@ -87,13 +88,14 @@ do
     bootdir=`echo "$option" | sed 's/--boot-directory=//'` ;;
 
     -*)
-       echo "Unrecognized option \`$option'" 1>&2
+       gettext_printf "Unrecognized option \`%s'" "$option" 1>&2
        usage
        exit 1
        ;;
     *)
        if test "x$entry" != x; then
-           echo "More than one entry?" 1>&2
+           gettext "More than one entry?" 1>&2
+           echo >&2
            usage
            exit 1
        fi
@@ -102,7 +104,8 @@ do
 done
 
 if test "x$entry" = x; then
-    echo "entry not specified." 1>&2
+    gettext "entry not specified." 1>&2
+    echo >&2
     usage
     exit 1
 fi
index b09727de2793b0549854b2ef890a664010ddd509..100ae99213445e77507391e5847342ee6c842b62 100644 (file)
@@ -24,6 +24,7 @@ exec_prefix=@exec_prefix@
 bindir=@bindir@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
+datadir="@datadir@"
 
 self=`basename $0`
 
@@ -32,22 +33,22 @@ rootdir=
 bootdir=
 grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
 
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
 # Usage: usage
 # Print the usage.
 usage () {
-    cat <<EOF
-Usage: $self [OPTION] entry
-Set the default boot entry for GRUB.
-
-  -h, --help              print this message and exit
-  -v, --version           print the version information and exit
-  --boot-directory=DIR    expect GRUB images under the directory DIR/@grubdirname@
-                          instead of the $grubdir directory
-
-ENTRY is a number or a menu item title.
-
-Report bugs to <bug-grub@gnu.org>.
-EOF
+    gettext_printf "Usage: %s [OPTION] entry\n" "$self"
+    gettext "Set the default boot entry for GRUB."; echo
+    echo
+    printf "  -h, --help              %s\n" "$(gettext "print this message and exit")"
+    printf "  -v, --version           %s\n" "$(gettext "print the version information and exit")"
+    dirmsg="$(printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
+    printf "  --boot-directory=%-7s%s\n" "$(gettext "DIR")" "$dirmsg"
+    echo
+    gettext "ENTRY is a number or a menu item title."; echo
+    echo
+    gettext "Report bugs to <bug-grub@gnu.org>."; echo
 }
 
 argument () {
@@ -55,7 +56,7 @@ argument () {
   shift
 
   if test $# -eq 0; then
-      echo "$0: option requires an argument -- '$opt'" 1>&2
+      gettext_printf "%s: option requires an argument -- '%s'\n" "$0" "$opt" 1>&2
       exit 1
   fi
   echo $1
@@ -87,13 +88,14 @@ do
     bootdir=`echo "$option" | sed 's/--boot-directory=//'` ;;
 
     -*)
-       echo "Unrecognized option \`$option'" 1>&2
+       gettext_printf "Unrecognized option \`%s'" "$option" 1>&2
        usage
        exit 1
        ;;
     *)
        if test "x$entry" != x; then
-           echo "More than one entry?" 1>&2
+           gettext "More than one entry?" 1>&2
+           echo >&2
            usage
            exit 1
        fi
@@ -102,7 +104,8 @@ do
 done
 
 if test "x$entry" = x; then
-    echo "entry not specified." 1>&2
+    gettext "entry not specified." 1>&2
+    echo >&2
     usage
     exit 1
 fi
index ece1b90da43744ba54b100d6ce0d58f4a0a5caf0..d9bcc15bc2989ccbd77b2270b0e3dabab6f4847b 100644 (file)
@@ -113,11 +113,11 @@ done
 
 if [ "x$serial" = x1 ]; then
     if ! test -e "${GRUB_PREFIX}/serial.mod" ; then
-       echo "Serial terminal not available on this platform." >&2 ; exit 1
+       gettext "Serial terminal not available on this platform." >&2 ; echo >&2; exit 1
     fi
 
     if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then
-       grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used."
+       grub_warn "$(gettext "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used.")"
        GRUB_SERIAL_COMMAND=serial
     fi
     echo "${GRUB_SERIAL_COMMAND}"
@@ -174,7 +174,8 @@ esac
 if [ "x$gfxterm" = x1 ]; then
     if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \
        && is_path_readable_by_grub "$GRUB_THEME"; then
-       echo "Found theme: $GRUB_THEME" >&2
+       gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&2
+
        prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"`
        cat << EOF
 insmod gfxmenu
@@ -208,12 +209,12 @@ set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME`
 EOF
     elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \
            && is_path_readable_by_grub "$GRUB_BACKGROUND"; then
-       echo "Found background: $GRUB_BACKGROUND" >&2
+       gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&2
        case "$GRUB_BACKGROUND" in 
            *.png)         reader=png ;;
            *.tga)         reader=tga ;;
            *.jpg|*.jpeg)  reader=jpeg ;;
-           *)             echo "Unsupported image format" >&2; exit 1 ;;
+           *)             gettext "Unsupported image format" >&2; echo >&2; exit 1 ;;
        esac
        prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"`
        cat << EOF
index c885eaba69f266e0aedbbfec376bc0b839b1d33a..23099f2250b36677cae6daab1b50a0a758461909 100644 (file)
@@ -41,7 +41,8 @@ for i in /boot/gnumach* ; do
     basename=`basename $i`
     dirname=`dirname $i`
     rel_dirname=`make_system_path_relative_to_its_root $dirname`
-    echo "Found GNU Mach: $i" >&2
+    gettext_printf "Found GNU Mach: %s" "$i" >&2
+    echo >&2
     kernels="${kernels} ${rel_dirname}/${basename}"
     at_least_one=true
   fi
@@ -55,7 +56,8 @@ esac
 
 for i in /hurd/${hurd_fs}.static /hurd/exec ; do
   if test -e "$i" ; then
-    echo "Found Hurd module: $i" >&2
+    gettext_printf "Found Hurd module: %s" "$i" >&2
+    echo >&2
     at_least_one=true
   else
     all_of_them=false
@@ -68,7 +70,8 @@ if ${at_least_one} ; then : ; else
 fi
 
 if ${all_of_them} && test -e /lib/ld.so.1 ; then : ; else
-  echo "Some Hurd stuff found, but not enough to boot." >&2
+  gettext "Some Hurd stuff found, but not enough to boot." >&2
+  echo >&2
   exit 1
 fi
 
index dede4f6dae494097d4bb7aa4a87f4d5d2bdee5bc..c315512062666cd305d46b2dde89fa20a14a3790 100644 (file)
@@ -135,7 +135,7 @@ prepare_boot_cache=
 
 while [ "x$list" != "x" ] ; do
   kfreebsd=`version_find_latest $list`
-  echo "Found kernel of FreeBSD: $kfreebsd" >&2
+  gettext_printf "Found kernel of FreeBSD: %s\n" "$kfreebsd" >&2
   basename=`basename $kfreebsd`
   dirname=`dirname $kfreebsd`
   rel_dirname=`make_system_path_relative_to_its_root $dirname`
@@ -184,7 +184,7 @@ while [ "x$list" != "x" ] ; do
     fi
   done
   if test -n "${module_dir}" ; then
-    echo "Found kernel module directory: ${module_dir}" >&2
+    gettext_printf "Found kernel module directory: %s\n" "${module_dir}" >&2
     module_dir_rel=$(make_system_path_relative_to_its_root $module_dir)
   fi
 
index d5586b375a4e567e0e9e3898ed1e8418b2bd0062..bc738f205fdf1afcba3ec2d7b61c2f86699da9e7 100644 (file)
@@ -146,7 +146,7 @@ prepare_root_cache=
 
 while [ "x$list" != "x" ] ; do
   linux=`version_find_latest $list`
-  echo "Found linux image: $linux" >&2
+  gettext_printf "Found linux image: %s\n" "$linux" >&2
   basename=`basename $linux`
   dirname=`dirname $linux`
   rel_dirname=`make_system_path_relative_to_its_root $dirname`
@@ -181,7 +181,7 @@ while [ "x$list" != "x" ] ; do
   fi
 
   if test -n "${initrd}" ; then
-    echo "Found initrd image: ${dirname}/${initrd}" >&2
+    gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2
   elif test -z "${initramfs}" ; then
     # "UUID=" magic is parsed by initrd or initramfs.  Since there's
     # no initrd or builtin initramfs, it can't work here.
index df095ddc074b9d6504fc196f641e6f944e07c4f3..236842da1cb9c0e4db77046b2816cf73c9cb67f2 100644 (file)
@@ -132,7 +132,7 @@ for k in $(ls -t /netbsd*) ; do
     continue
   fi
 
-  echo "Found NetBSD kernel: $k" >&2
+  gettext_printf "Found NetBSD kernel: %s\n" "$k" >&2
   netbsd_entry "knetbsd"   "$k" false "${GRUB_CMDLINE_NETBSD_DEFAULT}"
   netbsd_entry "multiboot" "$k" false "${GRUB_CMDLINE_NETBSD_DEFAULT}"
   if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
index 8ee75d261dccde81d2214965b06fc306b96efb87..08a8c6afd6bc1df7d14fe30e4f022a79360d0b01 100644 (file)
@@ -63,11 +63,11 @@ for drv in $drives ; do
 
   # Check for Vista bootmgr.
   if [ -f "$dir"/bootmgr -a -f "$dir"/boot/bcd ] ; then
-    OS="Windows Vista bootmgr"
+    OS="$(gettext_quoted "Windows Vista bootmgr")"
 
   # Check for NTLDR.
   elif [ -f "$dir"/ntldr -a -f "$dir"/ntdetect.com -a -f "$dir"/boot.ini ] ; then
-    OS=`get_os_name_from_boot_ini "$dir"/boot.ini` || OS="Windows NT/2000/XP loader"
+    OS=`get_os_name_from_boot_ini "$dir"/boot.ini` || OS="$(gettext_quoted "Windows NT/2000/XP loader")"
     needmap=t
 
   else
@@ -77,7 +77,7 @@ for drv in $drives ; do
   # Get boot /dev/ice.
   dev=`${grub_probe} -t device "$dir" 2>/dev/null` || continue
 
-  echo "Found $OS on $drv ($dev)" >&2
+  gettext_printf "Found %s on %s (%s)\n" "$OS" "$drv" "$dev" >&2
   cat << EOF
 menuentry "$OS" {
 EOF
index ab6319feb3f4f0b00f98835dd881c0996ff274e6..56771abca4d3e85235448768613bb373d55a8503 100644 (file)
@@ -142,7 +142,7 @@ while [ "x${xen_list}" != "x" ] ; do
     echo "submenu \"Xen ${xen_version}\" {"
     while [ "x$list" != "x" ] ; do
        linux=`version_find_latest $list`
-       echo "Found linux image: $linux" >&2
+       gettext_printf "Found linux image: %s\n" "$linux" >&2
        basename=`basename $linux`
        dirname=`dirname $linux`
        rel_dirname=`make_system_path_relative_to_its_root $dirname`
@@ -162,7 +162,7 @@ while [ "x${xen_list}" != "x" ] ; do
            fi
        done
        if test -n "${initrd}" ; then
-           echo "Found initrd image: ${dirname}/${initrd}" >&2
+           gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2
        else
     # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
            linux_root_device_thisversion=${GRUB_DEVICE}
index 5f451524017c8cae388947b203b832bef8434af1..0d8ea7fd6dd0235114789cb8d0b5a61fe336a46b 100644 (file)
@@ -39,8 +39,17 @@ if [ -z "${OSPROBED}" ] ; then
 fi
 
 osx_entry() {
+    if [ x$2 = x32 ]; then
+        # TRANSLATORS: it refers to kernel architecture (32-bit)
+       bitstr="$(gettext "(32-bit)")"
+    else
+        # TRANSLATORS: it refers to kernel architecture (32-bit)
+       bitstr="$(gettext "(64-bit)")"
+    fi
+    # TRANSLATORS: it refers on the OS residing on device %s
+    onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
         cat << EOF
-menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" --class osx --class darwin --class os {
+menuentry "${LONGNAME} $bitstr $onstr" --class osx --class darwin --class os {
 EOF
        save_default_entry | sed -e "s/^/\t/"
        prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
@@ -99,13 +108,14 @@ for OS in ${OSPROBED} ; do
     LONGNAME="${LABEL}"
   fi
 
-  echo "Found ${LONGNAME} on ${DEVICE}" >&2
+  gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2
 
   case ${BOOT} in
     chain)
 
+         onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
       cat << EOF
-menuentry "${LONGNAME} (on ${DEVICE})" --class windows --class os {
+menuentry "${LONGNAME} $onstr" --class windows --class os {
 EOF
       save_default_entry | sed -e "s/^/\t/"
       prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
@@ -146,8 +156,9 @@ EOF
          LINITRD="${LINITRD#/boot}"
        fi
 
+       onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
         cat << EOF
-menuentry "${LLABEL} (on ${DEVICE})" --class gnu-linux --class gnu --class os {
+menuentry "${LLABEL} $onstr" --class gnu-linux --class gnu --class os {
 EOF
        save_default_entry | sed -e "s/^/\t/"
        if [ -z "${prepare_boot_cache}" ]; then
@@ -173,8 +184,9 @@ EOF
       osx_entry xnu_kernel64 64
     ;;
     hurd)
+      onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
       cat << EOF
-menuentry "${LONGNAME} (on ${DEVICE})" --class hurd --class gnu --class os {
+menuentry "${LONGNAME} $onstr" --class hurd --class gnu --class os {
 EOF
       save_default_entry | sed -e "s/^/\t/"
       prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
@@ -198,7 +210,8 @@ EOF
 EOF
     ;;
     *)
-      echo "  ${LONGNAME} is not yet supported by grub-mkconfig." >&2
+      echo -n "  "
+      gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2
     ;;
   esac
 done