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

@ -28,6 +28,7 @@
#include <grub/disk.h>
#include <grub/dl.h>
#include <grub/types.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -529,7 +530,7 @@ find_in_b_tree (grub_disk_t disk,
if (err)
return err;
if (node.count_keys == 0)
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found",
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"),
name);
{
char key_data[grub_bfs_to_cpu_treehead (node.total_key_len) + 1];
@ -600,7 +601,7 @@ find_in_b_tree (grub_disk_t disk,
level--;
continue;
}
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found",
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"),
name);
}
}
@ -615,7 +616,7 @@ hop_level (grub_disk_t disk,
grub_uint64_t res;
if (((grub_bfs_to_cpu32 (ino->mode) & ATTR_TYPE) != ATTR_DIR))
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
err = find_in_b_tree (disk, sb, ino, name, &res);
if (err)
@ -677,7 +678,7 @@ find_file (const char *path, grub_disk_t disk,
{
grub_free (alloc);
return grub_error (GRUB_ERR_SYMLINK_LOOP,
"too deep nesting of symlinks");
N_("too deep nesting of symlinks"));
}
#ifndef MODE_AFS
@ -829,7 +830,7 @@ grub_bfs_dir (grub_device_t device, const char *path,
if (err)
return err;
if (((grub_bfs_to_cpu32 (ino.ino.mode) & ATTR_TYPE) != ATTR_DIR))
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
iterate_in_b_tree (device->disk, &sb, &ino.ino, hook);
}
@ -857,7 +858,7 @@ grub_bfs_open (struct grub_file *file, const char *name)
if (err)
return err;
if (((grub_bfs_to_cpu32 (ino.ino.mode) & ATTR_TYPE) != ATTR_REG))
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file"));
data = grub_zalloc (sizeof (struct grub_bfs_data)
+ grub_bfs_to_cpu32 (sb.bsize));

View file

@ -27,6 +27,7 @@
#include <grub/lib/crc.h>
#include <grub/deflate.h>
#include <minilzo.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -1204,7 +1205,7 @@ find_path (struct grub_btrfs_data *data,
{
grub_free (path_alloc);
grub_free (origpath);
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
}
key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM;
@ -1223,7 +1224,7 @@ find_path (struct grub_btrfs_data *data,
{
grub_free (direl);
grub_free (path_alloc);
err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
grub_free (origpath);
return err;
}
@ -1267,7 +1268,7 @@ find_path (struct grub_btrfs_data *data,
{
grub_free (direl);
grub_free (path_alloc);
err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
grub_free (origpath);
return err;
}
@ -1285,7 +1286,7 @@ find_path (struct grub_btrfs_data *data,
grub_free (path_alloc);
grub_free (origpath);
return grub_error (GRUB_ERR_SYMLINK_LOOP,
"too deep nesting of symlinks");
N_("too deep nesting of symlinks"));
}
err = grub_btrfs_read_inode (data, &inode,
@ -1355,7 +1356,7 @@ find_path (struct grub_btrfs_data *data,
{
grub_free (direl);
grub_free (path_alloc);
err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
grub_free (origpath);
return err;
}
@ -1378,7 +1379,7 @@ find_path (struct grub_btrfs_data *data,
{
grub_free (direl);
grub_free (path_alloc);
err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
grub_free (origpath);
return err;
}
@ -1430,7 +1431,7 @@ grub_btrfs_dir (grub_device_t device, const char *path,
if (type != GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY)
{
grub_btrfs_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"));
}
err = lower_bound (data, &key_in, &key_out, tree, &elemaddr, &elemsize, &desc);
@ -1535,7 +1536,7 @@ grub_btrfs_open (struct grub_file *file, const char *name)
if (type != GRUB_BTRFS_DIR_ITEM_TYPE_REGULAR)
{
grub_btrfs_unmount (data);
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file"));
}
data->inode = key_in.object_id;
@ -1628,8 +1629,8 @@ grub_btrfs_embed (grub_device_t device __attribute__ ((unused)),
if (64 * 2 - 1 < *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 = 64 * 2 - 1;
*sectors = grub_malloc (*nsectors * sizeof (**sectors));

View file

@ -22,6 +22,7 @@
#include <grub/misc.h>
#include <grub/disk.h>
#include <grub/dl.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -564,7 +565,7 @@ grub_cpio_dir (grub_device_t device, const char *path_in,
if (++symlinknest == 8)
{
grub_error (GRUB_ERR_SYMLINK_LOOP,
"too deep nesting of symlinks");
N_("too deep nesting of symlinks"));
goto fail;
}
ofs = 0;
@ -622,7 +623,7 @@ grub_cpio_open (grub_file_t file, const char *name_in)
if (!ofs)
{
grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name_in);
break;
}
@ -638,7 +639,7 @@ grub_cpio_open (grub_file_t file, const char *name_in)
if (++symlinknest == 8)
{
grub_error (GRUB_ERR_SYMLINK_LOOP,
"too deep nesting of symlinks");
N_("too deep nesting of symlinks"));
goto fail;
}
goto no_match;

View file

@ -27,6 +27,7 @@
#include <grub/dl.h>
#include <grub/charset.h>
#include <grub/fat.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -687,7 +688,7 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
grub_ssize_t offset = -sizeof(dir);
if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY))
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
/* Allocate space enough to hold a long name. */
filename = grub_malloc (0x40 * 13 * GRUB_MAX_UTF8_PER_UTF16 + 1);
@ -864,7 +865,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY))
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
return 0;
}
@ -896,7 +897,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
grub_fat_iterate_dir (disk, data, iter_hook);
if (grub_errno == GRUB_ERR_NONE && ! found && !call_hook)
grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
fail:
grub_free (dirname);
@ -972,7 +973,7 @@ grub_fat_open (grub_file_t file, const char *name)
if (data->attr & GRUB_FAT_ATTR_DIRECTORY)
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a file");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file"));
goto fail;
}
@ -1086,7 +1087,7 @@ grub_fat_label (grub_device_t device, char **label)
if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY))
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
return 0;
}

