Prechádzať zdrojové kódy

libdpkg: Improve and mark more messages for translation in writedb()

This should make translators lifes easier.

Closes: #408525
Guillem Jover 16 rokov pred
rodič
commit
b909dc419e
2 zmenil súbory, kde vykonal 14 pridanie a 10 odobranie
  1. 2 0
      debian/changelog
  2. 12 10
      lib/dpkg/dump.c

+ 2 - 0
debian/changelog

@@ -8,6 +8,8 @@ dpkg (1.15.6) UNRELEASED; urgency=low
     in a way consistent with the rest of the tools.
   * Recognize --help in addition to -h in dpkg-checkbuilddeps.
   * Add a --version option to dpkg-checkbuilddeps.
+  * Improve and mark more messages in writedb() to make translators lifes
+    easier. Closes: #408525
 
   [ Updated man page translations ]
   * German (Helge Kreutzmann).

+ 12 - 10
lib/dpkg/dump.c

@@ -363,7 +363,7 @@ void writedb(const char *filename, int available, int mustsync) {
   struct varbuf vb = VARBUF_INIT;
   int old_umask;
 
-  which= available ? "available" : "status";
+  which = available ? _("available") : _("status");
   oldfn= m_malloc(strlen(filename)+sizeof(OLDDBEXT));
   strcpy(oldfn,filename); strcat(oldfn,OLDDBEXT);
   newfn= m_malloc(strlen(filename)+sizeof(NEWDBEXT));
@@ -372,10 +372,11 @@ void writedb(const char *filename, int available, int mustsync) {
   old_umask = umask(022);
   file= fopen(newfn,"w");
   umask(old_umask);
-  if (!file) ohshite(_("failed to open `%s' for writing %s information"),filename,which);
+  if (!file)
+    ohshite(_("failed to open '%s' for writing %s database"), filename, which);
   
   if (setvbuf(file,writebuf,_IOFBF,sizeof(writebuf)))
-    ohshite(_("unable to set buffering on status file"));
+    ohshite(_("unable to set buffering on %s database file"), which);
 
   it= iterpkgstart();
   while ((pigp= iterpkgnext(it)) != NULL) {
@@ -386,7 +387,7 @@ void writedb(const char *filename, int available, int mustsync) {
     varbufrecord(&vb,pigp,pifp);
     varbufaddc(&vb,'\n'); varbufaddc(&vb,0);
     if (fputs(vb.buf,file) < 0)
-      ohshite(_("failed to write %s record about `%.50s' to `%.250s'"),
+      ohshite(_("failed to write %s database record about '%.50s' to '%.250s'"),
               which, pigp->name, filename);
     varbufreset(&vb);      
   }
@@ -394,18 +395,19 @@ void writedb(const char *filename, int available, int mustsync) {
   varbuffree(&vb);
   if (mustsync) {
     if (fflush(file))
-      ohshite(_("failed to flush %s information to `%.250s'"), which, filename);
+      ohshite(_("failed to flush %s database to '%.250s'"), which, filename);
     if (fsync(fileno(file)))
-      ohshite(_("failed to fsync %s information to `%.250s'"), which, filename);
+      ohshite(_("failed to fsync %s database to '%.250s'"), which, filename);
   }
-  if (fclose(file)) ohshite(_("failed to close `%.250s' after writing %s information"),
-                            filename, which);
+  if (fclose(file))
+    ohshite(_("failed to close '%.250s' after writing %s database"),
+            filename, which);
   unlink(oldfn);
   if (link(filename,oldfn) && errno != ENOENT)
-    ohshite(_("failed to link `%.250s' to `%.250s' for backup of %s info"),
+    ohshite(_("failed to link '%.250s' to '%.250s' for backup of %s database"),
             filename, oldfn, which);
   if (rename(newfn,filename))
-    ohshite(_("failed to install `%.250s' as `%.250s' containing %s info"),
+    ohshite(_("failed to install '%.250s' as '%.250s' containing %s database"),
             newfn, filename, which);
   free(newfn);
   free(oldfn);