From 906b329ab85eb70b91427abef268bdda85991c17 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 10 Feb 2007 23:25:51 +0000 Subject: [PATCH] Use l10n-friendlier strings to describe dependencies. Closes: #390916 Thanks to Ian Jackson. --- ChangeLog | 6 ++++++ debian/changelog | 2 ++ src/depcon.c | 43 +++++++++++++++++++++++++++++++++---------- 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c2dbf63..b0f61f41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-02-11 Ian Jackson + Guillem Jover + + * src/depcon.c (describedepcon): Use format arguments to make the + strings l10n-friendlier. + 2007-02-04 Julien Cristau * scripts/dpkg-source.pl ($diff_ignore_default_regexp): Add diff --git a/debian/changelog b/debian/changelog index 5ff807c1..ad3988aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,8 @@ dpkg (1.14.0) UNRELEASED; urgency=low Thanks to Frank Lichtenheld. * Add '.gitignore' to the default dpkg-source -i regex. Closes: #409566 Thanks to Julien Cristau. + * Use l10n-friendlier strings to describe dependencies. Closes: #390916 + Thanks to Ian Jackson. [ Updated dpkg translations ] * Romanian (Eddy Petrișor). diff --git a/src/depcon.c b/src/depcon.c index 835c90cc..a54279cb 100644 --- a/src/depcon.c +++ b/src/depcon.c @@ -148,18 +148,41 @@ int findbreakcycle(struct pkginfo *pkg) { } void describedepcon(struct varbuf *addto, struct dependency *dep) { - varbufaddstr(addto,dep->up->name); + const char *fmt; + struct varbuf depstr; + switch (dep->type) { - case dep_depends: varbufaddstr(addto, _(" depends on ")); break; - case dep_predepends: varbufaddstr(addto, _(" pre-depends on ")); break; - case dep_recommends: varbufaddstr(addto, _(" recommends ")); break; - case dep_breaks: varbufaddstr(addto, _(" breaks ")); break; - case dep_conflicts: varbufaddstr(addto, _(" conflicts with ")); break; - case dep_suggests: varbufaddstr(addto, _(" suggests ")); break; - case dep_enhances: varbufaddstr(addto, _(" enhances ")); break; - default: internerr("unknown deptype"); + case dep_depends: + fmt = _("%s depends on %s"); + break; + case dep_predepends: + fmt = _("%s pre-depends on %s"); + break; + case dep_recommends: + fmt = _("%s recommends %s"); + break; + case dep_suggests: + fmt = _("%s suggests %s"); + break; + case dep_breaks: + fmt = _("%s breaks %s"); + break; + case dep_conflicts: + fmt = _("%s conflicts with %s"); + break; + case dep_enhances: + fmt = _("%s enhances %s"); + break; + default: + internerr("unknown deptype"); } - varbufdependency(addto, dep); + + varbufinit(&depstr); + varbufdependency(&depstr, dep); + varbufaddc(&depstr, 0); + + varbufprintf(addto, fmt, dep->up->name, depstr.buf); + varbuffree(&depstr); } int depisok(struct dependency *dep, struct varbuf *whynot, -- 2.39.5