View file

@ -23,6 +23,7 @@
#include <grub/disk.h>
#include <grub/fshelp.h>
#include <grub/dl.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -128,7 +129,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
if (type != GRUB_FSHELP_DIR)
{
free_node (currnode);
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
}
/* Iterate over the directory. */
@ -152,7 +153,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
free_node (currnode);
free_node (oldnode);
return grub_error (GRUB_ERR_SYMLINK_LOOP,
"too deep nesting of symlinks");
N_("too deep nesting of symlinks"));
}
symlink = read_symlink (currnode);
@ -196,12 +197,12 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
name = next;
}
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path);
}
if (!path || path[0] != '/')
{
grub_error (GRUB_ERR_BAD_FILENAME, "bad filename");
grub_error (GRUB_ERR_BAD_FILENAME, N_("invalid file name `%s'"), path);
return grub_errno;
}
@ -211,9 +212,9 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
/* Check if the node that was found was of the expected type. */
if (expecttype == GRUB_FSHELP_REG && foundtype != expecttype)
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file"));
else if (expecttype == GRUB_FSHELP_DIR && foundtype != expecttype)
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
return 0;
}

View file

@ -28,6 +28,7 @@
#include <grub/dl.h>
#include <grub/types.h>
#include <grub/hfs.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -1079,7 +1080,7 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path,
if (path[0] != '/')
{
grub_error (GRUB_ERR_BAD_FILENAME, "bad filename");
grub_error (GRUB_ERR_BAD_FILENAME, N_("invalid file name `%s'"), path);
return 0;
}
@ -1096,7 +1097,7 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path,
grub_ssize_t slen;
if (fdrec.frec.type != GRUB_HFS_FILETYPE_DIR)
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
goto fail;
}
@ -1114,7 +1115,7 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path,
slen = utf8_to_macroman (key.str, path);
if (slen < 0)
{
grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path);
goto fail;
}
key.strlen = slen;
@ -1123,7 +1124,7 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path,
if (! grub_hfs_find_node (data, (char *) &key, data->cat_root,
0, (char *) &fdrec.frec, sizeof (fdrec.frec)))
{
grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
goto fail;
}
@ -1207,7 +1208,7 @@ grub_hfs_dir (grub_device_t device, const char *path,
if (frec.type != GRUB_HFS_FILETYPE_DIR)
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
goto fail;
}
@ -1243,7 +1244,7 @@ grub_hfs_open (struct grub_file *file, const char *name)
if (frec.type != GRUB_HFS_FILETYPE_FILE)
{
grub_free (data);
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a file");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file"));
grub_dl_unref (my_mod);
return grub_errno;
}

View file

@ -25,6 +25,7 @@
#include <grub/dl.h>
#include <grub/types.h>
#include <grub/charset.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -403,7 +404,7 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode)
if (!((grub_le_to_cpu32 (inode->mode)
& GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_DIR))
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
return 0;
}
@ -704,7 +705,7 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path,
}
grub_jfs_closedir (diro);
grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path);
return grub_errno;
}
@ -716,7 +717,7 @@ grub_jfs_lookup_symlink (struct grub_jfs_data *data, grub_uint32_t ino)
char symlink[size + 1];
if (++data->linknest > GRUB_JFS_MAX_SYMLNK_CNT)
return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");
return grub_error (GRUB_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks"));
if (size <= sizeof (data->currinode.symlink.path))
grub_strncpy (symlink, (char *) (data->currinode.symlink.path), size);
@ -730,8 +731,6 @@ grub_jfs_lookup_symlink (struct grub_jfs_data *data, grub_uint32_t ino)
ino = 2;
grub_jfs_find_file (data, symlink, ino);
if (grub_errno)
grub_error (grub_errno, "cannot follow symlink `%s'", symlink);
return grub_errno;
}
@ -810,7 +809,7 @@ grub_jfs_open (struct grub_file *file, const char *name)
if (! ((grub_le_to_cpu32 (data->currinode.mode)
& GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_REG))
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file"));
goto fail;
}

View file

