diff --git a/ChangeLog b/ChangeLog index f884f2be1..e00dbfd8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-02-08 Vladimir Serbinenko + + Improve string. Gettextize. + 2012-02-11 Vladimir Serbinenko * configure.ac: Remove -Winline altogether and -Wmissing-prototypes on diff --git a/grub-core/bus/usb/serial/ftdi.c b/grub-core/bus/usb/serial/ftdi.c index 07ac7ac52..cce26d9eb 100644 --- a/grub-core/bus/usb/serial/ftdi.c +++ b/grub-core/bus/usb/serial/ftdi.c @@ -23,6 +23,7 @@ #include #include #include +#include GRUB_MOD_LICENSE ("GPLv3+"); @@ -137,19 +138,23 @@ ftdi_hw_configure (struct grub_serial_port *port, divisor = get_divisor (config->speed); if (divisor == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad speed"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port speed")); if (config->parity != GRUB_SERIAL_PARITY_NONE && config->parity != GRUB_SERIAL_PARITY_ODD && config->parity != GRUB_SERIAL_PARITY_EVEN) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported parity"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port parity")); if (config->stop_bits != GRUB_SERIAL_STOP_BITS_1 && config->stop_bits != GRUB_SERIAL_STOP_BITS_2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported stop bits"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port stop bits number")); if (config->word_len < 5 || config->word_len > 8) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported word length"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port word length")); port->config = *config; port->configured = 0; diff --git a/grub-core/bus/usb/serial/pl2303.c b/grub-core/bus/usb/serial/pl2303.c index b9954116b..f92172c1d 100644 --- a/grub-core/bus/usb/serial/pl2303.c +++ b/grub-core/bus/usb/serial/pl2303.c @@ -23,6 +23,7 @@ #include #include #include +#include GRUB_MOD_LICENSE ("GPLv3+"); @@ -150,19 +151,23 @@ pl2303_hw_configure (struct grub_serial_port *port, struct grub_serial_config *config) { if (!is_speed_supported (config->speed)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad speed"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port speed")); if (config->parity != GRUB_SERIAL_PARITY_NONE && config->parity != GRUB_SERIAL_PARITY_ODD && config->parity != GRUB_SERIAL_PARITY_EVEN) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported parity"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port parity")); if (config->stop_bits != GRUB_SERIAL_STOP_BITS_1 && config->stop_bits != GRUB_SERIAL_STOP_BITS_2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported stop bits"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port stop bits number")); if (config->word_len < 5 || config->word_len > 8) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported word length"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port word length")); port->config = *config; port->configured = 0; diff --git a/grub-core/commands/gptsync.c b/grub-core/commands/gptsync.c index 88d4b6296..0b527e30d 100644 --- a/grub-core/commands/gptsync.c +++ b/grub-core/commands/gptsync.c @@ -133,7 +133,8 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), if (! partition) { grub_device_close (dev); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such partition"); + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + N_("no such partition")); } if (partition->start + partition->len > 0xffffffff) diff --git a/grub-core/commands/i386/cmostest.c b/grub-core/commands/i386/cmostest.c index a66192cdd..d2a184026 100644 --- a/grub-core/commands/i386/cmostest.c +++ b/grub-core/commands/i386/cmostest.c @@ -60,7 +60,7 @@ grub_cmd_cmostest (struct grub_command *cmd __attribute__ ((unused)), if (value & (1 << bit)) return GRUB_ERR_NONE; - return grub_error (GRUB_ERR_TEST_FAILURE, "false"); + return grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); } static grub_err_t diff --git a/grub-core/commands/i386/cpuid.c b/grub-core/commands/i386/cpuid.c index 6a771ba74..f2f250bb6 100644 --- a/grub-core/commands/i386/cpuid.c +++ b/grub-core/commands/i386/cpuid.c @@ -50,7 +50,9 @@ grub_cmd_cpuid (grub_extcmd_context_t ctxt __attribute__ ((unused)), char **args __attribute__ ((unused))) { return grub_cpuid_has_longmode ? GRUB_ERR_NONE - : grub_error (GRUB_ERR_TEST_FAILURE, "false"); + /* TRANSLATORS: it's a standalone boolean value, + opposite of "true". */ + : grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); } static grub_extcmd_t cmd; diff --git a/grub-core/commands/i386/pc/lsapm.c b/grub-core/commands/i386/pc/lsapm.c index 5d29f459c..c82476df1 100644 --- a/grub-core/commands/i386/pc/lsapm.c +++ b/grub-core/commands/i386/pc/lsapm.c @@ -72,7 +72,7 @@ grub_cmd_lsapm (grub_command_t cmd __attribute__ ((unused)), { struct grub_apm_info info; if (!grub_apm_get_info (&info)) - return grub_error (GRUB_ERR_IO, "no APM found"); + return grub_error (GRUB_ERR_IO, N_("no APM found")); grub_printf_ (N_("Version %u.%u\n" "32-bit CS = 0x%x, len = 0x%x, offset = 0x%x\n" diff --git a/grub-core/commands/i386/pc/play.c b/grub-core/commands/i386/pc/play.c index 589b151ac..32c34a810 100644 --- a/grub-core/commands/i386/pc/play.c +++ b/grub-core/commands/i386/pc/play.c @@ -181,7 +181,8 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), { if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name or tempo and notes required"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("filename or tempo and notes expected")); if (argc == 1) { diff --git a/grub-core/commands/keystatus.c b/grub-core/commands/keystatus.c index cf37ad05f..f4aceae89 100644 --- a/grub-core/commands/keystatus.c +++ b/grub-core/commands/keystatus.c @@ -78,11 +78,11 @@ grub_cmd_keystatus (grub_extcmd_context_t ctxt, FOR_ACTIVE_TERM_INPUTS (term) if (!term->getkeystatus) - return grub_error (GRUB_ERR_TEST_FAILURE, "false"); + return grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); else nterms++; if (!nterms) - return grub_error (GRUB_ERR_TEST_FAILURE, "false"); + return grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); return 0; } @@ -91,7 +91,7 @@ grub_cmd_keystatus (grub_extcmd_context_t ctxt, if (mods >= 0 && (mods & expect_mods) != 0) return 0; else - return grub_error (GRUB_ERR_TEST_FAILURE, "false"); + return grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); } static grub_extcmd_t cmd; diff --git a/grub-core/commands/legacycfg.c b/grub-core/commands/legacycfg.c index f33abeac5..fb06401e9 100644 --- a/grub-core/commands/legacycfg.c +++ b/grub-core/commands/legacycfg.c @@ -454,7 +454,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), } while (0); - return grub_error (GRUB_ERR_BAD_OS, "couldn't load file %s\n", + return grub_error (GRUB_ERR_BAD_OS, "couldn't load file %s", args[0]); } @@ -468,7 +468,8 @@ grub_cmd_legacy_initrd (struct grub_command *mycmd __attribute__ ((unused)), { cmd = grub_command_find ("initrd16"); if (!cmd) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "command initrd16 not found"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), + "initrd16"); return cmd->func (cmd, argc, args); } @@ -476,13 +477,14 @@ grub_cmd_legacy_initrd (struct grub_command *mycmd __attribute__ ((unused)), { cmd = grub_command_find ("module"); if (!cmd) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "command module not found"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), + "module"); return cmd->func (cmd, argc, args); } return grub_error (GRUB_ERR_BAD_ARGUMENT, - "you need to load the kernel first"); + N_("you need to load the kernel first")); } static grub_err_t @@ -495,7 +497,8 @@ grub_cmd_legacy_initrdnounzip (struct grub_command *mycmd __attribute__ ((unused { cmd = grub_command_find ("initrd16"); if (!cmd) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "command initrd16 not found"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), + "initrd16"); return cmd->func (cmd, argc, args); } @@ -511,7 +514,8 @@ grub_cmd_legacy_initrdnounzip (struct grub_command *mycmd __attribute__ ((unused newargs[0] = nounzipbuf; cmd = grub_command_find ("module"); if (!cmd) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "command module not found"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), + "module"); err = cmd->func (cmd, argc + 1, newargs); grub_free (newargs); @@ -519,7 +523,7 @@ grub_cmd_legacy_initrdnounzip (struct grub_command *mycmd __attribute__ ((unused } return grub_error (GRUB_ERR_BAD_ARGUMENT, - "you need to load the kernel first"); + N_("you need to load the kernel first")); } static grub_err_t diff --git a/grub-core/commands/parttool.c b/grub-core/commands/parttool.c index e9fac01e6..983c07e88 100644 --- a/grub-core/commands/parttool.c +++ b/grub-core/commands/parttool.c @@ -269,7 +269,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), break; } if (! cur) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unrecognised argument %s", + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), args[i]); ptool = cur; pargs = (struct grub_parttool_args *) diff --git a/grub-core/commands/password_pbkdf2.c b/grub-core/commands/password_pbkdf2.c index 4f50b327a..0c627da2f 100644 --- a/grub-core/commands/password_pbkdf2.c +++ b/grub-core/commands/password_pbkdf2.c @@ -94,7 +94,7 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), if (grub_memcmp (args[1], "grub.pbkdf2.sha512.", sizeof ("grub.pbkdf2.sha512.") - 1) != 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "incorrect PBKDF2 password"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid PBKDF2 password")); ptr = args[1] + sizeof ("grub.pbkdf2.sha512.") - 1; @@ -103,10 +103,12 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), return grub_errno; pass->c = grub_strtoul (ptr, &ptr, 0); + if (grub_errno) + return grub_errno; if (*ptr != '.') { grub_free (pass); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "incorrect PBKDF2 password"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid PBKDF2 password")); } ptr++; @@ -114,7 +116,7 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), if (!ptr2 || ((ptr2 - ptr) & 1) || grub_strlen (ptr2 + 1) & 1) { grub_free (pass); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "incorrect PBKDF2 password"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid PBKDF2 password")); } pass->saltlen = (ptr2 - ptr) >> 1; @@ -137,7 +139,7 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), grub_free (pass->salt); grub_free (pass); return grub_error (GRUB_ERR_BAD_ARGUMENT, - "incorrect PBKDF2 password"); + N_("invalid PBKDF2 password")); } *ptro = (hex1 << 4) | hex2; @@ -166,7 +168,7 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), grub_free (pass->salt); grub_free (pass); return grub_error (GRUB_ERR_BAD_ARGUMENT, - "incorrect PBKDF2 password"); + N_("invalid PBKDF2 password")); } *ptro = (hex1 << 4) | hex2; diff --git a/grub-core/commands/terminal.c b/grub-core/commands/terminal.c index 4ed3f1c6e..425a41126 100644 --- a/grub-core/commands/terminal.c +++ b/grub-core/commands/terminal.c @@ -108,7 +108,8 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled, if (term) break; if (again) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown terminal '%s'\n", + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("terminal `%s' isn't found"), args[i]); for (aut = autoloads; aut; aut = aut->next) if (grub_strcmp (args[i], aut->name) == 0 @@ -126,7 +127,8 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled, break; } if (!aut) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown terminal '%s'\n", + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("terminal `%s' isn't found"), args[i]); again = 1; } diff --git a/grub-core/commands/test.c b/grub-core/commands/test.c index 50d5aba5e..3a0e0e069 100644 --- a/grub-core/commands/test.c +++ b/grub-core/commands/test.c @@ -416,7 +416,7 @@ grub_cmd_test (grub_command_t cmd __attribute__ ((unused)), argc--; return test_parse (args, &argn, argc) ? GRUB_ERR_NONE - : grub_error (GRUB_ERR_TEST_FAILURE, "false"); + : grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); } static grub_command_t cmd_1, cmd_2; diff --git a/grub-core/commands/time.c b/grub-core/commands/time.c index 224f92b3f..40d496e7b 100644 --- a/grub-core/commands/time.c +++ b/grub-core/commands/time.c @@ -35,12 +35,12 @@ grub_cmd_time (grub_command_t ctxt __attribute__ ((unused)), grub_uint32_t end; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "command expected"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("no command is specified")); cmd = grub_command_find (args[0]); if (!cmd) - return grub_error (GRUB_ERR_UNKNOWN_COMMAND, "Unknown command `%s'\n", + return grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("can't find command `%s'"), args[0]); start = grub_get_time_ms (); diff --git a/grub-core/commands/true.c b/grub-core/commands/true.c index a00af1433..b76682d06 100644 --- a/grub-core/commands/true.c +++ b/grub-core/commands/true.c @@ -36,7 +36,7 @@ grub_cmd_false (struct grub_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused))) { - return grub_error (GRUB_ERR_TEST_FAILURE, "false"); + return grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); } static grub_command_t cmd_true, cmd_false; diff --git a/grub-core/commands/videoinfo.c b/grub-core/commands/videoinfo.c index 261d58613..7d2b0dac7 100644 --- a/grub-core/commands/videoinfo.c +++ b/grub-core/commands/videoinfo.c @@ -126,7 +126,9 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), if (grub_errno) return grub_errno; if (*ptr != 'x') - return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid mode specification"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("invalid video mode specification `%s'"), + args[0]); ptr++; height = grub_strtoul (ptr, &ptr, 0); if (grub_errno) diff --git a/grub-core/disk/arc/arcdisk.c b/grub-core/disk/arc/arcdisk.c index 389851901..10cbc8759 100644 --- a/grub-core/disk/arc/arcdisk.c +++ b/grub-core/disk/arc/arcdisk.c @@ -258,7 +258,7 @@ grub_arcdisk_read (grub_disk_t disk, grub_disk_addr_t sector, totl, &count)) return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx " - " from `%s'"), + "from `%s'"), (unsigned long long) sector, disk->name); totl -= count; @@ -294,7 +294,7 @@ grub_arcdisk_write (grub_disk_t disk, grub_disk_addr_t sector, if (GRUB_ARC_FIRMWARE_VECTOR->write (last_handle, buf, totl, &count)) return grub_error (GRUB_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx " - " from `%s'"), + "to `%s'"), (unsigned long long) sector, disk->name); totl -= count; diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c index a247e6327..875c7eae6 100644 --- a/grub-core/disk/diskfilter.c +++ b/grub-core/disk/diskfilter.c @@ -402,7 +402,7 @@ grub_diskfilter_read_node (const struct grub_diskfilter_node *node, 0, size << GRUB_DISK_SECTOR_BITS, buf); else return grub_error (GRUB_ERR_UNKNOWN_DEVICE, - "physical volume %s not found", node->pv->name); + N_("physical volume %s not found"), node->pv->name); } if (node->lv) @@ -601,7 +601,8 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, buf, read_sector + b, read_size) : grub_error (GRUB_ERR_BAD_DEVICE, - "raid6rec is not loaded")); + N_("module `%s' isn't loaded"), + "raid6rec")); } else { @@ -610,7 +611,8 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector, buf, read_sector + b, read_size) : grub_error (GRUB_ERR_BAD_DEVICE, - "raid5rec is not loaded")); + N_("module `%s' isn't loaded"), + "raid5rec")); } if (err) diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c index 85aa28fcf..779f2a624 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -533,7 +533,10 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, (grub_efi_uintn_t) size << disk->log_sector_size, buf); if (status != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_READ_ERROR, "efidisk read error"); + return grub_error (GRUB_ERR_READ_ERROR, + N_("failure reading sector 0x%llx from `%s'"), + (unsigned long long) sector, + disk->name); return GRUB_ERR_NONE; } @@ -559,7 +562,9 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector, (grub_efi_uintn_t) size << disk->log_sector_size, (void *) buf); if (status != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_WRITE_ERROR, "efidisk write error"); + return grub_error (GRUB_ERR_WRITE_ERROR, + N_("failure writing sector 0x%llx to `%s'"), + (unsigned long long) sector, disk->name); return GRUB_ERR_NONE; } diff --git a/grub-core/disk/i386/pc/biosdisk.c b/grub-core/disk/i386/pc/biosdisk.c index e989378c9..8f40f8d17 100644 --- a/grub-core/disk/i386/pc/biosdisk.c +++ b/grub-core/disk/i386/pc/biosdisk.c @@ -465,7 +465,7 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, int i; if (cmd) - return grub_error (GRUB_ERR_WRITE_ERROR, "can\'t write to cdrom"); + return grub_error (GRUB_ERR_WRITE_ERROR, N_("cannot write to cdrom")); for (i = 0; i < GRUB_BIOSDISK_CDROM_RETRY_COUNT; i++) if (! grub_biosdisk_rw_int13_extensions (0x42, data->drive, dap)) @@ -473,7 +473,7 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, if (i == GRUB_BIOSDISK_CDROM_RETRY_COUNT) return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx " - " from `%s'"), + "from `%s'"), (unsigned long long) sector, disk->name); } @@ -497,7 +497,9 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, 1024 /* cylinders */ * 256 /* heads */ * 63 /* spt */) - return grub_error (GRUB_ERR_OUT_OF_RANGE, "%s out of disk", disk->name); + return grub_error (GRUB_ERR_OUT_OF_RANGE, + N_("attempt to read or write outside of disk `%s'"), + disk->name); soff = ((grub_uint32_t) sector) % data->sectors + 1; head = ((grub_uint32_t) sector) / data->sectors; @@ -516,12 +518,12 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, { case GRUB_BIOSDISK_READ: return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx " - " from `%s'"), + "from `%s'"), (unsigned long long) sector, disk->name); case GRUB_BIOSDISK_WRITE: return grub_error (GRUB_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx " - " from `%s'"), + "to `%s'"), (unsigned long long) sector, disk->name); } @@ -587,7 +589,7 @@ grub_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector, struct grub_biosdisk_data *data = disk->data; if (data->flags & GRUB_BIOSDISK_FLAG_CDROM) - return grub_error (GRUB_ERR_IO, "can't write to CDROM"); + return grub_error (GRUB_ERR_IO, N_("cannot write to cdrom")); while (size) { diff --git a/grub-core/disk/ieee1275/nand.c b/grub-core/disk/ieee1275/nand.c index 1bc511eda..7e24cfbd9 100644 --- a/grub-core/disk/ieee1275/nand.c +++ b/grub-core/disk/ieee1275/nand.c @@ -179,7 +179,7 @@ grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector, if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result)) return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx " - " from `%s'"), + "from `%s'"), (unsigned long long) sector, disk->name); diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c index 9c6dc063d..80bc06a45 100644 --- a/grub-core/disk/ieee1275/ofdisk.c +++ b/grub-core/disk/ieee1275/ofdisk.c @@ -366,7 +366,7 @@ grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector, &actual); if (actual != (grub_ssize_t) (size << GRUB_DISK_SECTOR_BITS)) return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx " - " from `%s'"), + "from `%s'"), (unsigned long long) sector, disk->name); @@ -386,7 +386,7 @@ grub_ofdisk_write (grub_disk_t disk, grub_disk_addr_t sector, &actual); if (actual != (grub_ssize_t) (size << GRUB_DISK_SECTOR_BITS)) return grub_error (GRUB_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx " - " from `%s'"), + "to `%s'"), (unsigned long long) sector, disk->name); diff --git a/grub-core/disk/scsi.c b/grub-core/disk/scsi.c index 508bc27f6..37c5ad3b3 100644 --- a/grub-core/disk/scsi.c +++ b/grub-core/disk/scsi.c @@ -26,6 +26,7 @@ #include #include #include +#include GRUB_MOD_LICENSE ("GPLv3+"); @@ -718,7 +719,7 @@ grub_scsi_write (grub_disk_t disk __attribute((unused)), scsi = disk->data; if (scsi->devtype == grub_scsi_devtype_cdrom) - return grub_error (GRUB_ERR_IO, "no CD burning"); + return grub_error (GRUB_ERR_IO, N_("cannot write to cdrom")); while (size) { diff --git a/grub-core/fs/bfs.c b/grub-core/fs/bfs.c index 80b28745e..095764ffe 100644 --- a/grub-core/fs/bfs.c +++ b/grub-core/fs/bfs.c @@ -216,7 +216,7 @@ read_bfs_file (grub_disk_t disk, if (off + len > grub_bfs_to_cpu64 (ino->size)) return grub_error (GRUB_ERR_OUT_OF_RANGE, - "attempt to read past the end of file"); + N_("attempt to read past the end of file")); if (off < (grub_bfs_to_cpu64 (ino->max_direct_range) << RANGE_SHIFT)) { diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 5dae34615..654abc75b 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -574,7 +574,9 @@ find_device (struct grub_btrfs_data *data, grub_uint64_t id, int do_rescan) grub_device_iterate (hook); if (!dev_found) { - grub_error (GRUB_ERR_BAD_FS, "couldn't find a member device"); + grub_error (GRUB_ERR_BAD_FS, + N_("couldn't find a necesssary member device " + "of multi-device filesystem")); return NULL; } data->n_devices_attached++; diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c index 6023d74df..7bd55b12d 100644 --- a/grub-core/fs/ntfs.c +++ b/grub-core/fs/ntfs.c @@ -487,7 +487,8 @@ read_data (struct grub_ntfs_attr *at, char *pa, char *dest, return (grub_ntfscomp_func) ? grub_ntfscomp_func (at, dest, ofs, len, ctx, vcn) : - grub_error (GRUB_ERR_BAD_FS, "ntfscomp module not loaded"); + grub_error (GRUB_ERR_BAD_FS, N_("module `%s' isn't loaded"), + "ntfscomp"); } static grub_err_t diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c index 1bd350a7a..8c1e9ae87 100644 --- a/grub-core/fs/zfs/zfs.c +++ b/grub-core/fs/zfs/zfs.c @@ -415,7 +415,7 @@ zio_checksum_verify (zio_cksum_t zc, grub_uint32_t checksum, (unsigned long long) zc.zc_word[1], (unsigned long long) zc.zc_word[2], (unsigned long long) zc.zc_word[3]); - return grub_error (GRUB_ERR_BAD_FS, "checksum verification failed"); + return grub_error (GRUB_ERR_BAD_FS, N_("checksum verification failed")); } return GRUB_ERR_NONE; @@ -1204,7 +1204,9 @@ read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc, sector = DVA_OFFSET_TO_PHYS_SECTOR (offset); if (!desc->dev) { - return grub_error (GRUB_ERR_BAD_FS, "member drive unknown"); + return grub_error (GRUB_ERR_BAD_FS, + N_("couldn't find a necesssary member device " + "of multi-device filesystem")); } /* read in a data block */ return grub_disk_read (desc->dev->disk, sector, 0, len, buf); @@ -1608,7 +1610,9 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, if (encrypted) { if (!grub_zfs_decrypt) - err = grub_error (GRUB_ERR_BAD_FS, "zfscrypt module not loaded"); + err = grub_error (GRUB_ERR_BAD_FS, + N_("module `%s' isn't loaded"), + "zfscrypt"); else { unsigned i, besti = 0; diff --git a/grub-core/fs/zfs/zfscrypt.c b/grub-core/fs/zfs/zfscrypt.c index f8815c918..4ea53b863 100644 --- a/grub-core/fs/zfs/zfscrypt.c +++ b/grub-core/fs/zfs/zfscrypt.c @@ -288,7 +288,7 @@ grub_zfs_decrypt_real (grub_crypto_cipher_handle_t cipher, if (!cipher) return grub_error (GRUB_ERR_ACCESS_DENIED, - "no decryption key available");; + N_("no decryption key available")); err = algo_decrypt (cipher, algo, (grub_uint8_t *) buf, (grub_uint8_t *) buf, @@ -300,7 +300,7 @@ grub_zfs_decrypt_real (grub_crypto_cipher_handle_t cipher, for (i = 0; i < 3; i++) if (grub_zfs_to_cpu32 (expected_mac[i], endian) != grub_be_to_cpu32 (mac[i])) - return grub_error (GRUB_ERR_BAD_FS, "MAC verification failed"); + return grub_error (GRUB_ERR_BAD_FS, N_("MAC verification failed")); return GRUB_ERR_NONE; } diff --git a/grub-core/fs/zfs/zfsinfo.c b/grub-core/fs/zfs/zfsinfo.c index 41cb759c8..ef7a22195 100644 --- a/grub-core/fs/zfs/zfsinfo.c +++ b/grub-core/fs/zfs/zfsinfo.c @@ -249,7 +249,7 @@ grub_cmd_zfsinfo (grub_command_t cmd __attribute__ ((unused)), int argc, int found; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') { @@ -325,7 +325,7 @@ grub_cmd_zfs_bootfs (grub_command_t cmd __attribute__ ((unused)), int argc, grub_uint64_t mdnobj; if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "filesystem name required"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); devname = grub_file_get_device_name (args[0]); if (grub_errno) diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c index 4ddf06487..d11ace7e8 100644 --- a/grub-core/gettext/gettext.c +++ b/grub-core/gettext/gettext.c @@ -373,7 +373,7 @@ grub_cmd_translate (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "text to translate required"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); const char *translation; translation = grub_gettext_translate (args[0]); diff --git a/grub-core/hello/hello.c b/grub-core/hello/hello.c index 2c9e90f72..0c595e2ef 100644 --- a/grub-core/hello/hello.c +++ b/grub-core/hello/hello.c @@ -33,7 +33,7 @@ grub_cmd_hello (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - grub_printf ("Hello World\n"); + grub_printf ("%s\n", _("Hello World")); return 0; } diff --git a/grub-core/io/gzio.c b/grub-core/io/gzio.c index 5dbf8bd0b..cc81aaaa1 100644 --- a/grub-core/io/gzio.c +++ b/grub-core/io/gzio.c @@ -1172,20 +1172,20 @@ test_zlib_header (grub_gzio_t gzio) /* Check that compression method is DEFLATE. */ if ((cmf & 0xf) != DEFLATED) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "unsupported gzip format"); + grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, N_("unsupported gzip format")); return 0; } if ((cmf * 256 + flg) % 31) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "unsupported gzip format"); + grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, N_("unsupported gzip format")); return 0; } /* Dictionary isn't supported. */ if (flg & 0x20) { - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "unsupported gzip format"); + grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, N_("unsupported gzip format")); return 0; } diff --git a/grub-core/io/lzopio.c b/grub-core/io/lzopio.c index 7eb0c1b80..9f0dba5dc 100644 --- a/grub-core/io/lzopio.c +++ b/grub-core/io/lzopio.c @@ -509,7 +509,7 @@ grub_lzopio_read (grub_file_t file, char *buf, grub_size_t len) return ret; CORRUPTED: - grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "lzop file corrupted"); + grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, N_("lzop file corrupted")); return -1; } diff --git a/grub-core/io/xzio.c b/grub-core/io/xzio.c index 991b7acc7..ae30e6f80 100644 --- a/grub-core/io/xzio.c +++ b/grub-core/io/xzio.c @@ -278,7 +278,7 @@ grub_xzio_read (grub_file_t file, char *buf, grub_size_t len) case XZ_DATA_ERROR: case XZ_BUF_ERROR: grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, - "file corrupted or unsupported block options"); + N_("xz file corrupted or unsupported block options")); return -1; default: break; diff --git a/grub-core/kern/corecmd.c b/grub-core/kern/corecmd.c index 687692f3c..136c5a365 100644 --- a/grub-core/kern/corecmd.c +++ b/grub-core/kern/corecmd.c @@ -68,7 +68,7 @@ grub_core_cmd_unset (struct grub_command *cmd __attribute__ ((unused)), { if (argc < 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, - "no environment variable specified"); + N_("one argument expected")); grub_env_unset (argv[0]); return 0; @@ -83,7 +83,7 @@ grub_core_cmd_insmod (struct grub_command *cmd __attribute__ ((unused)), grub_dl_t mod; if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); p = grub_strchr (argv[0], '/'); if (! p) diff --git a/grub-core/kern/disk.c b/grub-core/kern/disk.c index 9f4ca605d..7207cb9d9 100644 --- a/grub-core/kern/disk.c +++ b/grub-core/kern/disk.c @@ -284,7 +284,7 @@ grub_disk_open (const char *name) disk->partition = grub_partition_probe (disk, p + 1); if (! disk->partition) { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such partition"); + grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("no such partition")); goto fail; } } diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index ebeab0ec4..cb49243d2 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -373,7 +373,7 @@ grub_strtoul (const char *str, char **end, int base) #if GRUB_CPU_SIZEOF_LONG != 8 if (num > ~0UL) { - grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected"); + grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected")); return ~0UL; } #endif @@ -427,7 +427,8 @@ grub_strtoull (const char *str, char **end, int base) /* NUM * BASE + DIGIT > ~0ULL */ if (num > grub_divmod64 (~0ULL - digit, base, 0)) { - grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected"); + grub_error (GRUB_ERR_OUT_OF_RANGE, + N_("overflow is detected")); return ~0ULL; } @@ -437,7 +438,8 @@ grub_strtoull (const char *str, char **end, int base) if (! found) { - grub_error (GRUB_ERR_BAD_NUMBER, "unrecognized number"); + grub_error (GRUB_ERR_BAD_NUMBER, + N_("unrecognized number")); return 0; } diff --git a/grub-core/kern/rescue_parser.c b/grub-core/kern/rescue_parser.c index 9c85ba6bd..656342d27 100644 --- a/grub-core/kern/rescue_parser.c +++ b/grub-core/kern/rescue_parser.c @@ -23,6 +23,7 @@ #include #include #include +#include grub_err_t grub_rescue_parse_line (char *line, grub_reader_getline_t getline) @@ -63,7 +64,7 @@ grub_rescue_parse_line (char *line, grub_reader_getline_t getline) } else { - grub_printf ("Unknown command `%s'\n", name); + grub_printf_ (N_("Unknown command `%s'.\n"), name); if (grub_command_find ("help")) grub_printf ("Try `help' for usage\n"); } diff --git a/grub-core/lib/legacy_parse.c b/grub-core/lib/legacy_parse.c index 07a91dad4..775eaad1f 100644 --- a/grub-core/lib/legacy_parse.c +++ b/grub-core/lib/legacy_parse.c @@ -22,6 +22,7 @@ #include #include #include +#include struct legacy_command { @@ -801,7 +802,7 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix) len = grub_strlen (corig); if (!slash) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid color specification `%s'", + grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid color specification `%s'"), args[0]); return NULL; } diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c index 73b13c5ad..064bd7ce6 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -241,7 +241,8 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), size = grub_file_size (file); if (!size) { - grub_error (GRUB_ERR_BAD_OS, "file is empty"); + grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), + filename); goto fail; } pages = (((grub_efi_uintn_t) size + ((1 << 12) - 1)) >> 12); diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c index 7372a590c..62510288c 100644 --- a/grub-core/loader/multiboot_mbi2.c +++ b/grub-core/loader/multiboot_mbi2.c @@ -33,6 +33,7 @@ #include #include #include +#include #if defined (GRUB_MACHINE_EFI) #include @@ -98,7 +99,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) if (len < 32) { grub_free (buffer); - return grub_error (GRUB_ERR_BAD_OS, "file too small"); + return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), filename); } COMPILE_TIME_ASSERT (MULTIBOOT_HEADER_ALIGN % 4 == 0); diff --git a/grub-core/mmap/mmap.c b/grub-core/mmap/mmap.c index 022ad17f2..0b734dde3 100644 --- a/grub-core/mmap/mmap.c +++ b/grub-core/mmap/mmap.c @@ -361,7 +361,7 @@ grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)), } if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "badram string required"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); grub_dprintf ("badram", "executing badram\n"); diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index f1e053cc7..f1ac86a82 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -302,7 +302,8 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), grub_uint8_t taglength; if (argc < 4) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "4 arguments expected"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("four arguments expected")); FOR_NET_NETWORK_LEVEL_INTERFACES (inter) if (grub_strcmp (inter->name, args[1]) == 0) @@ -405,7 +406,8 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), } return grub_error (GRUB_ERR_BAD_ARGUMENT, - "unrecognised format specification %s", args[3]); + N_("unrecognised DHCP option format specification `%s'"), + args[3]); } /* FIXME: allow to specify mac address. */ @@ -546,7 +548,8 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), continue; grub_error_push (); grub_net_network_level_interface_unregister (&ifaces[j]); - err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "couldn't configure %s", + err = grub_error (GRUB_ERR_FILE_NOT_FOUND, + N_("couldn't autoconfigure %s"), ifaces[j].card->name); } diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c index 1d252f984..ee3029e0b 100644 --- a/grub-core/net/dns.c +++ b/grub-core/net/dns.c @@ -436,7 +436,8 @@ grub_net_dns_lookup (const char *name, } if (!n_servers) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no DNS servers"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("no DNS servers configured")); *naddresses = 0; if (cache) @@ -491,7 +492,7 @@ grub_net_dns_lookup (const char *name, { grub_free (data.name); return grub_error (GRUB_ERR_BAD_ARGUMENT, - "domain component is too long"); + N_("domain name component is too long")); } *optr = (dot - iptr); optr++; @@ -583,14 +584,16 @@ grub_net_dns_lookup (const char *name, if (*data.naddresses) return GRUB_ERR_NONE; if (data.dns_err) - return grub_error (GRUB_ERR_NET_NO_DOMAIN, "no DNS domain found"); + return grub_error (GRUB_ERR_NET_NO_DOMAIN, + N_("no DNS record found")); if (err) { grub_errno = err; return err; } - return grub_error (GRUB_ERR_TIMEOUT, "no DNS reply received"); + return grub_error (GRUB_ERR_TIMEOUT, + N_("no DNS reply received")); } static grub_err_t diff --git a/grub-core/net/http.c b/grub-core/net/http.c index 39f53f232..49edeb1d9 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -101,7 +101,7 @@ parse_line (grub_file_t file, http_data_t data, char *ptr, grub_size_t len) int code; if (grub_memcmp (ptr, "HTTP/1.1 ", sizeof ("HTTP/1.1 ") - 1) != 0) return grub_error (GRUB_ERR_NET_INVALID_RESPONSE, - "unsupported HTTP response"); + N_("unsupported HTTP response")); ptr += sizeof ("HTTP/1.1 ") - 1; code = grub_strtoul (ptr, &ptr, 10); if (grub_errno) @@ -112,11 +112,11 @@ parse_line (grub_file_t file, http_data_t data, char *ptr, grub_size_t len) break; case 404: data->err = GRUB_ERR_FILE_NOT_FOUND; - data->errmsg = grub_xasprintf ("file `%s' not found", data->filename); + data->errmsg = grub_xasprintf (_("file `%s' not found"), data->filename); return GRUB_ERR_NONE; default: data->err = GRUB_ERR_NET_UNKNOWN_ERROR; - data->errmsg = grub_xasprintf ("unsupported HTTP error %d: %s", + data->errmsg = grub_xasprintf (_("unsupported HTTP error %d: %s"), code, ptr); return GRUB_ERR_NONE; } diff --git a/grub-core/net/net.c b/grub-core/net/net.c index b6647e4cd..b749e607d 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -191,7 +191,7 @@ grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf, return GRUB_ERR_NONE; } return grub_error (GRUB_ERR_TIMEOUT, - "timeout: could not resolve hardware address"); + N_("timeout: could not resolve hardware address")); } void @@ -347,7 +347,8 @@ grub_cmd_ipv6_autoconf (struct grub_command *cmd __attribute__ ((unused)), { if (slaacs[j]->slaac_counter) continue; - err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "couldn't configure %s", + err = grub_error (GRUB_ERR_FILE_NOT_FOUND, + N_("couldn't autoconfigure %s"), ifaces[j]->card->name); } @@ -630,7 +631,8 @@ grub_net_route_address (grub_net_network_level_address_t addr, bestroute = route; } if (bestroute == NULL) - return grub_error (GRUB_ERR_NET_NO_ROUTE, "destination unreachable"); + return grub_error (GRUB_ERR_NET_NO_ROUTE, + N_("destination unreachable")); if (!bestroute->is_gateway) { @@ -642,7 +644,8 @@ grub_net_route_address (grub_net_network_level_address_t addr, curtarget = bestroute->gw; } - return grub_error (GRUB_ERR_NET_ROUTE_LOOP, "route loop detected"); + return grub_error (GRUB_ERR_NET_ROUTE_LOOP, + N_("route loop detected")); } static grub_err_t @@ -1168,7 +1171,8 @@ grub_net_open_real (const char *name) } if (!server) { - grub_error (GRUB_ERR_NET_BAD_ADDRESS, "no server"); + grub_error (GRUB_ERR_NET_BAD_ADDRESS, + N_("no server is specified")); return NULL; } @@ -1198,7 +1202,10 @@ grub_net_open_real (const char *name) return ret; } } - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such device"); + + /* Restore original error. */ + grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), + name); return NULL; } @@ -1375,7 +1382,7 @@ grub_net_fs_read_real (grub_file_t file, char *buf, grub_size_t len) else return total; } - grub_error (GRUB_ERR_TIMEOUT, "timeout reading '%s'", net->name); + grub_error (GRUB_ERR_TIMEOUT, N_("timeout reading '%s'"), net->name); return -1; } @@ -1488,7 +1495,7 @@ GRUB_MOD_INIT(net) N_("Add a network address.")); cmd_slaac = grub_register_command ("net_ipv6_autoconf", grub_cmd_ipv6_autoconf, - "[CARD [HWADDRESS]]", + N_("[CARD [HWADDRESS]]"), N_("Perform an IPV6 autoconfiguration")); cmd_deladdr = grub_register_command ("net_del_addr", grub_cmd_deladdr, diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c index e830d94d3..ae86d2b86 100644 --- a/grub-core/net/tcp.c +++ b/grub-core/net/tcp.c @@ -657,9 +657,11 @@ grub_net_tcp_open (char *server, { grub_list_remove (GRUB_AS_LIST (socket)); if (socket->they_reseted) - grub_error (GRUB_ERR_NET_PORT_CLOSED, "port closed"); + grub_error (GRUB_ERR_NET_PORT_CLOSED, + N_("connection refused")); else - grub_error (GRUB_ERR_NET_NO_ANSWER, "no answer"); + grub_error (GRUB_ERR_NET_NO_ANSWER, + N_("connection timeout")); grub_netbuff_free (nb); destroy_pq (socket); diff --git a/grub-core/normal/context.c b/grub-core/normal/context.c index b85f7c61c..e9923ccdc 100644 --- a/grub-core/normal/context.c +++ b/grub-core/normal/context.c @@ -186,7 +186,7 @@ grub_cmd_export (struct grub_command *cmd __attribute__ ((unused)), if (argc < 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, - "no environment variable specified"); + N_("one argument expected")); for (i = 0; i < argc; i++) grub_env_export (args[i]); diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c index 8b428f220..0833937e0 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -373,7 +373,9 @@ menu_init (int entry, grub_menu_t menu, int nested) } } else - grub_error (GRUB_ERR_BAD_MODULE, "no gfxmenu found"); + grub_error (GRUB_ERR_BAD_MODULE, + N_("module `%s' isn't loaded"), + "gfxmenu"); grub_print_error (); grub_wait_after_message (); } diff --git a/grub-core/normal/misc.c b/grub-core/normal/misc.c index 360aa552d..262f3eebd 100644 --- a/grub-core/normal/misc.c +++ b/grub-core/normal/misc.c @@ -115,7 +115,7 @@ grub_normal_print_device_info (const char *name) grub_printf (_(" - Partition start at %llu"), (unsigned long long) grub_partition_get_start (dev->disk->partition)); if (grub_disk_get_size (dev->disk) == GRUB_DISK_SIZE_UNKNOWN) - grub_puts_ (" - Total size unknown"); + grub_puts_ (N_(" - Total size unknown")); else grub_printf (_(" - Total size %llu sectors"), (unsigned long long) grub_disk_get_size (dev->disk)); diff --git a/grub-core/parttool/msdospart.c b/grub-core/parttool/msdospart.c index 8eb1f99d9..3ae584829 100644 --- a/grub-core/parttool/msdospart.c +++ b/grub-core/parttool/msdospart.c @@ -48,7 +48,7 @@ static grub_err_t grub_pcpart_boot (const grub_device_t dev, struct grub_msdos_partition_mbr mbr; if (dev->disk->partition->offset) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a primary partition"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("not a primary partition")); index = dev->disk->partition->index; part = dev->disk->partition; @@ -126,7 +126,9 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, || grub_msdos_partition_is_extended (type)) { dev->disk->partition = part; - return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid type"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("the partition type 0x%x isn't " + "valid")); } mbr.entries[index].type = type; diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c index fcfd5ce9b..a95e1b6a0 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -26,6 +26,7 @@ #include #include #include +#include /* Max digits for a char is 3 (0xFF is 255), similarly for an int it is sizeof (int) * 3, and one extra for a possible -ve sign. */ @@ -157,7 +158,8 @@ grub_script_return (grub_command_t cmd __attribute__((unused)), unsigned long n; if (! scope || argc > 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "not in function scope"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("not in function scope")); if (argc == 0) { @@ -297,7 +299,8 @@ static grub_err_t grub_script_env_set (const char *name, const char *val) { if (grub_env_special (name)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad variable name"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("invalid variable name `%s'"), name); return grub_env_set (name, val); } @@ -579,7 +582,8 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) if (argv.argc < 2 || ! argv.args[1]) { grub_script_argv_free (&argv); - return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing arguments"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("no command is specified")); } invert = 1; @@ -644,7 +648,7 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) if (ret == GRUB_ERR_TEST_FAILURE) grub_errno = ret = GRUB_ERR_NONE; else if (ret == GRUB_ERR_NONE) - ret = grub_error (GRUB_ERR_TEST_FAILURE, "false"); + ret = grub_error (GRUB_ERR_TEST_FAILURE, N_("false")); else { grub_print_error (); diff --git a/grub-core/script/function.c b/grub-core/script/function.c index ae9240116..d36655e51 100644 --- a/grub-core/script/function.c +++ b/grub-core/script/function.c @@ -106,7 +106,7 @@ grub_script_function_find (char *functionname) tmp[20] = 0; /* Avoid truncating inside UTF-8 character. */ tmp[grub_getend (tmp, tmp + grub_strlen (tmp))] = 0; - grub_error (GRUB_ERR_UNKNOWN_COMMAND, "unknown command `%s'", tmp); + grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("can't find command `%s'"), tmp); } return func; diff --git a/grub-core/term/ns8250.c b/grub-core/term/ns8250.c index 996fc81f3..e6947f5e6 100644 --- a/grub-core/term/ns8250.c +++ b/grub-core/term/ns8250.c @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef GRUB_MACHINE_PCBIOS #include @@ -194,19 +195,23 @@ serial_hw_configure (struct grub_serial_port *port, divisor = serial_get_divisor (port, config); if (divisor == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad speed"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port speed")); if (config->parity != GRUB_SERIAL_PARITY_NONE && config->parity != GRUB_SERIAL_PARITY_ODD && config->parity != GRUB_SERIAL_PARITY_EVEN) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported parity"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port parity")); if (config->stop_bits != GRUB_SERIAL_STOP_BITS_1 && config->stop_bits != GRUB_SERIAL_STOP_BITS_2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported stop bits"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port stop bits number")); if (config->word_len < 5 || config->word_len > 8) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported word length"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port word length")); port->config = *config; port->configured = 0; diff --git a/grub-core/term/serial.c b/grub-core/term/serial.c index 20ab90d92..cbcc5952f 100644 --- a/grub-core/term/serial.c +++ b/grub-core/term/serial.c @@ -184,7 +184,9 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) port = grub_serial_find (name); if (!port) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown serial port"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("serial port `%s' isn't found"), + name); config = port->config; @@ -203,7 +205,8 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) else if (! grub_strcmp (state[4].arg, "even")) config.parity = GRUB_SERIAL_PARITY_EVEN; else - return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad parity"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port parity")); } if (state[5].set) @@ -213,7 +216,8 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) else if (! grub_strcmp (state[5].arg, "2")) config.stop_bits = GRUB_SERIAL_STOP_BITS_2; else - return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad number of stop bits"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("unsupported serial port stop bits number")); } /* Initialize with new settings. */ diff --git a/grub-core/term/terminfo.c b/grub-core/term/terminfo.c index e636ad5fc..5fb2d6dea 100644 --- a/grub-core/term/terminfo.c +++ b/grub-core/term/terminfo.c @@ -169,7 +169,8 @@ grub_terminfo_set_current (struct grub_term_output *term, return grub_errno; } - return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown terminfo type"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown terminfo type `%s'"), + str); } grub_err_t @@ -664,7 +665,7 @@ grub_cmd_terminfo (grub_extcmd_context_t ctxt, int argc, char **args) return grub_errno; if (*ptr != 'x') return grub_error (GRUB_ERR_BAD_ARGUMENT, - "incorrect geometry specification"); + N_("incorrect terminal dimensions specification")); ptr++; h = grub_strtoul (ptr, &ptr, 0); if (grub_errno) @@ -694,7 +695,7 @@ grub_cmd_terminfo (grub_extcmd_context_t ctxt, int argc, char **args) } return grub_error (GRUB_ERR_BAD_ARGUMENT, - "no terminal %s found or it's not handled by terminfo", + N_("terminal %s isn't found or it's not handled by terminfo"), args[0]); } diff --git a/grub-core/video/bitmap.c b/grub-core/video/bitmap.c index 5210c2eb8..67de93d8c 100644 --- a/grub-core/video/bitmap.c +++ b/grub-core/video/bitmap.c @@ -22,6 +22,7 @@ #include #include #include +#include GRUB_MOD_LICENSE ("GPLv3+"); @@ -202,7 +203,9 @@ grub_video_bitmap_load (struct grub_video_bitmap **bitmap, reader = reader->next; } - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "unsupported bitmap format"); + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + N_("bitmap file `%s' is of" + " unsupported format"), filename); } /* Return bitmap width. */ diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c index 33864223d..f5e63aee2 100644 --- a/grub-core/video/readers/jpeg.c +++ b/grub-core/video/readers/jpeg.c @@ -773,7 +773,7 @@ grub_cmd_jpegtest (grub_command_t cmd __attribute__ ((unused)), struct grub_video_bitmap *bitmap = 0; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("file name expected")); + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); grub_video_reader_jpeg (&bitmap, args[0]); if (grub_errno != GRUB_ERR_NONE) diff --git a/grub-core/video/video.c b/grub-core/video/video.c index ac4d3fbfc..cfcb70e4f 100644 --- a/grub-core/video/video.c +++ b/grub-core/video/video.c @@ -541,7 +541,7 @@ grub_video_set_mode (const char *modestring, grub_free (modevar); return grub_error (GRUB_ERR_BAD_ARGUMENT, - "no suitable mode found"); + N_("no suitable video mode found")); } /* Skip separator. */ @@ -705,7 +705,7 @@ grub_video_set_mode (const char *modestring, grub_free (modevar); return grub_error (GRUB_ERR_BAD_ARGUMENT, - "no suitable mode found"); + N_("no suitable video mode found")); } /* Initialize Video API module. */ diff --git a/include/grub/misc.h b/include/grub/misc.h index 7582d754e..611a1a0f9 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -24,6 +24,7 @@ #include #include #include +#include /* GCC version checking borrowed from glibc. */ #if defined(__GNUC__) && defined(__GNUC_MINOR__) @@ -285,7 +286,7 @@ grub_strtol (const char *str, char **end, int base) { if (magnitude > (unsigned long) GRUB_LONG_MAX + 1) { - grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected"); + grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected")); return GRUB_LONG_MIN; } return -((long) magnitude); @@ -294,7 +295,7 @@ grub_strtol (const char *str, char **end, int base) { if (magnitude > GRUB_LONG_MAX) { - grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected"); + grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected")); return GRUB_LONG_MAX; } return (long) magnitude; diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 37f4fb7ee..1ce41ee8b 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -50,7 +50,7 @@ execute_command (const char *name, int n, char **args) cmd = grub_command_find (name); if (! cmd) - grub_util_error (_("can\'t find command %s"), name); + grub_util_error (_("can't find command `%s'"), name); return (cmd->func) (cmd, n, args); } diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index fb98f1abf..2aa386fbc 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -938,7 +938,7 @@ SUFFIX (load_image) (const char *kernel_path, grub_size_t *exec_size, num_sections = grub_target_to_host16 (e->e_shnum); if (kernel_size < section_offset + section_entsize * num_sections) - grub_util_error ("invalid ELF format"); + grub_util_error (_("premature end of file %s"), kernel_path); sections = (Elf_Shdr *) (kernel_img + section_offset); @@ -1025,7 +1025,7 @@ SUFFIX (load_image) (const char *kernel_path, grub_size_t *exec_size, #endif if (! symtab_section) - grub_util_error ("no symbol table"); + grub_util_error ("%s", _("no symbol table")); } else { diff --git a/util/grub-mount.c b/util/grub-mount.c index 41b89925b..9093e264c 100644 --- a/util/grub-mount.c +++ b/util/grub-mount.c @@ -61,7 +61,7 @@ execute_command (const char *name, int n, char **args) cmd = grub_command_find (name); if (! cmd) - grub_util_error (_("can\'t find command %s"), name); + grub_util_error (_("can't find command `%s'"), name); return (cmd->func) (cmd, n, args); }