Skip to content

Commit 70532ed

Browse files
Benno Schulenbergkarelzak
authored andcommitted
raw: remove constants from message strings; undo some abbrevs
Having a constant embedded within a message string prevents gettext from picking up the rest of the string. Also, translators may wish to change word order; using a constant as a prefix or postfix makes this impossible. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
1 parent 3c06229 commit 70532ed

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

disk-utils/raw.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ static void usage(int err)
4848
{
4949
fprintf(stderr,
5050
_("Usage:\n"
51-
" %s " RAWDEVDIR "rawN <major> <minor>\n"
52-
" %s " RAWDEVDIR "rawN /dev/<blockdev>\n"
53-
" %s -q " RAWDEVDIR "rawN\n"
54-
" %s -qa\n"),
55-
progname, progname, progname, progname);
51+
" %1$s %2$srawN <major> <minor>\n"
52+
" %1$s %2$srawN /dev/<blockdevice>\n"
53+
" %1$s -q %2$srawN\n"
54+
" %1$s -qa\n"),
55+
progname, RAWDEVDIR);
5656
exit(err);
5757
}
5858

@@ -122,7 +122,7 @@ int main(int argc, char *argv[])
122122

123123
if (raw_minor == 0) {
124124
fprintf (stderr,
125-
_("Device '%s' is control raw dev "
125+
_("Device '%s' is the control raw device "
126126
"(use raw<N> where <N> is greater than zero)\n"),
127127
raw_name);
128128
exit(2);
@@ -148,7 +148,7 @@ int main(int argc, char *argv[])
148148
}
149149

150150
if (!S_ISBLK(statbuf.st_mode)) {
151-
fprintf (stderr, _("Device '%s' is not a block dev\n"),
151+
fprintf (stderr, _("Device '%s' is not a block device\n"),
152152
block_name);
153153
exit(2);
154154
}
@@ -183,9 +183,8 @@ void open_raw_ctl(void)
183183
master_fd = open(RAWDEVCTL_OLD, O_RDWR, 0);
184184
if (master_fd < 0) {
185185
fprintf (stderr,
186-
_("Cannot open master raw device '"
187-
RAWDEVCTL
188-
"' (%s)\n"), strerror(errsv));
186+
_("Cannot open master raw device '%s' (%s)\n"),
187+
RAWDEVCTL, strerror(errsv));
189188
exit(2);
190189
}
191190
}
@@ -238,8 +237,8 @@ int query(int minor, const char *raw_name, int quiet)
238237
has_worked = 1;
239238
if (quiet && !rq.block_major && !rq.block_minor)
240239
return 0;
241-
printf (_(RAWDEVDIR "raw%d: bound to major %d, minor %d\n"),
242-
minor, (int) rq.block_major, (int) rq.block_minor);
240+
printf (_("%sraw%d: bound to major %d, minor %d\n"),
241+
RAWDEVDIR, minor, (int) rq.block_major, (int) rq.block_minor);
243242
return 0;
244243
}
245244

@@ -258,8 +257,8 @@ int bind(int minor, int block_major, int block_minor)
258257
strerror(errno));
259258
exit(3);
260259
}
261-
printf (_(RAWDEVDIR "raw%d: bound to major %d, minor %d\n"),
262-
raw_minor, (int) rq.block_major, (int) rq.block_minor);
260+
printf (_("%sraw%d: bound to major %d, minor %d\n"),
261+
RAWDEVDIR, raw_minor, (int) rq.block_major, (int) rq.block_minor);
263262
return 0;
264263
}
265264

0 commit comments

Comments
 (0)