From 2b8e678a60c7906ba6a1568e28f2eba8ccb300d0 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 21 Apr 2006 02:03:16 +0000 Subject: [PATCH] Fix strings so that they can be more easily translated. Closes: #134358 --- ChangeLog | 12 ++++++++++++ debian/changelog | 3 +++ dpkg-deb/extract.c | 22 ++++++++++++++-------- lib/dbmodify.c | 5 +++-- lib/parsehelp.c | 6 +++--- lib/showcright.c | 3 ++- src/main.c | 7 +++++-- src/packages.c | 46 +++++++++++++++++++++++++--------------------- src/query.c | 14 ++++++++++---- 9 files changed, 77 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index cde4039c..93090edc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-04-21 Guillem Jover + + * src/query.c (enqperpackage): Change dynamically consutructed + grammar to proper sentences. + * src/packages.c (deppossi_ok_found): Likewise. + * src/main.c (commandfd): Do not use digits, use textual numbers. + * lib/dbmodify.c (createimptmp): Use proper verb forms. + * lib/showcright.c (showcopyright): Remove trailing space from string. + * lib/parsehelp.c (illegal_packagename): Clarify what is the last '%s'. + * dpkg-deb/extract.c (movecontrolfiles): Likewise. + (extracthalf): Do not use abbreviations in the strings. + 2006-04-21 Guillem Jover * src/main.c (printforhelp, setdebug, setforce): Quote each string diff --git a/debian/changelog b/debian/changelog index a8d2bfa2..c9ca59ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,9 @@ dpkg (1.13.19~) UNRELEASED; urgency=low * Generate the Russian man pages in the KOI8-R charset. Closes: #361987 * Document the shlibs.local format in dpkg-source(1). CLoses: #316485 + [ Guillem Jover ] + * Fix strings so that they can be more easily translated. Closes: #134358 + -- Bart Cornelis (cobaco) Thu, 13 Apr 2006 12:51:15 +0200 dpkg (1.13.18) unstable; urgency=low diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c index 67846d93..e886a7f9 100644 --- a/dpkg-deb/extract.c +++ b/dpkg-deb/extract.c @@ -56,7 +56,7 @@ static void movecontrolfiles(const char *thing) { static void readfail(FILE *a, const char *filename, const char *what) NONRETURNING; static void readfail(FILE *a, const char *filename, const char *what) { if (ferror(a)) { - ohshite(_("error reading %s from %.255s"),what,filename); + ohshite(_("error reading %s from file %.255s"), what, filename); } else { ohshit(_("unexpected end of file in %s in %.255s"),what,filename); } @@ -192,9 +192,9 @@ void extracthalf(const char *debar, const char *directory, oldformat= 1; l= strlen(versionbuf); if (l && versionbuf[l-1]=='\n') versionbuf[l-1]=0; if (!fgets(ctrllenbuf,sizeof(ctrllenbuf),ar)) - readfail(ar,debar,_("ctrl information length")); + readfail(ar, debar, _("control information length")); if (sscanf(ctrllenbuf,"%zi%c%d",&ctrllennum,&nlc,&dummy) !=2 || nlc != '\n') - ohshit(_("archive has malformatted ctrl len `%s'"),ctrllenbuf); + ohshit(_("archive has malformatted control length `%s'"), ctrllenbuf); if (admininfo >= 2) if (printf(_(" old debian package, version %s.\n" @@ -203,10 +203,12 @@ void extracthalf(const char *debar, const char *directory, (long) (stab.st_size - ctrllennum - strlen(ctrllenbuf) - l)) == EOF || fflush(stdout)) werr("stdout"); - ctrlarea= malloc(ctrllennum); if (!ctrlarea) ohshite("malloc ctrlarea failed"); + ctrlarea = malloc(ctrllennum); + if (!ctrlarea) + ohshite(_("failed allocating memory for variable `ctrlarea'")); errno=0; if (fread(ctrlarea,1,ctrllennum,ar) != ctrllennum) - readfail(ar,debar,_("ctrlarea")); + readfail(ar, debar, _("control area")); } else { @@ -222,18 +224,22 @@ void extracthalf(const char *debar, const char *directory, } #if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ > 0) - if(fgetpos(ar, &fpos)) ohshit(_("fgetpos failed")); + if (fgetpos(ar, &fpos)) + ohshit(_("failed getting the current file position")); #endif fflush(ar); #if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ > 0) - if(fsetpos(ar, &fpos)) ohshit(_("fsetpos failed")); + if (fsetpos(ar, &fpos)) + ohshit(_("failed setting the current file position")); #endif if (oldformat) { if (admininfo) { m_pipe(p1); if (!(c1= m_fork())) { close(p1[0]); - if (!(pi= fdopen(p1[1],"w"))) ohshite(_("failed to fdopen p1 in paste")); + pi = fdopen(p1[1], "w"); + if (!pi) + ohshite(_("failed to open pipe descriptor `1' in paste")); errno=0; if (fwrite(ctrlarea,1,ctrllennum,pi) != ctrllennum) ohshit(_("failed to write to gzip -dc")); if (fclose(pi)) ohshit(_("failed to close gzip -dc")); diff --git a/lib/dbmodify.c b/lib/dbmodify.c index 720c96e9..a0d68735 100644 --- a/lib/dbmodify.c +++ b/lib/dbmodify.c @@ -113,9 +113,10 @@ static void createimptmp(void) { if (ferror(importanttmp)) ohshite(_("unable to fill %.250s with padding"),importanttmpfile); if (fflush(importanttmp)) - ohshite(_("unable flush %.250s after padding"),importanttmpfile); + ohshite(_("unable to flush %.250s after padding"), importanttmpfile); if (fseek(importanttmp,0,SEEK_SET)) - ohshite(_("unable seek to start of %.250s after padding"),importanttmpfile); + ohshite(_("unable to seek to start of %.250s after padding"), + importanttmpfile); onerr_abort--; } diff --git a/lib/parsehelp.c b/lib/parsehelp.c index dbdff0fb..1c181bda 100644 --- a/lib/parsehelp.c +++ b/lib/parsehelp.c @@ -119,9 +119,9 @@ const char *illegal_packagename(const char *p, const char **ep) { while (isspace(*p)) p++; *ep= p; return NULL; } - snprintf(buf, sizeof(buf), - _("character `%c' not allowed - only letters, digits and %s allowed"), - c, alsoallowed); + snprintf(buf, sizeof(buf), _( + "character `%c' not allowed (only letters, digits and characters `%s')"), + c, alsoallowed); return buf; } diff --git a/lib/showcright.c b/lib/showcright.c index 8849c752..3f130c68 100644 --- a/lib/showcright.c +++ b/lib/showcright.c @@ -30,7 +30,8 @@ void showcopyright(const struct cmdinfo *c, const char *v) NONRETURNING; void showcopyright(const struct cmdinfo *c, const char *v) { int fd; fd= open(COPYINGFILE,O_RDONLY); - if (fd < 0) ohshite(_("cannot open GPL file ")); + if (fd < 0) + ohshite(_("cannot open GPL file")); fd_fd_copy(fd, 1, -1, "showcopyright"); exit(0); } diff --git a/src/main.c b/src/main.c index d80c284a..99d68e24 100644 --- a/src/main.c +++ b/src/main.c @@ -514,8 +514,11 @@ void commandfd(const char *const *argv) { int c, lno, infd, i, skipchar; static void (*actionfunction)(const char *const *argv); - if ((pipein= *argv++) == NULL) badusage(_("--command-fd takes 1 argument, not 0")); - if (*argv) badusage(_("--command-fd only takes 1 argument")); + pipein = *argv++; + if (pipein == NULL) + badusage(_("--command-fd takes one argument, not zero")); + if (*argv) + badusage(_("--command-fd only takes one argument")); if ((infd= strtol(pipein, (char **)NULL, 10)) == -1) ohshite(_("invalid number for --command-fd")); if ((in= fdopen(infd, "r")) == NULL) diff --git a/src/packages.c b/src/packages.c index 1c81b188..d265737e 100644 --- a/src/packages.c +++ b/src/packages.c @@ -264,13 +264,15 @@ static int deppossi_ok_found(struct pkginfo *possdependee, } thisf= 0; if (possdependee == removing) { - varbufaddstr(oemsgs,_(" Package ")); - varbufaddstr(oemsgs,possdependee->name); if (providing) { - varbufaddstr(oemsgs,_(" which provides ")); - varbufaddstr(oemsgs,providing->name); + varbufprintf(oemsgs, + _(" Package %s which provides %s is to be removed.\n"), + possdependee->name, providing->name); + } else { + varbufprintf(oemsgs, _(" Package %s is to be removed.\n"), + possdependee->name); } - varbufaddstr(oemsgs,_(" is to be removed.\n")); + *matched= 1; if (fc_depends) thisf= (dependtry >= 4) ? 2 : 1; debug(dbg_depcondetail," removing possdependee, returning %d",thisf); @@ -282,12 +284,10 @@ static int deppossi_ok_found(struct pkginfo *possdependee, case stat_halfconfigured: assert(possdependee->installed.valid); if (checkversion && !versionsatisfied(&possdependee->installed,checkversion)) { - varbufaddstr(oemsgs,_(" Version of ")); - varbufaddstr(oemsgs,possdependee->name); - varbufaddstr(oemsgs,_(" on system is ")); - varbufaddstr(oemsgs,versiondescribe(&possdependee->installed.version, - vdew_nonambig)); - varbufaddstr(oemsgs,".\n"); + varbufprintf(oemsgs, _(" Version of %s on system is %s.\n"), + possdependee->name, + versiondescribe(&possdependee->installed.version, + vdew_nonambig)); assert(checkversion->verrel != dvr_none); if (fc_depends) thisf= (dependtry >= 3) ? 2 : 1; debug(dbg_depcondetail," bad version, returning %d",thisf); @@ -308,26 +308,30 @@ static int deppossi_ok_found(struct pkginfo *possdependee, possdependee->name, requiredby->name); add_to_queue(possdependee); sincenothing=0; return 1; } else { - varbufaddstr(oemsgs,_(" Package ")); - varbufaddstr(oemsgs,possdependee->name); if (providing) { - varbufaddstr(oemsgs,_(" which provides ")); - varbufaddstr(oemsgs,providing->name); + varbufprintf(oemsgs, + _(" Package %s which provides %s is not configured yet.\n"), + possdependee->name, providing->name); + } else { + varbufprintf(oemsgs, _(" Package %s is not configured yet.\n"), + possdependee->name); } - varbufaddstr(oemsgs,_(" is not configured yet.\n")); + if (fc_depends) thisf= (dependtry >= 4) ? 2 : 1; debug(dbg_depcondetail," not configured/able - returning %d",thisf); (*interestingwarnings)++; return thisf; } default: - varbufaddstr(oemsgs,_(" Package ")); - varbufaddstr(oemsgs,possdependee->name); if (providing) { - varbufaddstr(oemsgs,_(" which provides ")); - varbufaddstr(oemsgs,providing->name); + varbufprintf(oemsgs, + _(" Package %s which provides %s is not installed.\n"), + possdependee->name, providing->name); + } else { + varbufprintf(oemsgs, _(" Package %s is not installed.\n"), + possdependee->name); } - varbufaddstr(oemsgs,_(" is not installed.\n")); + if (fc_depends) thisf= (dependtry >= 4) ? 2 : 1; debug(dbg_depcondetail," not installed - returning %d",thisf); (*interestingwarnings)++; diff --git a/src/query.c b/src/query.c index 032c2a0e..d0bc00e7 100644 --- a/src/query.c +++ b/src/query.c @@ -372,10 +372,16 @@ void enqperpackage(const char *const *argv) { namenode= file->namenode; puts(namenode->name); if (namenode->divert && !namenode->divert->camefrom) { - if (!namenode->divert->pkg) printf(_("locally diverted")); - else if (pkg == namenode->divert->pkg) printf(_("package diverts others")); - else printf(_("diverted by %s"),namenode->divert->pkg->name); - printf(_(" to: %s\n"),namenode->divert->useinstead->name); + if (!namenode->divert->pkg) + printf(_("locally diverted to: %s\n"), + namenode->divert->useinstead->name); + else if (pkg == namenode->divert->pkg) + printf(_("package diverts others to: %s\n"), + namenode->divert->useinstead->name); + else + printf(_("diverted by %s to: %s\n"), + namenode->divert->pkg->name, + namenode->divert->useinstead->name); } file= file->next; } -- 2.39.5