+2007-08-14 Guillem Jover <guillem@debian.org>
+
+ * lib/parsehelp.c (parseerr): Switch from ternary operator to compose
+ a string to a conditional call to the function with two different
+ strings, making life easier for translators.
+ * src/archives.c (tarobject): Likewise.
+ * src/query.c (searchoutput): Switch from a loop with two iterations
+ and ternary operators to compose strings to a conditional with two
+ sequential calls with different strings, making life easier for
+ translators.
+
2007-08-14 Guillem Jover <guillem@debian.org>
* dpkg-split/main.c (rerr): Adjust string so that it gets merged by
va_list al;
char buf1[768], buf2[1000], *p, *q;
if (file && ferror(file)) ohshite(_("failed to read `%s' at line %d"),filename,lno);
- sprintf(buf1, _("%s, in file `%.255s' near line %d"),
- warnonly ? _("warning") : _("parse error"), filename, lno);
+
+ if (warnonly)
+ sprintf(buf1, _("warning, in file `%.255s' near line %d"),
+ filename, lno);
+ else
+ sprintf(buf1, _("parse error, in file `%.255s' near line %d"),
+ filename, lno);
+
if (pigp && pigp->name) {
sprintf(buf2, _(" package `%.255s'"), pigp->name);
strcat(buf1,buf2);
if (nifd->namenode->divert && nifd->namenode->divert->camefrom) {
divpkg= nifd->namenode->divert->pkg;
- forcibleerr(fc_overwritediverted,
- _("trying to overwrite `%.250s', which is the "
- "diverted version of `%.250s'%.10s%.100s%.10s"),
- nifd->namenode->name,
- nifd->namenode->divert->camefrom->name,
- divpkg ? _(" (package: ") : "",
- divpkg ? divpkg->name : "",
- divpkg ? ")" : "");
+
+ if (divpkg) {
+ forcibleerr(fc_overwritediverted,
+ _("trying to overwrite `%.250s', which is the "
+ "diverted version of `%.250s' (package: %.100s)"),
+ nifd->namenode->name, nifd->namenode->divert->camefrom->name,
+ divpkg->name);
+ } else {
+ forcibleerr(fc_overwritediverted,
+ _("trying to overwrite `%.250s', which is the "
+ "diverted version of `%.250s'"),
+ nifd->namenode->name, nifd->namenode->divert->camefrom->name);
+ }
}
usename= namenodetouse(nifd->namenode,tc->pkg)->name + 1; /* Skip the leading `/' */
struct filepackages *packageslump;
if (namenode->divert) {
- for (i=0; i<2; i++) {
- if (namenode->divert->pkg) printf(_("diversion by %s"),namenode->divert->pkg->name);
- else printf(_("local diversion"));
- printf(" %s: %s\n", i ? _("to") : _("from"),
- i ?
- (namenode->divert->useinstead
- ? namenode->divert->useinstead->name
- : namenode->name)
- :
- (namenode->divert->camefrom
- ? namenode->divert->camefrom->name
- : namenode->name));
+ const char *name_from = namenode->divert->camefrom ?
+ namenode->divert->camefrom->name : namenode->name;
+ const char *name_to = namenode->divert->useinstead ?
+ namenode->divert->useinstead->name : namenode->name;
+
+ if (namenode->divert->pkg) {
+ printf(_("diversion by %s from: %s\n"),
+ namenode->divert->pkg->name, name_from);
+ printf(_("diversion by %s to: %s\n"),
+ namenode->divert->pkg->name, name_to);
+ } else {
+ printf(_("local diversion from: %s\n"), name_from);
+ printf(_("local diversion to: %s\n"), name_to);
}
}
found= 0;