[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: comments/string changes and issues with dpkg's messages



On Wed, Aug 31, 2005 at 07:30:48PM +0100, Ian Jackson wrote:
[...]
> Err, are you complaining that the string
>   dpkg: failed to write status record about `%.250s' to `%.250s'
> is too hard to translate ?
> 
> You seem to be suggesting removing the detail from dpkg's error
> handling - ie, reporting less information to make the translation
> easier.
> 
> I don't think that's a good idea.

It seems that dpkg developers try hard to write unique msgids so that
they can identify errors more easily.  For instance:

   dpkg-deb/build.c: ohshite(_("conffile `%.250s' is not stattable"),conffilename);
   dpkg-deb/build.c: ohshite(_("maintainer script `%.50s' is not stattable"),*mscriptp);
   dpkg-deb/build.c: ohshite("_(failed to fstat tmpfile (data))");
   dpkg-deb/build.c: ohshite("unable to stat control directory");
   dpkg-deb/build.c: ohshite(_("failed to fstat tmpfile (control)"));
   dpkg-deb/extract.c: ohshite(_("failed to fstat archive"));
   dpkg-deb/info.c: ohshite(_("cannot stat `%.255s' (in `%.255s')"),cdep->d_name,directory);
   dpkg-split/info.c: ohshite(_("unable to fstat part file `%.250s'"),fn);
   dpkg-split/queue.c: ohshite(_("unable to stat `%.250s'"),qq->info.filename);
   dpkg-split/split.c: ohshite(_("unable to fstat source file"));
   lib/compat.c: ohshite(_("unable to stat in vsnprintf"));
   lib/parse.c: ohshite(_("can't stat package info file `%.255s'"),filename);
   src/archives.c: ohshite(_("unable to stat restored `%.255s' before installing"
   src/archives.c: ohshite(_("unable to stat `%.255s' (which I was about to install)"),ti->Name);
   src/configure.c: ohshite(_("unable to stat current installed conffile `%.250s'"),cdr.buf);
   src/configure.c: ohshite(_("unable to stat new dist conffile `%.250s'"),cdr2.buf);
   src/configure.c: ohshite(_("unable to stat current installed conffile `%.250s'"), source);
   src/filesdb.c: ohshite(_("failed to fstat previous statoverride file"));
   src/filesdb.c: ohshite(_("failed to fstat diversions file"));
   src/filesdb.c: ohshite(_("failed to fstat previous diversions file"));
   src/filesdb.c: ohshite(_("failed to fstat statoverride file"));
   src/filesdb.c: ohshite("unable to stat files list file for package `%.250s'",pkg->name);
   src/filesdb.c: ohshite(_("failed to open statoverride file"));
   src/help.c: ohshite(_("unable to stat %s `%.250s'"),buf,cidir);
   src/help.c: ohshite(_("unable to stat installed %s script `%.250s'"),description,scriptpath);
   src/help.c: ohshite(_("unable to stat new %s script `%.250s'"),description,cidir);

Waow, no duplicates, that's impressive!

There is a similar list for open, read, write, etc.  This is a real pain for
translators, it would be very helpful to refactor most of these messages,
eg. several of them can be replaced by
  _("unable to stat `%s'"), filename
It does not matter whether files are conffiles or maintainer scripts,
this can be induced from file name.  One can also write
  _("%s:%d: unable to stat `%s'"), __FILE__, __LINE__, filename
or
  _("(%s): unable to stat `%s'"), "vsnprintf", filename
if context is helpful, or
  _("(%s): system call `%s' on `%s' failed"), "vsnprintf", "fstat", filename
for even more refactoring.
If error messages cannot use this pattern, then create another pattern
and try to refactor other messages.  There are currently 273 msgids
coming from ohshite() calls, it is quite obvious than this number can
be dramatically reduced without loss.

Denis



Reply to: