* grub-core/commands/efi/fixvideo.c: Gettextize.

* grub-core/commands/hashsum.c: Likewise.
	* grub-core/commands/i386/cmostest.c: Likewise.
	* grub-core/commands/i386/pc/drivemap.c: Likewise.
	* grub-core/commands/i386/pc/lsapm.c: Likewise.
	* grub-core/commands/i386/pc/sendkey.c: Likewise.
	* grub-core/commands/lsmmap.c: Likewise.
	* grub-core/commands/menuentry.c: Likewise.
	* grub-core/commands/mips/loongson/lsspd.c: Likewise.
	* grub-core/commands/setpci.c: Likewise.
	* grub-core/loader/i386/bsd.c: Likewise.
	* grub-core/loader/i386/linux.c: Likewise.
	* util/getroot.c: Likewise.
	* util/grub-editenv.c: Likewise.
	* util/grub-fstest.c: Likewise.
	* util/grub-mkfont.c: Likewise.
	* util/grub-mkimage.c: Likewise.
	* util/grub-mkpasswd-pbkdf2.c: Likewise.
	* util/grub-pe2elf.c: Likewise.
	* util/grub-probe.c: Likewise.
	* util/grub-setup.c: Likewise.
	* util/ieee1275/ofpath.c: Likewise.
	* util/misc.c: Likewise.
	* util/raid.c: Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-11-12 00:34:14 +01:00
parent b50787de09
commit 10f0117bf9
25 changed files with 302 additions and 260 deletions

View File

@ -1,3 +1,30 @@
2011-11-11 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/commands/efi/fixvideo.c: Gettextize.
* grub-core/commands/hashsum.c: Likewise.
* grub-core/commands/i386/cmostest.c: Likewise.
* grub-core/commands/i386/pc/drivemap.c: Likewise.
* grub-core/commands/i386/pc/lsapm.c: Likewise.
* grub-core/commands/i386/pc/sendkey.c: Likewise.
* grub-core/commands/lsmmap.c: Likewise.
* grub-core/commands/menuentry.c: Likewise.
* grub-core/commands/mips/loongson/lsspd.c: Likewise.
* grub-core/commands/setpci.c: Likewise.
* grub-core/loader/i386/bsd.c: Likewise.
* grub-core/loader/i386/linux.c: Likewise.
* util/getroot.c: Likewise.
* util/grub-editenv.c: Likewise.
* util/grub-fstest.c: Likewise.
* util/grub-mkfont.c: Likewise.
* util/grub-mkimage.c: Likewise.
* util/grub-mkpasswd-pbkdf2.c: Likewise.
* util/grub-pe2elf.c: Likewise.
* util/grub-probe.c: Likewise.
* util/grub-setup.c: Likewise.
* util/ieee1275/ofpath.c: Likewise.
* util/misc.c: Likewise.
* util/raid.c: Likewise.
2011-11-11 Robert Millan <rmh@gnu.org>
* util/getroot.c (grub_util_get_geom_abstraction): Remove

View File

@ -56,24 +56,24 @@ scan_card (grub_pci_device_t dev, grub_pci_id_t pciid)
{
grub_target_addr_t base;
grub_printf ("Found graphic card: %s\n", p->name);
grub_dprintf ("fixvideo", "Found graphic card: %s\n", p->name);
addr += 8 + p->mmio_bar * 4;
base = grub_pci_read (addr);
if ((! base) || (base & GRUB_PCI_ADDR_SPACE_IO) ||
(base & GRUB_PCI_ADDR_MEM_PREFETCH))
grub_printf ("Invalid MMIO bar %d\n", p->mmio_bar);
grub_dprintf ("fixvideo", "Invalid MMIO bar %d\n", p->mmio_bar);
else
{
base &= GRUB_PCI_ADDR_MEM_MASK;
base += p->mmio_reg;
if (*((volatile grub_uint32_t *) base) != p->mmio_old)
grub_printf ("Old value don't match\n");
grub_dprintf ("fixvideo", "Old value doesn't match\n");
else
{
*((volatile grub_uint32_t *) base) = 0;
if (*((volatile grub_uint32_t *) base))
grub_printf ("Set MMIO fails\n");
grub_dprintf ("fixvideo", "Setting MMIO fails\n");
}
}
@ -82,7 +82,7 @@ scan_card (grub_pci_device_t dev, grub_pci_id_t pciid)
p++;
}
grub_printf ("Unknown graphic card: %x\n", pciid);
grub_dprintf ("fixvideo", "Unknown graphic card: %x\n", pciid);
}
return 0;

View File