@ -24,6 +24,7 @@
#include <grub/disk.h>
#include <grub/dl.h>
#include <grub/types.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -332,7 +333,7 @@ grub_minix_lookup_symlink (struct grub_minix_data *data, int ino)
char symlink[GRUB_MINIX_INODE_SIZE (data) + 1];
if (++data->linknest > GRUB_MINIX_MAX_SYMLNK_CNT)
return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");
return grub_error (GRUB_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks"));
if (grub_minix_read_file (data, 0, 0,
GRUB_MINIX_INODE_SIZE (data), symlink) < 0)
@ -349,8 +350,6 @@ grub_minix_lookup_symlink (struct grub_minix_data *data, int ino)
return grub_errno;
grub_minix_find_file (data, symlink);
if (grub_errno)
grub_error (grub_errno, "cannot follow symlink `%s'", symlink);
return grub_errno;
}
@ -433,7 +432,7 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path)
if ((GRUB_MINIX_INODE_MODE (data)
& GRUB_MINIX_IFDIR) != GRUB_MINIX_IFDIR)
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
continue;
}
@ -441,7 +440,7 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path)
pos += sizeof (ino) + data->filename_size;
} while (pos < GRUB_MINIX_INODE_SIZE (data));
grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path);
return grub_errno;
}
@ -532,7 +531,7 @@ grub_minix_dir (grub_device_t device, const char *path,
if ((GRUB_MINIX_INODE_MODE (data) & GRUB_MINIX_IFDIR) != GRUB_MINIX_IFDIR)
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
goto fail;
}
@ -600,7 +599,7 @@ grub_minix_open (struct grub_file *file, const char *name)
if (!name || name[0] != '/')
{
grub_error (GRUB_ERR_BAD_FILENAME, "bad filename");
grub_error (GRUB_ERR_BAD_FILENAME, N_("invalid file name `%s'"), name);
return grub_errno;
}

View file

@ -38,6 +38,7 @@
#include <grub/dl.h>
#include <grub/types.h>
#include <grub/fshelp.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -477,6 +478,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data,
grub_uint16_t previous_level = ~0;
struct grub_reiserfs_item_header *item_headers = 0;
#if 0
if (! data)
{
grub_error (GRUB_ERR_BAD_FS, "data is NULL");
@ -494,6 +496,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data,
grub_error (GRUB_ERR_BAD_FS, "item is NULL");
goto fail;
}
#endif
block_size = grub_le_to_cpu16 (data->superblock.block_size);
block_number = grub_le_to_cpu32 (data->superblock.root_block);
@ -725,8 +728,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item,
if (item->type != GRUB_REISERFS_DIRECTORY)
{
grub_error (GRUB_ERR_BAD_FILE_TYPE,
"grub_reiserfs_iterate_dir called on a non-directory item");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
goto fail;
}
block_size = grub_le_to_cpu16 (data->superblock.block_size);
@ -754,7 +756,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item,
#if 0
if (grub_le_to_cpu16 (block_header->level) != 1)
{
grub_error (GRUB_ERR_TEST_FAILURE,
grub_error (GRUB_ERR_BAD_FS,
"reiserfs: block %d is not a leaf block",
block_number);
goto fail;

View file

@ -24,6 +24,7 @@
#include <grub/disk.h>
#include <grub/dl.h>
#include <grub/types.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -398,7 +399,7 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
char symlink[INODE_SIZE (data) + 1];
if (++data->linknest > GRUB_UFS_MAX_SYMLNK_CNT)
return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");
return grub_error (GRUB_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks"));
if (INODE_SIZE (data) <= sizeof (data->inode.symlink))
grub_strcpy (symlink, (char *) INODE (data, symlink));
@ -415,8 +416,6 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
return grub_errno;
grub_ufs_find_file (data, symlink);
if (grub_errno)
grub_error (grub_errno, "cannot follow symlink `%s'", symlink);
return grub_errno;
}
@ -504,7 +503,7 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
}
if ((INODE_MODE(data) & GRUB_UFS_ATTR_TYPE) != GRUB_UFS_ATTR_DIR)
return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
continue;
}
@ -513,7 +512,7 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
pos += grub_le_to_cpu16 (dirent.direntlen);
} while (pos < INODE_SIZE (data));
grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path);
return grub_errno;
}
@ -589,7 +588,7 @@ grub_ufs_dir (grub_device_t device, const char *path,
if (!path || path[0] != '/')
{
grub_error (GRUB_ERR_BAD_FILENAME, "bad filename");
grub_error (GRUB_ERR_BAD_FILENAME, N_("invalid file name `%s'"), path);
return grub_errno;
}
@ -599,7 +598,7 @@ grub_ufs_dir (grub_device_t device, const char *path,
if ((INODE_MODE (data) & GRUB_UFS_ATTR_TYPE) != GRUB_UFS_ATTR_DIR)
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
goto fail;
}
@ -669,7 +668,7 @@ grub_ufs_open (struct grub_file *file, const char *name)
if (!name || name[0] != '/')
{
grub_error (GRUB_ERR_BAD_FILENAME, "bad filename");
grub_error (GRUB_ERR_BAD_FILENAME, N_("invalid file name `%s'"), name);
return grub_errno;
}

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);