]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - po/at-expand.pl
Modify the script which generates the e2fsprogs.pot translations template
[thirdparty/e2fsprogs.git] / po / at-expand.pl
CommitLineData
c0b7e799
TT
1#!/usr/bin/perl
2
3my $is_problem_file = 0;
4my $save_msg;
5my $msg_accum = "";
6my $msg;
7my $expanded = 0;
8
9sub do_expand {
10 $msg =~ s/\@a/extended attribute/g;
11 $msg =~ s/\@A/error allocating/g;
12 $msg =~ s/\@b/block/g;
13 $msg =~ s/\@B/bitmap/g;
14 $msg =~ s/\@c/compress/g;
15 $msg =~ s/\@C/conflicts with some other fs block/g;
16 $msg =~ s/\@i/inode/g;
17 $msg =~ s/\@I/illegal/g;
18 $msg =~ s/\@j/journal/g;
19 $msg =~ s/\@D/deleted/g;
20 $msg =~ s/\@d/directory/g;
21 $msg =~ s/\@e/entry/g;
22 $msg =~ s/\@E/entry '%Dn' in %p (%i)/g;
23 $msg =~ s/\@f/filesystem/g;
24 $msg =~ s/\@F/for inode %i (%Q) is/g;
25 $msg =~ s/\@g/group/g;
26 $msg =~ s/\@h/HTREE directory inode/g;
27 $msg =~ s/\@l/lost+found/g;
28 $msg =~ s/\@L/is a link/g;
29 $msg =~ s/\@o/orphaned/g;
30 $msg =~ s/\@p/problem in/g;
31 $msg =~ s/\@r/root inode/g;
32 $msg =~ s/\@s/should be/g;
33 $msg =~ s/\@S/superblock/g;
34 $msg =~ s/\@u/unattached/g;
35 $msg =~ s/\@v/device/g;
36 $msg =~ s/\@z/zero-length/g;
37 $msg =~ s/\@\@/@/g;
38}
39
40
41while (<>) {
42 if (/^#: /)
43 {
44 $is_problem_file = (/^#: e2fsck\/problem/) ? 1 : 0;
45 }
46 $msg = "";
47 if (/^msgid / && $is_problem_file) {
48 ($msg) = /^msgid "(.*)"$/;
49 $save_msgid = $_;
50 if ($msg =~ /\@/) {
51 $expanded++;
52 }
53 &do_expand();
54 if ($msg ne "") {
55 $msg_accum = $msg_accum . "#. \@-expand: $msg\n";
56 }
57 next;
58 }
59 if (/^"/ && $is_problem_file) {
60 ($msg) = /^"(.*)"$/;
61 $save_msgid = $save_msgid . $_;
62 if ($msg =~ /\@/) {
63 $expanded++;
64 }
65 &do_expand();
66 $msg_accum = $msg_accum . "#. \@-expand: $msg\n";
67 next;
68 }
69 if (/^msgstr / && $is_problem_file) {
70 if ($expanded) {
71 print $msg_accum;
72 }
73 print $save_msgid;
74 $msg_accum = "";
75 $expanded = 0;
76 }
77 print $_;
78}