2005-05-10 08:39:02 +08:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
2005-06-19 21:45:36 +08:00
|
|
|
my @translator_help = (
|
|
|
|
"#. The strings in e2fsck's problem.c can be very hard to translate,\n",
|
|
|
|
"#. since the strings are expanded in two different ways. First of all,\n",
|
|
|
|
"#. there is an \@-expansion, where strings like \"\@i\" are expanded to\n",
|
|
|
|
"#. \"inode\", and so on. In order to make it easier for translators, the\n",
|
|
|
|
"#. e2fsprogs po template file has been enhanced with comments that show\n",
|
|
|
|
"#. the \@-expansion, for the strings in the problem.c file.\n",
|
|
|
|
"#.\n",
|
|
|
|
"#. Translators are free to use the \@-expansion facility if they so\n",
|
|
|
|
"#. choose, by providing translations for strings in e2fsck/message.c.\n",
|
|
|
|
"#. These translation can completely replace an expansion; for example,\n",
|
|
|
|
"#. if \"bblock\" (which indicated that \"\@b\" would be expanded to \"block\")\n",
|
|
|
|
"#. is translated as \"ddatenverlust\", then \"\@d\" will be expanded to\n",
|
|
|
|
"#. \"datenverlust\". Alternatively, translators can simply not use the\n",
|
|
|
|
"#. \@-expansion facility at all.\n",
|
|
|
|
"#.\n",
|
|
|
|
"#. The second expansion which is done for e2fsck's problem.c messages is\n",
|
|
|
|
"#. a dynamic %-expansion, which expands %i as an inode number, and so\n",
|
|
|
|
"#. on. A table of these expansions can be found below. Note that\n",
|
|
|
|
"#. %-expressions that begin with \"%D\" and \"%I\" are two-character\n",
|
|
|
|
"#. expansions; so for example, \"%Iu\" expands to the inode's user id\n",
|
2014-06-04 09:59:31 +08:00
|
|
|
"#. ownership field (inode->i_uid). Also the \"%B\" expansion is special:\n",
|
|
|
|
"#. it can expand to either the string \"indirect block\" (possibly preceded\n",
|
|
|
|
"#. by the word \"double\" or \"triple\"), or the string \"block #\" immediately\n",
|
|
|
|
"#. followed by an integer indicating a block sequence number.\n",
|
2005-06-19 21:45:36 +08:00
|
|
|
"#. \n",
|
|
|
|
"#. %b <blk> block number\n",
|
2014-06-04 09:59:31 +08:00
|
|
|
"#. %B \"indirect block\" | \"block #\"<blkcount> string | string+integer\n",
|
2005-06-19 21:45:36 +08:00
|
|
|
"#. %c <blk2> block number\n",
|
|
|
|
"#. %Di <dirent> -> ino inode number\n",
|
|
|
|
"#. %Dn <dirent> -> name string\n",
|
|
|
|
"#. %Dr <dirent> -> rec_len\n",
|
|
|
|
"#. %Dl <dirent> -> name_len\n",
|
|
|
|
"#. %Dt <dirent> -> filetype\n",
|
|
|
|
"#. %d <dir> inode number\n",
|
|
|
|
"#. %g <group> integer\n",
|
|
|
|
"#. %i <ino> inode number\n",
|
|
|
|
"#. %Is <inode> -> i_size\n",
|
|
|
|
"#. %IS <inode> -> i_extra_isize\n",
|
|
|
|
"#. %Ib <inode> -> i_blocks\n",
|
|
|
|
"#. %Il <inode> -> i_links_count\n",
|
|
|
|
"#. %Im <inode> -> i_mode\n",
|
|
|
|
"#. %IM <inode> -> i_mtime\n",
|
|
|
|
"#. %IF <inode> -> i_faddr\n",
|
|
|
|
"#. %If <inode> -> i_file_acl\n",
|
|
|
|
"#. %Id <inode> -> i_dir_acl\n",
|
|
|
|
"#. %Iu <inode> -> i_uid\n",
|
|
|
|
"#. %Ig <inode> -> i_gid\n",
|
2014-06-02 05:29:50 +08:00
|
|
|
"#. %It <str> file type\n",
|
2005-06-19 21:45:36 +08:00
|
|
|
"#. %j <ino2> inode number\n",
|
|
|
|
"#. %m <com_err error message>\n",
|
|
|
|
"#. %N <num>\n",
|
|
|
|
"#. %p ext2fs_get_pathname of directory <ino>\n",
|
|
|
|
"#. %P ext2fs_get_pathname of <dirent>->ino with <ino2> as\n",
|
|
|
|
"#. the containing directory. (If dirent is NULL\n",
|
|
|
|
"#. then return the pathname of directory <ino2>)\n",
|
|
|
|
"#. %q ext2fs_get_pathname of directory <dir>\n",
|
|
|
|
"#. %Q ext2fs_get_pathname of directory <ino> with <dir> as\n",
|
|
|
|
"#. the containing directory.\n",
|
|
|
|
"#. %s <str> miscellaneous string\n",
|
|
|
|
"#. %S backup superblock\n",
|
|
|
|
"#. %X <num> hexadecimal format\n",
|
|
|
|
"#.\n");
|
|
|
|
|
2005-05-10 08:39:02 +08:00
|
|
|
my $is_problem_file = 0;
|
|
|
|
my $save_msg;
|
|
|
|
my $msg_accum = "";
|
|
|
|
my $msg;
|
|
|
|
my $expanded = 0;
|
2005-06-19 21:45:36 +08:00
|
|
|
my $lines = 0;
|
2005-05-10 08:39:02 +08:00
|
|
|
|
|
|
|
sub do_expand {
|
|
|
|
$msg =~ s/\@a/extended attribute/g;
|
|
|
|
$msg =~ s/\@A/error allocating/g;
|
|
|
|
$msg =~ s/\@b/block/g;
|
|
|
|
$msg =~ s/\@B/bitmap/g;
|
|
|
|
$msg =~ s/\@c/compress/g;
|
|
|
|
$msg =~ s/\@C/conflicts with some other fs block/g;
|
|
|
|
$msg =~ s/\@i/inode/g;
|
|
|
|
$msg =~ s/\@I/illegal/g;
|
|
|
|
$msg =~ s/\@j/journal/g;
|
|
|
|
$msg =~ s/\@D/deleted/g;
|
|
|
|
$msg =~ s/\@d/directory/g;
|
|
|
|
$msg =~ s/\@e/entry/g;
|
|
|
|
$msg =~ s/\@E/entry '%Dn' in %p (%i)/g;
|
|
|
|
$msg =~ s/\@f/filesystem/g;
|
|
|
|
$msg =~ s/\@F/for inode %i (%Q) is/g;
|
|
|
|
$msg =~ s/\@g/group/g;
|
|
|
|
$msg =~ s/\@h/HTREE directory inode/g;
|
|
|
|
$msg =~ s/\@l/lost+found/g;
|
|
|
|
$msg =~ s/\@L/is a link/g;
|
2005-06-19 21:45:36 +08:00
|
|
|
$msg =~ s/\@m/multiply-claimed/g;
|
|
|
|
$msg =~ s/\@n/invalid/g;
|
2005-05-10 08:39:02 +08:00
|
|
|
$msg =~ s/\@o/orphaned/g;
|
|
|
|
$msg =~ s/\@p/problem in/g;
|
2011-10-10 04:13:50 +08:00
|
|
|
$msg =~ s/\@q/quota/g;
|
2005-05-10 08:39:02 +08:00
|
|
|
$msg =~ s/\@r/root inode/g;
|
|
|
|
$msg =~ s/\@s/should be/g;
|
|
|
|
$msg =~ s/\@S/superblock/g;
|
|
|
|
$msg =~ s/\@u/unattached/g;
|
|
|
|
$msg =~ s/\@v/device/g;
|
2008-08-28 07:00:50 +08:00
|
|
|
$msg =~ s/\@x/extent/g;
|
2005-05-10 08:39:02 +08:00
|
|
|
$msg =~ s/\@z/zero-length/g;
|
|
|
|
$msg =~ s/\@\@/@/g;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
while (<>) {
|
2005-06-19 21:45:36 +08:00
|
|
|
$lines++;
|
|
|
|
if ($lines == 6) {
|
|
|
|
print @translator_help;
|
|
|
|
}
|
2005-05-10 08:39:02 +08:00
|
|
|
if (/^#: /)
|
|
|
|
{
|
|
|
|
$is_problem_file = (/^#: e2fsck\/problem/) ? 1 : 0;
|
|
|
|
}
|
|
|
|
$msg = "";
|
|
|
|
if (/^msgid / && $is_problem_file) {
|
|
|
|
($msg) = /^msgid "(.*)"$/;
|
|
|
|
$save_msgid = $_;
|
|
|
|
if ($msg =~ /\@/) {
|
|
|
|
$expanded++;
|
|
|
|
}
|
|
|
|
&do_expand();
|
|
|
|
if ($msg ne "") {
|
2005-06-19 21:45:36 +08:00
|
|
|
$msg_accum = $msg_accum . "#. \@-expanded: $msg\n";
|
2005-05-10 08:39:02 +08:00
|
|
|
}
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
if (/^"/ && $is_problem_file) {
|
|
|
|
($msg) = /^"(.*)"$/;
|
|
|
|
$save_msgid = $save_msgid . $_;
|
|
|
|
if ($msg =~ /\@/) {
|
|
|
|
$expanded++;
|
|
|
|
}
|
|
|
|
&do_expand();
|
2005-06-19 21:45:36 +08:00
|
|
|
$msg_accum = $msg_accum . "#. \@-expanded: $msg\n";
|
2005-05-10 08:39:02 +08:00
|
|
|
next;
|
|
|
|
}
|
|
|
|
if (/^msgstr / && $is_problem_file) {
|
|
|
|
if ($expanded) {
|
|
|
|
print $msg_accum;
|
|
|
|
}
|
|
|
|
print $save_msgid;
|
|
|
|
$msg_accum = "";
|
|
|
|
$expanded = 0;
|
|
|
|
}
|
|
|
|
print $_;
|
|
|
|
}
|