@ -141,7 +141,7 @@ check_list (const gcry_md_spec_t *hash, const char *hashfilename,
grub_file_close (file);
if (err)
{
grub_printf ("%s: READ ERROR\n", p);
grub_printf_ (N_("%s: READ ERROR\n"), p);
if (!keep)
{
grub_file_close (hashlist);
@ -155,7 +155,7 @@ check_list (const gcry_md_spec_t *hash, const char *hashfilename,
}
if (grub_crypto_memcmp (expected, actual, hash->mdlen) != 0)
{
grub_printf ("%s: HASH MISMATCH\n", p);
grub_printf_ (N_("%s: HASH MISMATCH\n"), p);
if (!keep)
{
grub_file_close (hashlist);
@ -166,7 +166,7 @@ check_list (const gcry_md_spec_t *hash, const char *hashfilename,
mismatch++;
continue;
}
grub_printf ("%s: OK\n", p);
grub_printf_ (N_("%s: OK\n"), p);
}
if (mismatch || unread)
return grub_error (GRUB_ERR_TEST_FAILURE,
@ -257,8 +257,8 @@ static grub_extcmd_t cmd, cmd_md5, cmd_sha1, cmd_sha256, cmd_sha512, cmd_crc;
GRUB_MOD_INIT(hashsum)
{
cmd = grub_register_extcmd ("hashsum", grub_cmd_hashsum, 0,
"hashsum -h HASH [-c FILE [-p PREFIX]] "
"[FILE1 [FILE2 ...]]",
N_("-h HASH [-c FILE [-p PREFIX]] "
"[FILE1 [FILE2 ...]]"),
N_("Compute or check hash checksum."),
options);
cmd_md5 = grub_register_extcmd ("md5sum", grub_cmd_hashsum, 0,

View File

@ -20,6 +20,7 @@
#include <grub/command.h>
#include <grub/misc.h>
#include <grub/cmos.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -86,11 +87,11 @@ static grub_command_t cmd, cmd_clean;
GRUB_MOD_INIT(cmostest)
{
cmd = grub_register_command ("cmostest", grub_cmd_cmostest,
"cmostest BYTE:BIT",
"Test bit at BYTE:BIT in CMOS.");
N_("BYTE:BIT"),
N_("Test bit at BYTE:BIT in CMOS."));
cmd_clean = grub_register_command ("cmosclean", grub_cmd_cmosclean,
"cmosclean BYTE:BIT",
"Clean bit at BYTE:BIT in CMOS.");
N_("BYTE:BIT"),
N_("Clean bit at BYTE:BIT in CMOS."));
}
GRUB_MOD_FINI(cmostest)

View File

@ -178,11 +178,11 @@ list_mappings (void)
/* Show: list mappings. */
if (! map_head)
{
grub_printf ("No drives have been remapped\n");
grub_puts_ (N_("No drives have been remapped"));
return GRUB_ERR_NONE;
}
grub_printf ("OS disk #num ------> GRUB/BIOS device\n");
grub_puts_ (N_("OS disk #num ------> GRUB/BIOS device"));
drivemap_node_t *curnode = map_head;
while (curnode)
{

View File

@ -74,27 +74,27 @@ grub_cmd_lsapm (grub_command_t cmd __attribute__ ((unused)),
if (!grub_apm_get_info (&info))
return grub_error (GRUB_ERR_IO, "no APM found");
grub_printf ("Vesion %u.%u\n"
"32-bit CS = 0x%x, len = 0x%x, offset = 0x%x\n"
"16-bit CS = 0x%x, len = 0x%x\n"
"DS = 0x%x, len = 0x%x\n",
info.version >> 8, info.version & 0xff,
info.cseg, info.cseg_len, info.offset,
info.cseg_16, info.cseg_16_len,
info.dseg, info.dseg_len);
grub_printf_ (N_("Vesion %u.%u\n"
"32-bit CS = 0x%x, len = 0x%x, offset = 0x%x\n"
"16-bit CS = 0x%x, len = 0x%x\n"
"DS = 0x%x, len = 0x%x\n"),
info.version >> 8, info.version & 0xff,
info.cseg, info.cseg_len, info.offset,
info.cseg_16, info.cseg_16_len,
info.dseg, info.dseg_len);
grub_xputs (info.flags & GRUB_APM_FLAGS_16BITPROTECTED_SUPPORTED
? "16-bit protected interface supported\n"
: "16-bit protected interface unsupported\n");
? _("16-bit protected interface supported\n")
: _("16-bit protected interface unsupported\n"));
grub_xputs (info.flags & GRUB_APM_FLAGS_32BITPROTECTED_SUPPORTED
? "32-bit protected interface supported\n"
: "32-bit protected interface unsupported\n");
? _("32-bit protected interface supported\n")
: _("32-bit protected interface unsupported\n"));
grub_xputs (info.flags & GRUB_APM_FLAGS_CPUIDLE_SLOWS_DOWN
? "CPU Idle slows down processor\n"
: "CPU Idle doesn't slow down processor\n");
? _("CPU Idle slows down processor\n")
: _("CPU Idle doesn't slow down processor\n"));
grub_xputs (info.flags & GRUB_APM_FLAGS_DISABLED
? "APM disabled\n" : "APM enabled\n");
? _("APM disabled\n") : _("APM enabled\n"));
grub_xputs (info.flags & GRUB_APM_FLAGS_DISENGAGED
? "APM disengaged\n" : "APM engaged\n");
? _("APM disengaged\n") : _("APM engaged\n"));
return GRUB_ERR_NONE;
}

View File

@ -26,6 +26,7 @@
#include <grub/extcmd.h>
#include <grub/cpu/io.h>
#include <grub/loader.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv2+");
@ -35,23 +36,23 @@ static int keylen = 0;
static int noled = 0;
static const struct grub_arg_option options[] =
{
{"num", 'n', 0, "set numlock mode", "[on|off]", ARG_TYPE_STRING},
{"caps", 'c', 0, "set capslock mode", "[on|off]", ARG_TYPE_STRING},
{"scroll", 's', 0, "set scrolllock mode", "[on|off]", ARG_TYPE_STRING},
{"insert", 0, 0, "set insert mode", "[on|off]", ARG_TYPE_STRING},
{"pause", 0, 0, "set pause mode", "[on|off]", ARG_TYPE_STRING},
{"left-shift", 0, 0, "press left shift", "[on|off]", ARG_TYPE_STRING},
{"right-shift", 0, 0, "press right shift", "[on|off]", ARG_TYPE_STRING},
{"sysrq", 0, 0, "press SysRq", "[on|off]", ARG_TYPE_STRING},
{"numkey", 0, 0, "press NumLock key", "[on|off]", ARG_TYPE_STRING},
{"capskey", 0, 0, "press CapsLock key", "[on|off]", ARG_TYPE_STRING},
{"scrollkey", 0, 0, "press ScrollLock key", "[on|off]", ARG_TYPE_STRING},
{"insertkey", 0, 0, "press Insert key", "[on|off]", ARG_TYPE_STRING},
{"left-alt", 0, 0, "press left alt", "[on|off]", ARG_TYPE_STRING},
{"right-alt", 0, 0, "press right alt", "[on|off]", ARG_TYPE_STRING},
{"left-ctrl", 0, 0, "press left ctrl", "[on|off]", ARG_TYPE_STRING},
{"right-ctrl", 0, 0, "press right ctrl", "[on|off]", ARG_TYPE_STRING},
{"no-led", 0, 0, "don't update LED state", 0, 0},
{"num", 'n', 0, N_("set numlock mode"), "[on|off]", ARG_TYPE_STRING},
{"caps", 'c', 0, N_("set capslock mode"), "[on|off]", ARG_TYPE_STRING},
{"scroll", 's', 0, N_("set scrolllock mode"), "[on|off]", ARG_TYPE_STRING},
{"insert", 0, 0, N_("set insert mode"), "[on|off]", ARG_TYPE_STRING},
{"pause", 0, 0, N_("set pause mode"), "[on|off]", ARG_TYPE_STRING},
{"left-shift", 0, 0, N_("press left shift"), "[on|off]", ARG_TYPE_STRING},
{"right-shift", 0, 0, N_("press right shift"), "[on|off]", ARG_TYPE_STRING},
{"sysrq", 0, 0, N_("press SysRq"), "[on|off]", ARG_TYPE_STRING},
{"numkey", 0, 0, N_("press NumLock key"), "[on|off]", ARG_TYPE_STRING},
{"capskey", 0, 0, N_("press CapsLock key"), "[on|off]", ARG_TYPE_STRING},
{"scrollkey", 0, 0, N_("press ScrollLock key"), "[on|off]", ARG_TYPE_STRING},
{"insertkey", 0, 0, N_("press Insert key"), "[on|off]", ARG_TYPE_STRING},
{"left-alt", 0, 0, N_("press left alt"), "[on|off]", ARG_TYPE_STRING},
{"right-alt", 0, 0, N_("press right alt"), "[on|off]", ARG_TYPE_STRING},
{"left-ctrl", 0, 0, N_("press left ctrl"), "[on|off]", ARG_TYPE_STRING},
{"right-ctrl", 0, 0, N_("press right ctrl"), "[on|off]", ARG_TYPE_STRING},
{"no-led", 0, 0, N_("don't update LED state"), 0, 0},
{0, 0, 0, 0, 0, 0}
};
static int simple_flag_offsets[]
@ -369,8 +370,8 @@ static void *preboot_hook;
GRUB_MOD_INIT (sendkey)
{
cmd = grub_register_extcmd ("sendkey", grub_cmd_sendkey, 0,
"sendkey [KEYSTROKE1] [KEYSTROKE2] ...",
"Emulate a keystroke", options);
N_("[KEYSTROKE1] [KEYSTROKE2] ..."),
N_("Emulate a keystroke"), options);
preboot_hook
= grub_loader_register_preboot_hook (grub_sendkey_preboot,

View File

@ -26,13 +26,13 @@ GRUB_MOD_LICENSE ("GPLv3+");
static const char *names[] =
{
[GRUB_MEMORY_AVAILABLE] = "available",
[GRUB_MEMORY_RESERVED] = "reserved",
[GRUB_MEMORY_ACPI] = "ACPI reclamaible",
[GRUB_MEMORY_NVS] = "NVS",
[GRUB_MEMORY_BADRAM] = "BadRAM",
[GRUB_MEMORY_CODE] = "firmware code",
[GRUB_MEMORY_HOLE] = "hole"
[GRUB_MEMORY_AVAILABLE] = N_("available"),
[GRUB_MEMORY_RESERVED] = N_("reserved"),
[GRUB_MEMORY_ACPI] = N_("ACPI reclamaible"),
[GRUB_MEMORY_NVS] = N_("ACPI non-volatile storage"),
[GRUB_MEMORY_BADRAM] = N_("BadRAM"),
[GRUB_MEMORY_CODE] = N_("firmware code"),
[GRUB_MEMORY_HOLE] = N_("hole")
};
static grub_err_t
@ -46,11 +46,11 @@ grub_cmd_lsmmap (grub_command_t cmd __attribute__ ((unused)),
grub_memory_type_t type)
{
if (type < ARRAY_SIZE (names) && names[type])
grub_printf ("base_addr = 0x%llx, length = 0x%llx, %s\n",
(long long) addr, (long long) size, names[type]);
grub_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, %s\n"),
(long long) addr, (long long) size, _(names[type]));
else
grub_printf ("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n",
(long long) addr, (long long) size, type);
grub_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n"),
(long long) addr, (long long) size, type);
return 0;
}
#ifndef GRUB_MACHINE_EMU

View File

@ -28,13 +28,13 @@
static const struct grub_arg_option options[] =
{
{"class", 1, GRUB_ARG_OPTION_REPEATABLE,
N_("Menu entry type."), "STRING", ARG_TYPE_STRING},
N_("Menu entry type."), N_("STRING"), ARG_TYPE_STRING},
{"users", 2, 0,
N_("Users allowed to boot this entry."), "USERNAME", ARG_TYPE_STRING},
N_("Users allowed to boot this entry."), N_("USERNAME"), ARG_TYPE_STRING},
{"hotkey", 3, 0,
N_("Keyboard key for this entry."), "KEY", ARG_TYPE_STRING},
N_("Keyboard key for this entry."), N_("KEY"), ARG_TYPE_STRING},
{"source", 4, 0,
N_("Menu entry definition as a string."), "STRING", ARG_TYPE_STRING},
N_("Menu entry definition as a string."), N_("STRING"), ARG_TYPE_STRING},
{0, 0, 0, 0, 0, 0}
};

View File

