Improve gettext support. Stylistic fixes and error handling fixes while

on it.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-08 19:26:01 +01:00
parent 215c90cb82
commit 9c4b5c13e6
184 changed files with 1175 additions and 959 deletions

View file

@ -53,6 +53,7 @@
#include <grub/zfs/dsl_dataset.h>
#include <grub/deflate.h>
#include <grub/crypto.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -1766,7 +1767,7 @@ mzap_lookup (mzap_phys_t * zapobj, grub_zfs_endian_t endian,
}
}
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "couldn't find %s", name);
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name);
}
static int
@ -1971,7 +1972,7 @@ zap_leaf_lookup (zap_leaf_phys_t * l, grub_zfs_endian_t endian,
}
}
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "couldn't find %s", name);
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name);
}
@ -2487,7 +2488,7 @@ dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn,
if (dnode_path->dn.dn.dn_type != DMU_OT_DIRECTORY_CONTENTS)
{
grub_free (path_buf);
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
}
err = zap_lookup (&(dnode_path->dn), cname, &objnum,
data, subvol->case_insensitive);
@ -3483,14 +3484,14 @@ grub_zfs_open (struct grub_file *file, const char *fsfilename)
if (isfs)
{
zfs_unmount (data);
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "Missing @ or / separator");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("missing `%c' symbol"), '@');
}
/* We found the dnode for this file. Verify if it is a plain file. */
if (data->dnode.dn.dn_type != DMU_OT_PLAIN_FILE_CONTENTS)
{
zfs_unmount (data);
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a file");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file"));
}
/* get the file size and set the file position to 0 */
@ -3882,7 +3883,7 @@ grub_zfs_dir (grub_device_t device, const char *path,
if (data->dnode.dn.dn_type != DMU_OT_DIRECTORY_CONTENTS)
{
zfs_unmount (data);
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
}
zap_iterate_u64 (&(data->dnode), iterate_zap, data);
}
@ -3905,8 +3906,8 @@ grub_zfs_embed (grub_device_t device __attribute__ ((unused)),
if ((VDEV_BOOT_SIZE >> GRUB_DISK_SECTOR_BITS) < *nsectors)
return grub_error (GRUB_ERR_OUT_OF_RANGE,
"Your core.img is unusually large. "
"It won't fit in the embedding area.");
N_("your core.img is unusually large. "
"It won't fit in the embedding area"));
*nsectors = (VDEV_BOOT_SIZE >> GRUB_DISK_SECTOR_BITS);
*sectors = grub_malloc (*nsectors * sizeof (**sectors));

View file

@ -45,31 +45,32 @@ print_state (char *nvlist, int tab)
int isok = 1;
print_tabs (tab);
grub_xputs (_("State: "));
if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_REMOVED, &ival))
{
grub_xputs (_("removed "));
grub_puts_ (N_("Virtual device is removed"));
isok = 0;
}
if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_FAULTED, &ival))
{
grub_xputs (_("faulted "));
grub_puts_ (N_("Virtual device is faulted"));
isok = 0;
}
if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_OFFLINE, &ival))
{
grub_xputs (_("offline "));
grub_puts_ (N_("Virtual device is offline"));
isok = 0;
}
if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_FAULTED, &ival))
grub_xputs (_("degraded "));
/* TRANSLATORS: degraded doesn't mean broken but that some of
component are missing but virtual device as whole is still usable. */
grub_puts_ (N_("Virtual device is degraded"));
if (isok)
grub_xputs (_("online"));
grub_puts_ (N_("Virtual device is online"));
grub_xputs ("\n");
return GRUB_ERR_NONE;
@ -85,7 +86,7 @@ print_vdev_info (char *nvlist, int tab)
if (!type)
{
print_tabs (tab);
grub_puts_ (N_("Incorrect VDEV: no type available"));
grub_puts_ (N_("Incorrect virtual device: no type available"));
return grub_errno;
}
@ -96,7 +97,7 @@ print_vdev_info (char *nvlist, int tab)
char *devid = 0;
print_tabs (tab);
grub_puts_ (N_("Leaf VDEV"));
grub_puts_ (N_("Leaf virtual device (file or disk)"));
print_state (nvlist, tab);
@ -137,10 +138,10 @@ print_vdev_info (char *nvlist, int tab)
print_tabs (tab);
if (nelm <= 0)
{
grub_puts_ (N_("Incorrect mirror VDEV"));
grub_puts_ (N_("Incorrect mirror"));
return GRUB_ERR_NONE;
}
grub_printf_ (N_("Mirror VDEV with %d children\n"), nelm);
grub_printf_ (N_("Mirror with %d children\n"), nelm);
print_state (nvlist, tab);
for (i = 0; i < nelm; i++)
{
@ -152,11 +153,11 @@ print_vdev_info (char *nvlist, int tab)
print_tabs (tab);
if (!child)
{
grub_printf_ (N_("Mirror VDEV element %d isn't correct\n"), i);
grub_printf_ (N_("Mirror element %d isn't correct\n"), i);
continue;
}
grub_printf_ (N_("Mirror VDEV element %d:\n"), i);
grub_printf_ (N_("Mirror element %d:\n"), i);
print_vdev_info (child, tab + 1);
grub_free (child);
@ -165,7 +166,7 @@ print_vdev_info (char *nvlist, int tab)
}
print_tabs (tab);
grub_printf_ (N_("Unknown VDEV type: %s\n"), type);
grub_printf_ (N_("Unknown virtual device type: %s\n"), type);
return GRUB_ERR_NONE;
}
@ -298,7 +299,7 @@ grub_cmd_zfsinfo (grub_command_t cmd __attribute__ ((unused)), int argc,
nv = grub_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE);
if (!nv)
grub_puts_ (N_("No vdev tree available"));
grub_puts_ (N_("No virtual device tree available"));
else
print_vdev_info (nv, 1);