+2012-02-08 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Improve string. Gettextize.
+
2012-02-11 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Remove -Winline altogether and -Wmissing-prototypes on
#include <grub/mm.h>
#include <grub/usb.h>
#include <grub/usbserial.h>
+#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
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;
#include <grub/mm.h>
#include <grub/usb.h>
#include <grub/usbserial.h>
+#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
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;
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)
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
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;
{
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"
{
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)
{
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;
}
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;
}
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]);
}
{
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);
}
{
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
{
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);
}
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);
}
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
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 *)
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;
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++;
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;
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;
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;
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
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;
}
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;
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 ();
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;
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)
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;
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;
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)
buf, read_sector + b,
read_size) :
grub_error (GRUB_ERR_BAD_DEVICE,
- "raid6rec is not loaded"));
+ N_("module `%s' isn't loaded"),
+ "raid6rec"));
}
else
{
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)
(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;
}
(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;
}
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))
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);
}
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;
{
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);
}
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)
{
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);
&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);
&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);
#include <grub/scsi.h>
#include <grub/scsicmd.h>
#include <grub/time.h>
+#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
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)
{
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))
{
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++;
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
(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;
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);
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;
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,
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;
}
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] == ')')
{
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)
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]);
int argc __attribute__ ((unused)),
char **args __attribute__ ((unused)))
{
- grub_printf ("Hello World\n");
+ grub_printf ("%s\n", _("Hello World"));
return 0;
}
/* 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;
}
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;
}
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;
{
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;
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)
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;
}
}
#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
/* 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;
}
if (! found)
{
- grub_error (GRUB_ERR_BAD_NUMBER, "unrecognized number");
+ grub_error (GRUB_ERR_BAD_NUMBER,
+ N_("unrecognized number"));
return 0;
}
#include <grub/parser.h>
#include <grub/misc.h>
#include <grub/command.h>
+#include <grub/i18n.h>
grub_err_t
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");
}
#include <grub/err.h>
#include <grub/legacy_parse.h>
#include <grub/i386/pc/vesa_modes_table.h>
+#include <grub/i18n.h>
struct legacy_command
{
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;
}
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);
#include <grub/env.h>
#include <grub/video.h>
#include <grub/acpi.h>
+#include <grub/i18n.h>
#if defined (GRUB_MACHINE_EFI)
#include <grub/efi/efi.h>
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);
}
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");
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)
}
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. */
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);
}
}
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)
{
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++;
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
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)
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;
}
return GRUB_ERR_NONE;
}
return grub_error (GRUB_ERR_TIMEOUT,
- "timeout: could not resolve hardware address");
+ N_("timeout: could not resolve hardware address"));
}
void
{
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);
}
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)
{
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
}
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;
}
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;
}
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;
}
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,
{
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);
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]);
}
}
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 ();
}
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));
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;
|| 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;
#include <grub/lib/arg.h>
#include <grub/normal.h>
#include <grub/extcmd.h>
+#include <grub/i18n.h>
/* 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. */
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)
{
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);
}
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;
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 ();
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;
#include <grub/cpu/io.h>
#include <grub/mm.h>
#include <grub/time.h>
+#include <grub/i18n.h>
#ifdef GRUB_MACHINE_PCBIOS
#include <grub/machine/memory.h>
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;
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;
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)
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. */
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
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)
}
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]);
}
#include <grub/dl.h>
#include <grub/mm.h>
#include <grub/misc.h>
+#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
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. */
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)
grub_free (modevar);
return grub_error (GRUB_ERR_BAD_ARGUMENT,
- "no suitable mode found");
+ N_("no suitable video mode found"));
}
/* Skip separator. */
grub_free (modevar);
return grub_error (GRUB_ERR_BAD_ARGUMENT,
- "no suitable mode found");
+ N_("no suitable video mode found"));
}
/* Initialize Video API module. */
#include <grub/types.h>
#include <grub/symbol.h>
#include <grub/err.h>
+#include <grub/i18n.h>
/* GCC version checking borrowed from glibc. */
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
{
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);
{
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;
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);
}
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);
#endif
if (! symtab_section)
- grub_util_error ("no symbol table");
+ grub_util_error ("%s", _("no symbol table"));
}
else
{
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);
}