@ -23,6 +23,7 @@
#include <grub/dl.h>
#include <grub/command.h>
#include <grub/cs5536.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -38,43 +39,44 @@ grub_cmd_lsspd (grub_command_t cmd __attribute__ ((unused)),
if (!grub_cs5536_find (&dev))
{
grub_printf ("No CS5536 found\n");
grub_puts_ (N_("No CS5536 found"));
return GRUB_ERR_NONE;
}
grub_printf ("CS5536 at %d:%d.%d\n", grub_pci_get_bus (dev),
grub_pci_get_device (dev), grub_pci_get_function (dev));
grub_printf_ (N_("CS5536 at %d:%d.%d\n"), grub_pci_get_bus (dev),
grub_pci_get_device (dev), grub_pci_get_function (dev));
err = grub_cs5536_init_smbus (dev, 0x7fff, &smbbase);
if (err)
return err;
grub_printf ("SMB base = 0x%x\n", smbbase);
grub_printf_ (N_("SMB base = 0x%x\n"), smbbase);
for (i = GRUB_SMB_RAM_START_ADDR;
i < GRUB_SMB_RAM_START_ADDR + GRUB_SMB_RAM_NUM_MAX; i++)
{
struct grub_smbus_spd spd;
grub_memset (&spd, 0, sizeof (spd));
grub_printf ("Device %d\n", i);
grub_printf_ (N_("Device %d\n"), i);
err = grub_cs5536_read_spd (smbbase, i, &spd);
if (err)
{
grub_print_error ();
continue;
}
grub_printf ("Written SPD bytes: %d B.\n", spd.written_size);
grub_printf ("Total flash size: %d B.\n", 1 << spd.log_total_flash_size);
grub_printf_ (N_("Written SPD bytes: %d B.\n"), spd.written_size);
grub_printf_ (N_("Total flash size: %d B.\n"),
1 << spd.log_total_flash_size);
if (spd.memory_type == GRUB_SMBUS_SPD_MEMORY_TYPE_DDR2)
{
char str[sizeof (spd.ddr2.part_number) + 1];
grub_printf ("Memory type: DDR2.\n");
grub_puts_ (N_("Memory type: DDR2."));
grub_memcpy (str, spd.ddr2.part_number,
sizeof (spd.ddr2.part_number));
str[sizeof (spd.ddr2.part_number)] = 0;
grub_printf ("Part no: %s.\n", str);
grub_printf_ (N_("Part no: %s.\n"), str);
}
else
grub_printf ("Memory type: Unknown.\n");
grub_puts_ (N_("Memory type: Unknown."));
}
return GRUB_ERR_NONE;
@ -85,7 +87,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(lsspd)
{
cmd = grub_register_command ("lsspd", grub_cmd_lsspd, 0,
"Print Memory information.");
N_("Print Memory information."));
}
GRUB_MOD_FINI(lsspd)

View File

