Просмотр исходного кода

Fix strings so that they can be more easily translated. Closes: #134358

Guillem Jover лет назад: 20
Родитель
Сommit
2b8e678a60
9 измененных файлов с 77 добавлено и 41 удалено
  1. 12 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 14 8
      dpkg-deb/extract.c
  4. 3 2
      lib/dbmodify.c
  5. 3 3
      lib/parsehelp.c
  6. 2 1
      lib/showcright.c
  7. 5 2
      src/main.c
  8. 25 21
      src/packages.c
  9. 10 4
      src/query.c

+ 12 - 0
ChangeLog

@@ -1,3 +1,15 @@
+2006-04-21  Guillem Jover  <guillem@debian.org>
+
+	* 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  <guillem@debian.org>
 
 	* src/main.c (printforhelp, setdebug, setforce): Quote each string

+ 3 - 0
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) <cobaco@linux.be>  Thu, 13 Apr 2006 12:51:15 +0200
 
 dpkg (1.13.18) unstable; urgency=low

+ 14 - 8
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"));

+ 3 - 2
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--;
 }

+ 3 - 3
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;
 }
 

+ 2 - 1
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);
 }

+ 5 - 2
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)

+ 25 - 21
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)++;

+ 10 - 4
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;
           }