@ -66,12 +66,12 @@ static struct pci_register pci_registers[] =
static const struct grub_arg_option options[] =
{
{0, 'd', 0, "Select device by vendor and device IDs.",
"[vendor]:[device]", ARG_TYPE_STRING},
{0, 's', 0, "Select device by its position on the bus.",
"[bus]:[slot][.func]", ARG_TYPE_STRING},
{0, 'v', 0, "Save read value into variable VARNAME.",
"VARNAME", ARG_TYPE_STRING},
{0, 'd', 0, N_("Select device by vendor and device IDs."),
N_("[vendor]:[device]"), ARG_TYPE_STRING},
{0, 's', 0, N_("Select device by its position on the bus."),
N_("[bus]:[slot][.func]"), ARG_TYPE_STRING},
{0, 'v', 0, N_("Save read value into variable VARNAME."),
N_("VARNAME"), ARG_TYPE_STRING},
{0, 0, 0, 0, 0, 0}
};
@ -128,7 +128,7 @@ grub_setpci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
if (!write_mask)
{
grub_printf ("Register %x of %d:%d.%d is %x\n", regaddr,
grub_printf (N_("Register %x of %d:%d.%d is %x\n"), regaddr,
grub_pci_get_bus (dev),
grub_pci_get_device (dev),
grub_pci_get_function (dev),

View File

@ -450,7 +450,8 @@ grub_freebsd_list_modules (void)
{
struct bsd_tag *tag;
grub_printf (" %-18s %-18s%14s%14s\n", "name", "type", "addr", "size");
grub_printf (" %-18s %-18s%14s%14s\n", _("name"), _("type"), _("addr"),
_("size"));
for (tag = tags; tag; tag = tag->next)
{
@ -515,7 +516,8 @@ grub_netbsd_list_modules (void)
{
struct netbsd_module *mod;
grub_printf (" %-18s%14s%14s%14s\n", "name", "type", "addr", "size");
grub_printf (" %-18s%14s%14s%14s\n", _("name"), _("type"), _("addr"),
_("size"));
for (mod = netbsd_mods; mod; mod = mod->next)
grub_printf (" %-18s 0x%08x 0x%08x 0x%08x", mod->mod.name,
@ -1050,7 +1052,7 @@ grub_netbsd_boot (void)
if (err)
{
grub_print_error ();
grub_printf ("Booting however\n");
grub_puts_ (N_("Booting in blind mode"));
grub_errno = GRUB_ERR_NONE;
}
@ -2061,7 +2063,7 @@ GRUB_MOD_INIT (bsd)
cmd_openbsd_ramdisk = grub_register_command ("kopenbsd_ramdisk",
grub_cmd_openbsd_ramdisk, 0,
"Load kOpenBSD ramdisk. ");
N_("Load kOpenBSD ramdisk."));
my_mod = mod;
}

View File

@ -517,7 +517,7 @@ grub_linux_boot (void)
if (err)
{
grub_print_error ();
grub_printf ("Booting however\n");
grub_puts_ (N_("Booting in blind mode"));
grub_errno = GRUB_ERR_NONE;
}
@ -793,7 +793,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
vid_mode = GRUB_LINUX_VID_MODE_EXTENDED;
else if (grub_strcmp (val, "ask") == 0)
{
grub_printf ("Legacy `ask' parameter no longer supported.\n");
grub_puts_ (N_("Legacy `ask' parameter no longer supported."));
/* We usually would never do this in a loader, but "vga=ask" means user
requested interaction, so it can't hurt to request keyboard input. */
@ -809,9 +809,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
case 0:
case GRUB_LINUX_VID_MODE_NORMAL:
grub_env_set ("gfxpayload", "text");
grub_printf ("%s is deprecated. "
"Use set gfxpayload=text before "
"linux command instead.\n",
grub_printf_ (N_("%s is deprecated. "
"Use set gfxpayload=text before "
"linux command instead.\n"),
argv[i]);
break;
@ -819,9 +819,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
case GRUB_LINUX_VID_MODE_EXTENDED:
/* FIXME: support 80x50 text. */
grub_env_set ("gfxpayload", "text");
grub_printf ("%s is deprecated. "
"Use set gfxpayload=text before "
"linux command instead.\n",
grub_printf_ (N_("%s is deprecated. "
"Use set gfxpayload=text before "
"linux command instead.\n"),
argv[i]);
break;
default:
@ -830,9 +830,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
vid_mode > GRUB_VESA_MODE_TABLE_END)
{
grub_env_set ("gfxpayload", "text");
grub_printf ("%s is deprecated. Mode %d isn't recognized. "
"Use set gfxpayload=WIDTHxHEIGHT[xDEPTH] before "
"linux command instead.\n",
grub_printf_ (N_("%s is deprecated. Mode %d isn't recognized. "
"Use set gfxpayload=WIDTHxHEIGHT[xDEPTH] "
"before linux command instead.\n"),
argv[i], vid_mode);
break;
}
@ -847,9 +847,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
if (! buf)
goto fail;
grub_printf ("%s is deprecated. "
"Use set gfxpayload=%s before "
"linux command instead.\n",
grub_printf_ (N_("%s is deprecated. "
"Use set gfxpayload=%s before "
"linux command instead.\n"),
argv[i], buf);
err = grub_env_set ("gfxpayload", buf);
grub_free (buf);

View File

@ -35,6 +35,7 @@
#include <grub/util/misc.h>
#include <grub/util/lvm.h>
#include <grub/cryptodisk.h>
#include <grub/i18n.h>
#ifdef HAVE_DEVICE_MAPPER
# include <libdevmapper.h>
@ -454,7 +455,7 @@ grub_find_device (const char *dir, dev_t dev)
continue;
if (chdir (saved_cwd) < 0)
grub_util_error ("cannot restore the original directory");
grub_util_error (_("cannot restore the original directory"));
free (saved_cwd);
closedir (dp);
@ -463,7 +464,7 @@ grub_find_device (const char *dir, dev_t dev)
}
if (chdir (saved_cwd) < 0)
grub_util_error ("cannot restore the original directory");
grub_util_error (_("cannot restore the original directory"));
free (saved_cwd);
closedir (dp);
@ -581,17 +582,17 @@ grub_guess_root_device (const char *dir)
&data, &data_len);
if (num_ints < 1)
grub_util_error ("Storage info for `%s' does not include type", dir);
grub_util_error (_("Storage info for `%s' does not include type"), dir);
if (ints[0] != STORAGE_DEVICE)
grub_util_error ("Filesystem of `%s' is not stored on local disk", dir);
grub_util_error (_("Filesystem of `%s' is not stored on local disk"), dir);
if (num_ints < 5)
grub_util_error ("Storage info for `%s' does not include name", dir);
grub_util_error (_("Storage info for `%s' does not include name"), dir);
name_len = ints[4];
if (name_len < data_len)
grub_util_error ("Bogus name length for storage info for `%s'", dir);
grub_util_error (_("Bogus name length for storage info for `%s'"), dir);
if (data[name_len - 1] != '\0')
grub_util_error ("Storage name for `%s' not NUL-terminated", dir);
grub_util_error (_("Storage name for `%s' not NUL-terminated"), dir);
os_dev = xmalloc (strlen ("/dev/") + data_len);
memcpy (os_dev, "/dev/", strlen ("/dev/"));
@ -653,7 +654,7 @@ grub_guess_root_device (const char *dir)
}
if (stat (dir, &st) < 0)
grub_util_error ("cannot stat `%s'", dir);
grub_util_error (_("cannot stat `%s'"), dir);
dev = st.st_dev;
@ -692,7 +693,7 @@ grub_util_open_dm (const char *os_dev, struct dm_tree **tree,
*tree = dm_tree_create ();
if (! *tree)
{
grub_printf ("Failed to create tree\n");
grub_puts_ (N_("Failed to create tree"));
grub_dprintf ("hostdisk", "dm_tree_create failed\n");
return 0;
}
@ -808,7 +809,7 @@ grub_util_get_geom_abstraction (const char *dev)
error = geom_gettree (&mesh);
if (error != 0)
grub_util_error ("couldn't open geom");
grub_util_error (_("couldn't open geom"));
LIST_FOREACH (class, &mesh.lg_class, lg_class)
{
@ -874,13 +875,14 @@ get_mdadm_uuid (const char *os_dev)
if (pipe (mdadm_pipe) < 0)
{
grub_util_warn ("Unable to create pipe for mdadm: %s", strerror (errno));
grub_util_warn (_("Unable to create pipe for mdadm: %s"),
strerror (errno));
return NULL;
}
mdadm_pid = fork ();
if (mdadm_pid < 0)
grub_util_warn ("Unable to fork mdadm: %s", strerror (errno));
grub_util_warn (_("Unable to fork mdadm: %s"), strerror (errno));
else if (mdadm_pid == 0)
{
/* Child. */
@ -911,7 +913,7 @@ get_mdadm_uuid (const char *os_dev)
mdadm = fdopen (mdadm_pipe[0], "r");
if (! mdadm)
{
grub_util_warn ("Unable to open stream from mdadm: %s",
grub_util_warn (_("Unable to open stream from mdadm: %s"),
strerror (errno));
goto out;
}
@ -971,7 +973,7 @@ grub_util_pull_device (const char *os_dev)
error = geom_gettree (&mesh);
if (error != 0)
grub_util_error ("couldn't open geom");
grub_util_error (_("couldn't open geom"));
LIST_FOREACH (class, &mesh.lg_class, lg_class)
{
@ -989,7 +991,7 @@ grub_util_pull_device (const char *os_dev)
LIST_FOREACH (consumer, &geom->lg_consumer, lg_consumer)
break;
if (!consumer)
grub_util_error ("couldn't find geli consumer");
grub_util_error (_("couldn't find geli consumer"));
fname = xasprintf ("/dev/%s", consumer->lg_provider->lg_name);
grub_util_info ("consumer %s", consumer->lg_provider->lg_name);
lastsubdev = consumer->lg_provider->lg_name;
@ -1009,7 +1011,7 @@ grub_util_pull_device (const char *os_dev)
grub_err_t err;
err = grub_cryptodisk_cheat_mount (grdev, os_dev);
if (err)
grub_util_error ("Can't mount crypto: %s", grub_errmsg);
grub_util_error (_("Can't mount crypto: %s"), _(grub_errmsg));
}
grub_free (grdev);
@ -1053,7 +1055,7 @@ grub_util_pull_device (const char *os_dev)
grub_err_t err;
err = grub_cryptodisk_cheat_mount (grdev, os_dev);
if (err)
grub_util_error ("Can't mount crypto: %s", grub_errmsg);
grub_util_error (_("Can't mount crypto: %s"), _(grub_errmsg));
}
grub_free (grdev);
}
@ -1141,7 +1143,7 @@ grub_util_get_grub_dev (const char *os_dev)
error = geom_gettree (&mesh);
if (error != 0)
grub_util_error ("couldn't open geom");
grub_util_error (_("couldn't open geom"));
LIST_FOREACH (class, &mesh.lg_class, lg_class)
{
@ -1159,11 +1161,11 @@ grub_util_get_grub_dev (const char *os_dev)
LIST_FOREACH (consumer, &geom->lg_consumer, lg_consumer)
break;
if (!consumer)
grub_util_error ("couldn't find geli consumer");
grub_util_error (_("couldn't find geli consumer"));
fname = xasprintf ("/dev/%s", consumer->lg_provider->lg_name);
uuid = grub_util_get_geli_uuid (fname);
if (!uuid)
grub_util_error ("couldn't retrieve geli UUID");
grub_util_error (_("couldn't retrieve geli UUID"));
grub_dev = xasprintf ("cryptouuid/%s", uuid);
free (fname);
free (uuid);
@ -1248,7 +1250,7 @@ grub_util_get_grub_dev (const char *os_dev)
free (p);
}
else
grub_util_error ("unknown kind of RAID device `%s'", os_dev);
grub_util_error (_("unknown kind of RAID device `%s'"), os_dev);
{
char *mdadm_name = get_mdadm_uuid (os_dev);
@ -1290,7 +1292,7 @@ grub_util_check_block_device (const char *blk_dev)
struct stat st;
if (stat (blk_dev, &st) < 0)
grub_util_error ("cannot stat `%s'", blk_dev);
grub_util_error (_("cannot stat `%s'"), blk_dev);
if (S_ISBLK (st.st_mode))
return (blk_dev);
@ -1304,7 +1306,7 @@ grub_util_check_char_device (const char *blk_dev)
struct stat st;
if (stat (blk_dev, &st) < 0)
grub_util_error ("cannot stat `%s'", blk_dev);
grub_util_error (_("cannot stat `%s'"), blk_dev);
if (S_ISCHR (st.st_mode))
return (blk_dev);
@ -1320,7 +1322,7 @@ get_win32_path (const char *path)
{
char winpath[PATH_MAX];
if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, path, winpath, sizeof(winpath)))
grub_util_error ("cygwin_conv_path() failed");
grub_util_error (_("cygwin_conv_path() failed"));
int len = strlen (winpath);
int offs = (len > 2 && winpath[1] == ':' ? 2 : 0);
@ -1438,7 +1440,7 @@ grub_make_system_path_relative_to_its_root (const char *path)
/* canonicalize. */
p = canonicalize_file_name (path);
if (p == NULL)
grub_util_error ("failed to get canonical path of %s", path);
grub_util_error (_("failed to get canonical path of %s"), path);
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
/* For ZFS sub-pool filesystems, could be extended to others (btrfs?). */
@ -1453,7 +1455,7 @@ grub_make_system_path_relative_to_its_root (const char *path)
free (p);
if (stat (buf, &st) < 0)
grub_util_error ("cannot stat %s: %s", buf, strerror (errno));
grub_util_error (_("cannot stat %s: %s"), buf, strerror (errno));
buf2 = xstrdup (buf);
num = st.st_dev;
@ -1465,14 +1467,14 @@ grub_make_system_path_relative_to_its_root (const char *path)
p = strrchr (buf, '/');
if (p == NULL)
/* This should never happen. */
grub_util_error ("FIXME: no / in buf. (make_system_path_relative_to_its_root)");
grub_util_error (_("FIXME: no / in buf. (make_system_path_relative_to_its_root)"));
if (p != buf)
*p = 0;
else
*++p = 0;
if (stat (buf, &st) < 0)
grub_util_error ("cannot stat %s: %s", buf, strerror (errno));
grub_util_error (_("cannot stat %s: %s"), buf, strerror (errno));
/* buf is another filesystem; we found it. */
if (st.st_dev != num)

View File

@ -115,26 +115,26 @@ create_envblk_file (const char *name)
buf = malloc (DEFAULT_ENVBLK_SIZE);
if (! buf)
grub_util_error ("out of memory");
grub_util_error (_("out of memory"));
namenew = xasprintf ("%s.new", name);
fp = fopen (namenew, "wb");
if (! fp)
grub_util_error ("cannot open the file %s", namenew);
grub_util_error (_("cannot open the file %s"), namenew);
memcpy (buf, GRUB_ENVBLK_SIGNATURE, sizeof (GRUB_ENVBLK_SIGNATURE) - 1);
memset (buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1, '#',
DEFAULT_ENVBLK_SIZE - sizeof (GRUB_ENVBLK_SIGNATURE) + 1);
if (fwrite (buf, 1, DEFAULT_ENVBLK_SIZE, fp) != DEFAULT_ENVBLK_SIZE)
grub_util_error ("cannot write to the file %s", namenew);
grub_util_error (_("cannot write to the file %s"), namenew);
fsync (fileno (fp));
free (buf);
fclose (fp);
if (rename (namenew, name) < 0)
grub_util_error ("cannot rename the file %s to %s", namenew, name);
grub_util_error (_("cannot rename the file %s to %s"), namenew, name);
free (namenew);
}
@ -153,29 +153,29 @@ open_envblk_file (const char *name)
create_envblk_file (name);
fp = fopen (name, "rb");
if (! fp)
grub_util_error ("cannot open the file %s", name);
grub_util_error (_("cannot open the file %s"), name);
}
if (fseek (fp, 0, SEEK_END) < 0)
grub_util_error ("cannot seek the file %s", name);
grub_util_error (_("cannot seek the file %s"), name);
size = (size_t) ftell (fp);
if (fseek (fp, 0, SEEK_SET) < 0)
grub_util_error ("cannot seek the file %s", name);
grub_util_error (_("cannot seek the file %s"), name);
buf = malloc (size);
if (! buf)
grub_util_error ("out of memory");
grub_util_error (_("out of memory"));
if (fread (buf, 1, size, fp) != size)
grub_util_error ("cannot read the file %s", name);
grub_util_error (_("cannot read the file %s"), name);
fclose (fp);
envblk = grub_envblk_open (buf, size);
if (! envblk)
grub_util_error ("invalid environment block");
grub_util_error (_("invalid environment block"));
return envblk;
}
@ -204,11 +204,11 @@ write_envblk (const char *name, grub_envblk_t envblk)
fp = fopen (name, "wb");
if (! fp)
grub_util_error ("cannot open the file %s", name);
grub_util_error (_("cannot open the file %s"), name);
if (fwrite (grub_envblk_buffer (envblk), 1, grub_envblk_size (envblk), fp)
!= grub_envblk_size (envblk))
grub_util_error ("cannot write to the file %s", name);
grub_util_error (_("cannot write to the file %s"), name);
fsync (fileno (fp));
fclose (fp);
@ -226,12 +226,12 @@ set_variables (const char *name, int argc, char *argv[])
p = strchr (argv[0], '=');
if (! p)
grub_util_error ("invalid parameter %s", argv[0]);
grub_util_error (_("invalid parameter %s"), argv[0]);
*(p++) = 0;
if (! grub_envblk_set (envblk, argv[0], p))
grub_util_error ("environment block too small");
grub_util_error (_("environment block too small"));
argc--;
argv++;

View File

@ -395,11 +395,11 @@ fstest (int n, char **args)
if (!fs)
grub_util_error (grub_errmsg);
if (!fs->uuid)
grub_util_error ("couldn't retrieve UUID");
grub_util_error (_("couldn't retrieve UUID"));
if (fs->uuid (dev, &uuid))
grub_util_error (grub_errmsg);
if (!uuid)
grub_util_error ("couldn't retrieve UUID");
grub_util_error (_("couldn't retrieve UUID"));
argv[1] = uuid;
execute_command ("xnu_uuid", 2, argv);
grub_free (uuid);
@ -470,7 +470,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
if (strcmp (arg, "prompt") == 0)
{
char buf[1024];
grub_printf ("Enter ZFS password: ");
grub_puts_ (N_("Enter ZFS password: "));
if (grub_password_get (buf, 1023))
{
grub_zfs_add_key ((grub_uint8_t *) buf, grub_strlen (buf), 1);
@ -484,13 +484,13 @@ argp_parser (int key, char *arg, struct argp_state *state)
f = fopen (arg, "rb");
if (!f)
{
printf ("Error loading file %s: %s\n", arg, strerror (errno));
printf (_("Error loading file %s: %s\n"), arg, strerror (errno));
return 0;
}
real_size = fread (buf, 1, 1024, f);
if (real_size < 0)
{
printf ("Error loading file %s: %s\n", arg, strerror (errno));
printf (_("Error loading file %s: %s\n"), arg, strerror (errno));
fclose (f);
return 0;
}

View File

@ -121,9 +121,10 @@ static void
usage (int status)
{
if (status)
fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
printf ("\
printf (_("\
Usage: %s [OPTIONS] FONT_FILES\n\
\nOptions:\n\
-o, --output=FILE_NAME set output file name\n\
@ -143,7 +144,7 @@ Usage: %s [OPTIONS] FONT_FILES\n\
-V, --version print version information and exit\n\
-v, --verbose print verbose messages\n\
\n\
Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
Report bugs to <%s>.\n"), program_name, PACKAGE_BUGREPORT);
exit (status);
}
@ -188,12 +189,12 @@ add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face,
err = FT_Load_Glyph (face, glyph_idx, flag);
if (err)
{
printf ("Freetype Error %d loading glyph 0x%x for U+0x%x%s",
printf (_("Freetype Error %d loading glyph 0x%x for U+0x%x%s"),
err, glyph_idx, char_code & GRUB_FONT_CODE_CHAR_MASK,
char_code & GRUB_FONT_CODE_RIGHT_JOINED
? ((char_code & GRUB_FONT_CODE_LEFT_JOINED) ? " (medial)":
" (leftmost)")
: ((char_code & GRUB_FONT_CODE_LEFT_JOINED) ? " (rightmost)":
? ((char_code & GRUB_FONT_CODE_LEFT_JOINED) ? _(" (medial)"):
_(" (leftmost)"))
: ((char_code & GRUB_FONT_CODE_LEFT_JOINED) ? _(" (rightmost)"):
""));
if (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs))
@ -519,7 +520,7 @@ process_cursive (struct gsub_feature *feature,
if (substtype == GSUB_SUBSTITUTION_DELTA)
add_subst (glyph, glyph + grub_be_to_cpu16 (sub->delta), target);
else if (i >= grub_be_to_cpu16 (sub->count))
printf ("Out of range substitution (%d, %d)\n", i,
printf (_("Out of range substitution (%d, %d)\n"), i,
grub_be_to_cpu16 (sub->count));
else
add_subst (glyph, grub_be_to_cpu16 (sub->repl[i++]), target);
@ -531,7 +532,7 @@ process_cursive (struct gsub_feature *feature,
struct gsub_lookup *lookup;
if (lookup_index >= grub_be_to_cpu16 (lookups->count))
{
printf ("Out of range lookup: %d\n", lookup_index);
printf (_("Out of range lookup: %d\n"), lookup_index);
continue;
}
lookup = (struct gsub_lookup *)
@ -539,13 +540,13 @@ process_cursive (struct gsub_feature *feature,
+ grub_be_to_cpu16 (lookups->offsets[lookup_index]));
if (grub_be_to_cpu16 (lookup->type) != GSUB_SINGLE_SUBSTITUTION)
{
printf ("Unsupported substitution type: %d\n",
printf (_("Unsupported substitution type: %d\n"),
grub_be_to_cpu16 (lookup->type));
continue;
}
if (grub_be_to_cpu16 (lookup->flag) & ~GSUB_RTL_CHAR)
{
printf ("Unsupported substitution flag: 0x%x\n",
printf (_("Unsupported substitution flag: 0x%x\n"),
grub_be_to_cpu16 (lookup->flag));
}
switch (feattag)
@ -575,7 +576,7 @@ process_cursive (struct gsub_feature *feature,
if (substtype != GSUB_SUBSTITUTION_MAP
&& substtype != GSUB_SUBSTITUTION_DELTA)
{
printf ("Unsupported substitution specification: %d\n",
printf (_("Unsupported substitution specification: %d\n"),
substtype);
continue;
}
@ -601,7 +602,7 @@ process_cursive (struct gsub_feature *feature,
subst (m);
}
else
printf ("Unsupported coverage specification: %d\n", covertype);
printf (_("Unsupported coverage specification: %d\n"), covertype);
}
}
}
@ -640,7 +641,7 @@ add_font (struct grub_font_info *font_info, FT_Face face, int nocut)
grub_uint32_t feattag
= grub_be_to_cpu32 (features->features[i].feature_tag);
if (feature->params)
printf ("WARNING: unsupported feature parameters: %x\n",
printf (_("WARNING: unsupported feature parameters: %x\n"),
grub_be_to_cpu16 (feature->params));
switch (feattag)
{
@ -670,7 +671,7 @@ add_font (struct grub_font_info *font_info, FT_Face face, int nocut)
for (j = 0; j < 4; j++)
if (!grub_isgraph (str[j]))
str[j] = '?';
printf ("Unknown gsub feature 0x%x (%s)\n", feattag, str);
printf (_("Unknown gsub feature 0x%x (%s)\n"), feattag, str);
}
}
}
@ -739,8 +740,8 @@ print_glyphs (struct grub_font_info *font_info)
int x, y, xmax, xmin, ymax, ymin;
grub_uint8_t *bitmap, mask;
printf ("\nGlyph #%d, U+%04x\n", num, glyph->char_code);
printf ("Width %d, Height %d, X offset %d, Y offset %d, Device width %d\n",
printf (_("\nGlyph #%d, U+%04x\n"), num, glyph->char_code);
printf (_("Width %d, Height %d, X offset %d, Y offset %d, Device width %d\n"),
glyph->width, glyph->height, glyph->x_ofs, glyph->y_ofs,
glyph->device_width);
@ -807,7 +808,7 @@ write_font_ascii_bitmap (struct grub_font_info *font_info, char *output_file)
file = fopen (output_file, "wb");
if (! file)
grub_util_error ("Can\'t write to file %s.", output_file);
grub_util_error (_("Can\'t write to file %s."), output_file);
int correct_size;
for (glyph = font_info->glyphs_sorted, num = 0; num < font_info->num_glyphs;
@ -843,7 +844,7 @@ write_font_width_spec (struct grub_font_info *font_info, char *output_file)
file = fopen (output_file, "wb");
if (! file)
grub_util_error ("Can\'t write to file %s.", output_file);
grub_util_error (_("Can\'t write to file %s."), output_file);
for (glyph = font_info->glyphs_sorted;
glyph < font_info->glyphs_sorted + font_info->num_glyphs; glyph++)
@ -866,7 +867,7 @@ write_font_pf2 (struct grub_font_info *font_info, char *output_file)
file = fopen (output_file, "wb");
if (! file)
grub_util_error ("can\'t write to file %s.", output_file);
grub_util_error (_("Can\'t write to file %s."), output_file);
offset = 0;
@ -1063,7 +1064,7 @@ main (int argc, char *argv[])
a = strtoul (p, &p, 0);
if (*p != '-')
grub_util_error ("invalid font range");
grub_util_error (_("invalid font range"));
b = strtoul (p + 1, &p, 0);
if ((font_info.num_range & (GRUB_FONT_RANGE_BLOCK - 1)) == 0)
font_info.ranges = xrealloc (font_info.ranges,
@ -1078,7 +1079,7 @@ main (int argc, char *argv[])
if (*p)
{
if (*p != ',')
grub_util_error ("invalid font range");
grub_util_error (_("invalid font range"));
else
p++;
}
@ -1124,7 +1125,7 @@ main (int argc, char *argv[])
if (file_format == ASCII_BITMAPS && font_info.num_range > 0)
{
grub_util_error ("Option --ascii-bitmaps doesn't accept ranges (use ASCII).");
grub_util_error (_("Option --ascii-bitmaps doesn't accept ranges (use ASCII)."));
return 1;
}
@ -1140,10 +1141,10 @@ main (int argc, char *argv[])
}
if (! output_file)
grub_util_error ("no output file is specified");
grub_util_error (_("no output file is specified"));
if (FT_Init_FreeType (&ft_lib))
grub_util_error ("FT_Init_FreeType fails");
grub_util_error (_("FT_Init_FreeType fails"));
for (; optind < argc; optind++)
{
@ -1154,8 +1155,8 @@ main (int argc, char *argv[])
err = FT_New_Face (ft_lib, argv[optind], font_index, &ft_face);
if (err)
{
grub_printf ("can't open file %s, index %d: error %d", argv[optind],
font_index, err);
grub_printf (_("can't open file %s, index %d: error %d"),
argv[optind], font_index, err);
if (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs))
printf (": %s\n", ft_errmsgs[err]);
else
@ -1181,7 +1182,7 @@ main (int argc, char *argv[])
font_info.size = size;
if (FT_Set_Pixel_Sizes (ft_face, size, size))
grub_util_error ("can't set %dx%d font size", size, size);
grub_util_error (_("can't set %dx%d font size"), size, size);
add_font (&font_info, ft_face, file_format != PF2);
FT_Done_Face (ft_face);
}

View File

@ -703,7 +703,7 @@ compress_kernel (struct image_target_desc *image_target, char *kernel_img,
if (image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS
&& (comp != COMPRESSION_NONE))
grub_util_error ("unknown compression %d\n", comp);
grub_util_error (_("unknown compression %d\n"), comp);
*core_img = xmalloc (kernel_size);
memcpy (*core_img, kernel_img, kernel_size);
@ -945,7 +945,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
name = "none_decompress.img";
break;
default:
grub_util_error ("unknown compression %d\n", comp);
grub_util_error (_("unknown compression %d\n"), comp);
}
decompress_path = grub_util_get_path (dir, name);
@ -1301,7 +1301,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
boot_path = grub_util_get_path (dir, "diskboot.img");
boot_size = grub_util_get_image_size (boot_path);
if (boot_size != GRUB_DISK_SECTOR_SIZE)
grub_util_error ("diskboot.img is not one sector size");
grub_util_error (_("diskboot.img is not one sector size"));
boot_img = grub_util_read_image (boot_path);
@ -1366,11 +1366,11 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
GRUB_MD_SHA512->final (context);
if (grub_memcmp (GRUB_MD_SHA512->read (context), fwstart_good_hash,
GRUB_MD_SHA512->mdlen) != 0)
grub_util_warn ("fwstart.img doesn't match the known good version. "
"Proceed at your own risk");
grub_util_warn (_("fwstart.img doesn't match the known good version. "
"proceed at your own risk"));
if (core_size + boot_size > 512 * 1024)
grub_util_error ("firmware image is too big");
grub_util_error (_("firmware image is too big"));
rom_size = 512 * 1024;
rom_img = xmalloc (rom_size);
@ -1394,7 +1394,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
size_t rom_size;
if (core_size > 512 * 1024)
grub_util_error ("firmware image is too big");
grub_util_error (_("firmware image is too big"));
rom_size = 512 * 1024;
rom_img = xmalloc (rom_size);
@ -1762,7 +1762,7 @@ main (int argc, char *argv[])
image_target = &image_targets[i];
if (!image_target)
{
printf ("unknown target format %s\n", optarg);
printf (_("unknown target format %s\n"), optarg);
usage (1);
}
break;
@ -1803,14 +1803,14 @@ main (int argc, char *argv[])
#ifdef HAVE_LIBLZMA
comp = COMPRESSION_XZ;
#else
grub_util_error ("grub-mkimage is compiled without XZ support",
grub_util_error (_("grub-mkimage is compiled without XZ support"),
optarg);
#endif
}
else if (grub_strcmp (optarg, "none") == 0)
comp = COMPRESSION_NONE;
else
grub_util_error ("Unknown compression format %s", optarg);
grub_util_error (_("Unknown compression format %s"), optarg);
break;
case 'h':
@ -1840,7 +1840,7 @@ main (int argc, char *argv[])
if (!image_target)
{
printf ("Target format not specified (use the -O option).\n");
printf (_("Target format not specified (use the -O option).\n"));
usage (1);
}

View File

@ -46,16 +46,17 @@ static void
usage (int status)
{
if (status)
fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
printf ("\
printf (_("\
Usage: %s [OPTIONS]\n\
\nOptions:\n\
-c number, --iteration-count=number Number of PBKDF2 iterations\n\
-l number, --buflen=number Length of generated hash\n\
-s number, --salt=number Length of salt\n\
\n\
Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
Report bugs to <%s>.\n"), program_name, PACKAGE_BUGREPORT);
exit (status);
}
@ -135,12 +136,12 @@ main (int argc, char *argv[])
bufhex = malloc (buflen * 2 + 1);
if (!bufhex)
grub_util_error ("out of memory");
grub_util_error (_("out of memory"));
buf = malloc (buflen);
if (!buf)
{
free (bufhex);
grub_util_error ("out of memory");
grub_util_error (_("out of memory"));
}
salt = malloc (saltlen);
@ -148,7 +149,7 @@ main (int argc, char *argv[])
{
free (bufhex);
free (buf);
grub_util_error ("out of memory");
grub_util_error (_("out of memory"));
}
salthex = malloc (saltlen * 2 + 1);
if (!salthex)
@ -156,26 +157,26 @@ main (int argc, char *argv[])
free (salt);
free (bufhex);
free (buf);
grub_util_error ("out of memory");
grub_util_error (_("out of memory"));
}
printf ("Enter password: ");
printf ("%s", _("Enter password: "));
if (!grub_password_get (pass1, GRUB_AUTH_MAX_PASSLEN))
{
free (buf);
free (bufhex);
free (salthex);
free (salt);
grub_util_error ("failure to read password");
grub_util_error (_("failure to read password"));
}
printf ("\nReenter password: ");
printf ("\n%s", _("Reenter password: "));
if (!grub_password_get (pass2, GRUB_AUTH_MAX_PASSLEN))
{
free (buf);
free (bufhex);
free (salthex);
free (salt);
grub_util_error ("failure to read password");
grub_util_error (_("failure to read password"));
}
if (strcmp (pass1, pass2) != 0)
@ -186,12 +187,12 @@ main (int argc, char *argv[])
free (bufhex);
free (salthex);
free (salt);
grub_util_error ("passwords don't match");
grub_util_error (_("passwords don't match"));
}
memset (pass2, 0, sizeof (pass2));
#if ! defined (__linux__) && ! defined (__FreeBSD__)
printf ("WARNING: your random generator isn't known to be secure\n");
printf ("%s", _("WARNING: your random generator isn't known to be secure\n"));
#endif
{
@ -206,7 +207,7 @@ main (int argc, char *argv[])
free (salthex);
free (salt);
fclose (f);
grub_util_error ("couldn't retrieve random data for salt");
grub_util_error (_("couldn't retrieve random data for salt"));
}
rd = fread (salt, 1, saltlen, f);
if (rd != saltlen)
@ -217,7 +218,7 @@ main (int argc, char *argv[])
free (bufhex);
free (salthex);
free (salt);
grub_util_error ("couldn't retrieve random data for salt");
grub_util_error (_("couldn't retrieve random data for salt"));
}
fclose (f);
}
@ -238,13 +239,13 @@ main (int argc, char *argv[])
memset (salthex, 0, 2 * saltlen);
free (salt);
free (salthex);
grub_util_error ("cryptographic error number %d", gcry_err);
grub_util_error (_("cryptographic error number %d"), gcry_err);
}
hexify (bufhex, buf, buflen);
hexify (salthex, salt, saltlen);
printf ("Your PBKDF2 is grub.pbkdf2.sha512.%d.%s.%s\n",
printf (_("Your PBKDF2 is grub.pbkdf2.sha512.%d.%s.%s\n"),
count, salthex, bufhex);
memset (buf, 0, buflen);
memset (bufhex, 0, 2 * buflen);

View File

@ -31,6 +31,8 @@
#include "progname.h"
/* Please don't internationalise this file. It's pointless. */
static struct option options[] = {
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},

View File

@ -173,10 +173,10 @@ probe (const char *path, char *device_name)
{
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__sun__)
if (! grub_util_check_char_device (device_name))
grub_util_error ("%s is not a character device", device_name);
grub_util_error (_("%s is not a character device"), device_name);
#else
if (! grub_util_check_block_device (device_name))
grub_util_error ("%s is not a block device", device_name);
grub_util_error (_("%s is not a block device"), device_name);
#endif
}
else
@ -186,7 +186,7 @@ probe (const char *path, char *device_name)
}
if (! device_name)
grub_util_error ("cannot find a device for %s (is /dev mounted?)", path);
grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), path);
if (print == PRINT_DEVICE)
{
@ -196,7 +196,8 @@ probe (const char *path, char *device_name)
drive_name = grub_util_get_grub_dev (device_name);
if (! drive_name)
grub_util_error ("cannot find a GRUB drive for %s. Check your device.map", device_name);
grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"),
device_name);
if (print == PRINT_DRIVE)
{
@ -207,7 +208,7 @@ probe (const char *path, char *device_name)
grub_util_info ("opening %s", drive_name);
dev = grub_device_open (drive_name);
if (! dev)
grub_util_error ("%s", grub_errmsg);
grub_util_error ("%s", _(grub_errmsg));
if (print == PRINT_ABSTRACTION)
{
@ -233,7 +234,7 @@ probe (const char *path, char *device_name)
fs = grub_fs_probe (dev);
if (! fs)
grub_util_error ("%s", grub_errmsg);
grub_util_error ("%s", _(grub_errmsg));
if (print == PRINT_FS)
{
@ -243,7 +244,7 @@ probe (const char *path, char *device_name)
{
char *uuid;
if (! fs->uuid)
grub_util_error ("%s does not support UUIDs", fs->name);
grub_util_error (_("%s does not support UUIDs"), fs->name);
if (fs->uuid (dev, &uuid) != GRUB_ERR_NONE)
grub_util_error ("%s", grub_errmsg);
@ -254,10 +255,10 @@ probe (const char *path, char *device_name)
{
char *label;
if (! fs->label)
grub_util_error ("%s does not support labels", fs->name);
grub_util_error (_("%s does not support labels"), fs->name);
if (fs->label (dev, &label) != GRUB_ERR_NONE)
grub_util_error ("%s", grub_errmsg);
grub_util_error ("%s", _(grub_errmsg));
printf ("%s\n", label);
}
@ -287,9 +288,9 @@ usage (int status)
{
if (status)
fprintf (stderr,
"Try `%s --help' for more information.\n", program_name);
_("Try `%s --help' for more information.\n"), program_name);
else
printf ("\
printf (_("\
Usage: %s [OPTION]... [PATH|DEVICE]\n\
\n\
Probe device information for a given path (or device, if the -d option is given).\n\
@ -303,7 +304,7 @@ Probe device information for a given path (or device, if the -d option is given)
-v, --verbose print verbose messages\n\
\n\
Report bugs to <%s>.\n\
", program_name,
"), program_name,
DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT);
exit (status);
@ -385,13 +386,13 @@ main (int argc, char *argv[])
/* Obtain ARGUMENT. */
if (optind >= argc)
{
fprintf (stderr, "No path or device is specified.\n");
fprintf (stderr, _("No path or device is specified.\n"));
usage (1);
}
if (optind + 1 != argc)
{
fprintf (stderr, "Unknown extra argument `%s'.\n", argv[optind + 1]);
fprintf (stderr, _("Unknown extra argument `%s'.\n"), argv[optind + 1]);
usage (1);
}

View File

@ -125,8 +125,8 @@ write_rootdev (char *core_img, grub_device_t root_dev,
if (root_dev->disk->partition->parent)
{
if (root_dev->disk->partition->parent->parent)
grub_util_error ("Installing on doubly nested partitions is "
"not supported");
grub_util_error (_("Installing on doubly nested partitions "
"is not supported"));
dos_part = root_dev->disk->partition->parent->number;
bsd_part = root_dev->disk->partition->number;
}
@ -283,22 +283,22 @@ setup (const char *dir,
grub_util_info ("Opening root");
root_dev = grub_device_open (root);
if (! root_dev)
grub_util_error ("%s", grub_errmsg);
grub_util_error ("%s", _(grub_errmsg));
grub_util_info ("Opening dest");
dest_dev = grub_device_open (dest);
if (! dest_dev)
grub_util_error ("%s", grub_errmsg);
grub_util_error ("%s", _(grub_errmsg));
grub_util_info ("setting the root device to `%s'", root);
if (grub_env_set ("root", root) != GRUB_ERR_NONE)
grub_util_error ("%s", grub_errmsg);
grub_util_error ("%s", _(grub_errmsg));
#ifdef GRUB_MACHINE_PCBIOS
/* Read the original sector from the disk. */
tmp_img = xmalloc (GRUB_DISK_SECTOR_SIZE);
if (grub_disk_read (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, tmp_img))
grub_util_error ("%s", grub_errmsg);
grub_util_error ("%s", _(grub_errmsg));
#endif
#ifdef GRUB_MACHINE_PCBIOS
@ -421,14 +421,14 @@ setup (const char *dir,
if (dest_partmap && !dest_partmap->embed)
{
grub_util_warn ("Partition style '%s' doesn't support embeding",
grub_util_warn (_("Partition style '%s' doesn't support embeding"),
dest_partmap->name);
goto unable_to_embed;
}
if (fs && !fs->embed)
{
grub_util_warn ("File system '%s' doesn't support embeding",
grub_util_warn (_("File system '%s' doesn't support embeding"),
fs->name);
goto unable_to_embed;
}
@ -443,13 +443,13 @@ setup (const char *dir,
if (!err && nsec < core_sectors)
{
err = grub_error (GRUB_ERR_OUT_OF_RANGE,
"Your embedding area is unusually small. "
"core.img won't fit in it.");
N_("Your embedding area is unusually small. "
"core.img won't fit in it."));
}
if (err)
{
grub_util_warn ("%s", grub_errmsg);
grub_util_warn ("%s", _(grub_errmsg));
grub_errno = GRUB_ERR_NONE;
goto unable_to_embed;
}
@ -466,7 +466,7 @@ setup (const char *dir,
block--;
if ((char *) block <= core_img)
grub_util_error ("No terminator in the core image");
grub_util_error (_("No terminator in the core image"));
}
save_first_sector (sectors[0] + grub_partition_get_start (container),
@ -626,7 +626,7 @@ unable_to_embed:
grub_file_filter_disable_compression ();
file = grub_file_open (core_path_dev);
if (! file)
grub_util_error ("%s", grub_errmsg);
grub_util_error ("%s", _(grub_errmsg));
file->read_hook = save_first_sector;
if (grub_file_read (file, tmp_img, GRUB_DISK_SECTOR_SIZE)
@ -687,8 +687,7 @@ unable_to_embed:
/* Write the boot image onto the disk. */
if (grub_disk_write (dest_dev->disk, BOOT_SECTOR,
0, GRUB_DISK_SECTOR_SIZE, boot_img))
grub_util_error ("%s", grub_errmsg);
grub_util_error ("%s", _(grub_errmsg));
grub_util_biosdisk_flush (root_dev->disk);
grub_util_biosdisk_flush (dest_dev->disk);

View File

@ -23,6 +23,7 @@
#include <grub/types.h>
#include <grub/util/misc.h>
#include <grub/util/ofpath.h>
#include <grub/i18n.h>
#endif
#include <limits.h>
@ -53,6 +54,7 @@ grub_util_error (const char *fmt, ...)
exit (1);
}
#define _(x) x
#endif
static void
@ -106,7 +108,7 @@ find_obppath(char *of_path, const char *sysfs_path_orig)
{
kill_trailing_dir(sysfs_path);
if (!strcmp(sysfs_path, "/sys"))
grub_util_error("'obppath' not found in parent dirs of %s",
grub_util_error(_("'obppath' not found in parent dirs of %s"),
sysfs_path_orig);
continue;
}
@ -131,12 +133,12 @@ block_device_get_sysfs_path_and_link(const char *devicenode,
snprintf(sysfs_path, sysfs_path_len, "/sys/block/%s", devicenode);
if (!realpath (sysfs_path, rpath))
grub_util_error ("cannot get the real path of `%s'", sysfs_path);
grub_util_error (_("cannot get the real path of `%s'"), sysfs_path);
strcat(rpath, "/device");
if (!realpath (rpath, sysfs_path))
grub_util_error ("cannot get the real path of `%s'", rpath);
grub_util_error (_("cannot get the real path of `%s'"), rpath);
free (rpath);
}
@ -247,12 +249,12 @@ vendor_is_ATA(const char *path)
snprintf(buf, PATH_MAX, "%s/vendor", path);
fd = open(buf, O_RDONLY);
if (fd < 0)
grub_util_error ("cannot open 'vendor' node of `%s'", path);
grub_util_error (_("cannot open 'vendor' node of `%s'"), path);
memset(buf, 0, PATH_MAX);
err = read(fd, buf, PATH_MAX);
if (err < 0)
grub_util_error ("cannot read 'vendor' node of `%s'", path);
grub_util_error (_("cannot read 'vendor' node of `%s'"), path);
close(fd);
@ -288,7 +290,7 @@ check_sas (char *sysfs_path, int *tgt)
fd = open(path, O_RDONLY);
if (fd < 0)
grub_util_error("cannot open SAS PHY ID `%s'\n", path);
grub_util_error(_("cannot open SAS PHY ID `%s'\n"), path);
memset (phy, 0, sizeof (phy));
read (fd, phy, sizeof (phy));
@ -376,7 +378,7 @@ grub_util_devname_to_ofpath (const char *devname)
name_buf = xmalloc (PATH_MAX);
name_buf = realpath (devname, name_buf);
if (! name_buf)
grub_util_error ("cannot get the real path of `%s'", devname);
grub_util_error (_("cannot get the real path of `%s'"), devname);
device = get_basename (name_buf);
devnode = strip_trailing_digits (name_buf);
@ -398,7 +400,7 @@ grub_util_devname_to_ofpath (const char *devname)
New models have no floppy at all. */
strcpy (ofpath, "floppy");
else
grub_util_error ("unknown device type %s\n", device);
grub_util_error (_("unknown device type %s\n"), device);
free (devnode);
free (devicenode);
@ -414,7 +416,7 @@ int main(int argc, char **argv)
if (argc != 2)
{
printf("Usage: grub-ofpathname DEVICE\n");
printf(_("Usage: %s DEVICE\n"), argv[0]);
return 1;
}

View File

@ -89,10 +89,10 @@ grub_util_get_fp_size (FILE *fp)
struct stat st;
if (fflush (fp) == EOF)
grub_util_error ("fflush failed");
grub_util_error (_("fflush failed"));
if (fstat (fileno (fp), &st) == -1)
grub_util_error ("fstat failed");
grub_util_error (_("fstat failed"));
return st.st_size;
}
@ -105,7 +105,7 @@ grub_util_get_image_size (const char *path)
grub_util_info ("getting the size of %s", path);
if (stat (path, &st) == -1)
grub_util_error ("cannot stat %s", path);
grub_util_error (_("cannot stat %s"), path);
return st.st_size;
}
@ -114,10 +114,10 @@ void
grub_util_read_at (void *img, size_t size, off_t offset, FILE *fp)
{
if (fseeko (fp, offset, SEEK_SET) == -1)
grub_util_error ("seek failed");
grub_util_error (_("seek failed"));
if (fread (img, 1, size, fp) != size)
grub_util_error ("read failed");
grub_util_error (_("read failed"));
}
char *
@ -134,7 +134,7 @@ grub_util_read_image (const char *path)
fp = fopen (path, "rb");
if (! fp)
grub_util_error ("cannot open %s", path);
grub_util_error (_("cannot open %s"), path);
grub_util_read_at (img, size, 0, fp);
@ -155,10 +155,10 @@ grub_util_load_image (const char *path, char *buf)
fp = fopen (path, "rb");
if (! fp)
grub_util_error ("cannot open %s", path);
grub_util_error (_("cannot open %s"), path);
if (fread (buf, 1, size, fp) != size)
grub_util_error ("cannot read %s", path);
grub_util_error (_("cannot read %s"), path);
fclose (fp);
}
@ -168,9 +168,9 @@ grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out)
{
grub_util_info ("writing 0x%x bytes at offset 0x%x", size, offset);
if (fseeko (out, offset, SEEK_SET) == -1)
grub_util_error ("seek failed");
grub_util_error (_("seek failed"));
if (fwrite (img, 1, size, out) != size)
grub_util_error ("write failed");
grub_util_error (_("write failed"));
}
void
@ -178,7 +178,7 @@ grub_util_write_image (const char *img, size_t size, FILE *out)
{
grub_util_info ("writing 0x%x bytes", size);
if (fwrite (img, 1, size, out) != size)
grub_util_error ("write failed");
grub_util_error (_("write failed"));
}
char *

View File

@ -33,6 +33,7 @@
#include <linux/major.h>
#include <linux/raid/md_p.h>
#include <linux/raid/md_u.h>
#include <grub/i18n.h>
char **
grub_util_raid_getmembers (const char *name, int bootable)
@ -46,26 +47,26 @@ grub_util_raid_getmembers (const char *name, int bootable)
fd = open (name, O_RDONLY);
if (fd == -1)
grub_util_error ("can't open %s: %s", name, strerror (errno));
grub_util_error (_("can't open %s: %s"), name, strerror (errno));
ret = ioctl (fd, RAID_VERSION, &version);
if (ret != 0)
grub_util_error ("ioctl RAID_VERSION error: %s", strerror (errno));
grub_util_error (_("ioctl RAID_VERSION error: %s"), strerror (errno));
if ((version.major != 0 || version.minor != 90)
&& (version.major != 1 || version.minor != 0)
&& (version.major != 1 || version.minor != 1)
&& (version.major != 1 || version.minor != 2))
grub_util_error ("unsupported RAID version: %d.%d",
grub_util_error (_("unsupported RAID version: %d.%d"),
version.major, version.minor);
if (bootable && (version.major != 0 || version.minor != 90))
grub_util_error ("unsupported RAID version: %d.%d",
grub_util_error (_("unsupported RAID version: %d.%d"),
version.major, version.minor);
ret = ioctl (fd, GET_ARRAY_INFO, &info);
if (ret != 0)
grub_util_error ("ioctl GET_ARRAY_INFO error: %s", strerror (errno));
grub_util_error (_("ioctl GET_ARRAY_INFO error: %s"), strerror (errno));
devicelist = xmalloc ((info.nr_disks + 1) * sizeof (char *));
@ -74,7 +75,7 @@ grub_util_raid_getmembers (const char *name, int bootable)
disk.number = i;
ret = ioctl (fd, GET_DISK_INFO, &disk);
if (ret != 0)
grub_util_error ("ioctl GET_DISK_INFO error: %s", strerror (errno));
grub_util_error (_("ioctl GET_DISK_INFO error: %s"), strerror (errno));
if (disk.state & (1 << MD_DISK_ACTIVE))
{