summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-23 08:03:37 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2009-02-23 08:03:37 (GMT)
commit337a06f32fb530e0e0884fef2f5f630cca9911a1 (patch) (side-by-side diff)
treed0687ccd3e9ff527d9c5613fd052cbe0f79bb40a /src
parent7543ff5973d1afe75b0f4226a3a02cc8d375ad3e (diff)
downloadwydawca-337a06f32fb530e0e0884fef2f5f630cca9911a1.tar.gz
wydawca-337a06f32fb530e0e0884fef2f5f630cca9911a1.tar.bz2
Add missing i18n markers
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/builtin.c4
-rw-r--r--src/directive.c33
-rw-r--r--src/diskio.c90
-rw-r--r--src/exec.c26
-rw-r--r--src/gpg.c52
-rw-r--r--src/mail.c18
-rw-r--r--src/method.c13
-rw-r--r--src/null.c10
-rw-r--r--src/process.c20
-rw-r--r--src/sql.c18
-rw-r--r--src/triplet.c14
-rw-r--r--src/verify.c22
-rw-r--r--src/wydawca.c11
13 files changed, 168 insertions, 163 deletions
diff --git a/src/builtin.c b/src/builtin.c
index e5641d1..90b7c2f 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -79,7 +79,7 @@ cmp_regex (const char *pat, const char *str, int flags)
char errbuf[512];
regerror (rc, &regex, errbuf, sizeof (errbuf));
- logmsg (LOG_ERR, "%s: cannot compile regexp: %s", pat, errbuf);
+ logmsg (LOG_ERR, _("%s: cannot compile regexp: %s"), pat, errbuf);
return 0;
}
@@ -120,7 +120,7 @@ parse_cmp_type (const char *pat, strcmp_fn *cmpfn, int *rf)
break;
default:
- logmsg (LOG_NOTICE, "unrecognized comparison flag: %c", *pat);
+ logmsg (LOG_NOTICE, _("unrecognized comparison flag: %c"), *pat);
}
}
}
diff --git a/src/directive.c b/src/directive.c
index ff020ed..46e3196 100644
--- a/src/directive.c
+++ b/src/directive.c
@@ -26,7 +26,7 @@ directive_parse (struct file_triplet *trp)
char *p;
if (debug_level > 2)
- logmsg (LOG_DEBUG, "%s: parsing directive blurb: %s",
+ logmsg (LOG_DEBUG, _("%s: parsing directive blurb: %s"),
trp->file[file_directive].name, trp->blurb);
dcount = 0;
@@ -46,7 +46,7 @@ directive_parse (struct file_triplet *trp)
continue;
if (strchr (trp->directive[j], ':') == NULL)
{
- logmsg (LOG_ERR, "%s: invalid line: %s",
+ logmsg (LOG_ERR, _("%s: invalid line: %s"),
trp->file[file_directive].name, trp->directive[j]);
free (trp->directive);
trp->directive = NULL;
@@ -173,14 +173,14 @@ directive_version_in_range_p (struct file_triplet *trp,
if (directive_get_value (trp, "version", &val))
{
- logmsg (LOG_ERR, "%s: missing `version' directive",
+ logmsg (LOG_ERR, _("%s: missing `version' directive"),
trp->file[file_directive].name);
return 0;
}
if (directive_pack_version (val, &version))
{
- logmsg (LOG_ERR, "%s: unparsable version: %s",
+ logmsg (LOG_ERR, _("%s: unparsable version: %s"),
trp->file[file_directive].name, val);
return 0;
}
@@ -188,7 +188,7 @@ directive_version_in_range_p (struct file_triplet *trp,
if (from <= version && version <= to)
return 1;
- logmsg (LOG_ERR, "%s: version %s is not in the allowed range",
+ logmsg (LOG_ERR, _("%s: version %s is not in the allowed range"),
trp->file[file_directive].name, val);
return 0;
}
@@ -256,7 +256,7 @@ verify_directive_format (struct file_triplet *trp)
case 1:
if (strcmp (key, "version"))
{
- logmsg (LOG_ERR, "%s:%d: expected `%s' but found `%s'",
+ logmsg (LOG_ERR, _("%s:%d: expected `%s' but found `%s'"),
trp->file[file_directive].name, n, "version", key);
return 1;
}
@@ -265,7 +265,7 @@ verify_directive_format (struct file_triplet *trp)
case 2:
if (strcmp (key, "directory"))
{
- logmsg (LOG_ERR, "%s:%d: expected `%s' but found `%s'",
+ logmsg (LOG_ERR, _("%s:%d: expected `%s' but found `%s'"),
trp->file[file_directive].name, n, "directory", key);
return 1;
}
@@ -274,7 +274,7 @@ verify_directive_format (struct file_triplet *trp)
default:
if (find_directive (key) == unknown_dir)
{
- logmsg (LOG_ERR, "%s:%d: unknown directive `%s'",
+ logmsg (LOG_ERR, _("%s:%d: unknown directive `%s'"),
trp->file[file_directive].name, n, key);
return 1;
}
@@ -286,13 +286,13 @@ verify_directive_format (struct file_triplet *trp)
const char *filename;
if (directive_get_value (trp, "filename", &filename))
{
- logmsg (LOG_ERR, "%s: missing `filename' directive",
+ logmsg (LOG_ERR, _("%s: missing `filename' directive"),
trp->file[file_directive].name);
return 1;
}
if (strcmp (filename, trp->file[file_dist].name))
{
- logmsg (LOG_ERR, "%s: filename %s does not match actual name",
+ logmsg (LOG_ERR, _("%s: filename %s does not match actual name"),
trp->file[file_dist].name, filename);
return 1;
}
@@ -322,7 +322,7 @@ process_directives (struct file_triplet *trp, struct spool *spool)
abort ();
case comment_dir:
- logmsg (LOG_NOTICE, "%s: COMMENT: %s",
+ logmsg (LOG_NOTICE, _("%s: COMMENT: %s"),
trp->file[file_directive].name, val);
break;
@@ -330,7 +330,7 @@ process_directives (struct file_triplet *trp, struct spool *spool)
relative_dir = safe_file_name_alloc (val);
if (!relative_dir || relative_dir[0] == '/')
{
- logmsg (LOG_ERR, "%s: invalid directory: %s",
+ logmsg (LOG_ERR, _("%s: invalid directory: %s"),
trp->file[file_directive].name, val);
return 1;
}
@@ -348,7 +348,8 @@ process_directives (struct file_triplet *trp, struct spool *spool)
}
else
{
- logmsg (LOG_ERR, "invalid detached signature for %s", trp->name);
+ logmsg (LOG_ERR, _("invalid detached signature for %s"),
+ trp->name);
return 1;
}
break;
@@ -370,7 +371,7 @@ process_directives (struct file_triplet *trp, struct spool *spool)
if ((rc = argcv_get (val, NULL, NULL, &argc, &argv)))
{
- logmsg (LOG_ERR, "cannot parse symlink value `%s': %s",
+ logmsg (LOG_ERR, _("cannot parse symlink value `%s': %s"),
val, strerror (rc));
return 1;
}
@@ -379,7 +380,7 @@ process_directives (struct file_triplet *trp, struct spool *spool)
{
rc = 1;
logmsg (LOG_ERR,
- "wrong number of arguments to %s directive: `%s'",
+ _("wrong number of arguments to %s directive: `%s'"),
key, val);
}
else
@@ -399,7 +400,7 @@ process_directives (struct file_triplet *trp, struct spool *spool)
if (!dry_run_mode && unlink (trp->file[file_directive].name))
{
- logmsg (LOG_CRIT, "%s: cannot unlink directive file: %s",
+ logmsg (LOG_CRIT, _("%s: cannot unlink directive file: %s"),
trp->file[file_directive].name, strerror (errno));
}
diff --git a/src/diskio.c b/src/diskio.c
index 2604c67..69a3cbe 100644
--- a/src/diskio.c
+++ b/src/diskio.c
@@ -70,14 +70,14 @@ create_hierarchy (char *dir, size_t baselen, uid_t uid, gid_t gid)
{
if (!S_ISDIR (st.st_mode))
{
- logmsg (LOG_ERR, "component %s is not a directory", dir);
+ logmsg (LOG_ERR, _("component %s is not a directory"), dir);
return 1;
}
return 0;
}
else if (errno != ENOENT)
{
- logmsg (LOG_ERR, "cannot stat file %s: %s", dir, strerror (errno));
+ logmsg (LOG_ERR, _("cannot stat file %s: %s"), dir, strerror (errno));
return 1;
}
@@ -86,7 +86,7 @@ create_hierarchy (char *dir, size_t baselen, uid_t uid, gid_t gid)
{
if (p - dir + 1 < baselen)
{
- logmsg (LOG_ERR, "base directory %s does not exist", dir);
+ logmsg (LOG_ERR, _("base directory %s does not exist"), dir);
return 1;
}
*p = 0;
@@ -99,13 +99,13 @@ create_hierarchy (char *dir, size_t baselen, uid_t uid, gid_t gid)
*p = '/';
if (mkdir (dir, MKDIR_PERMISSIONS))
{
- logmsg (LOG_ERR, "cannot create directory %s: %s",
+ logmsg (LOG_ERR, _("cannot create directory %s: %s"),
dir, strerror (errno));
rc = 1;
}
if (chown (dir, uid, gid))
{
- logmsg (LOG_NOTICE, "cannot change ownership of %s: %s",
+ logmsg (LOG_NOTICE, _("cannot change ownership of %s: %s"),
dir, strerror (errno));
}
}
@@ -152,14 +152,14 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid)
if (in_fd == -1)
{
- logmsg (LOG_ERR, "cannot open source file %s for reading: %s",
+ logmsg (LOG_ERR, _("cannot open source file %s for reading: %s"),
file, strerror (errno));
return 1;
}
if (fstat (in_fd, &st))
{
- logmsg (LOG_ERR, "cannot stat source file %s: %s",
+ logmsg (LOG_ERR, _("cannot stat source file %s: %s"),
file, strerror (errno));
close (in_fd);
return 1;
@@ -168,7 +168,7 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid)
out_fd = creat (dst_file, CREAT_PERMISSIONS);
if (out_fd == -1)
{
- logmsg (LOG_ERR, "cannot create destination file %s: %s",
+ logmsg (LOG_ERR, _("cannot create destination file %s: %s"),
file, strerror (errno));
close (in_fd);
return 1;
@@ -193,7 +193,7 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid)
rdbytes = read (in_fd, buf, rest);
if (rdbytes == -1)
{
- logmsg (LOG_ERR, "unexpected error reading %s: %s",
+ logmsg (LOG_ERR, _("unexpected error reading %s: %s"),
file, strerror (errno));
rc = 1;
break;
@@ -201,14 +201,14 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid)
rest = write (out_fd, buf, rdbytes);
if (rest == -1)
{
- logmsg (LOG_ERR, "unexpected error writing to %s: %s",
+ logmsg (LOG_ERR, _("unexpected error writing to %s: %s"),
dst_file, strerror (errno));
rc = 1;
break;
}
else if (rest != rdbytes)
{
- logmsg (LOG_ERR, "short write on %s", dst_file);
+ logmsg (LOG_ERR, _("short write on %s"), dst_file);
rc = 1;
}
fsize -= rdbytes;
@@ -236,19 +236,19 @@ do_move_file (const char *file, const char *dst_file, uid_t uid, gid_t gid)
{
if (copy_file (file, dst_file, uid, gid))
{
- logmsg (LOG_CRIT, "cannot copy %s to %s: %s",
+ logmsg (LOG_CRIT, _("cannot copy %s to %s: %s"),
file, dst_file, strerror (errno));
rc = 1;
}
else if (unlink (file))
{
- logmsg (LOG_ERR, "cannot unlink %s: %s",
+ logmsg (LOG_ERR, _("cannot unlink %s: %s"),
file, strerror (errno));
}
}
else
{
- logmsg (LOG_CRIT, "cannot move %s to %s: %s",
+ logmsg (LOG_CRIT, _("cannot move %s to %s: %s"),
file, dst_file, strerror (errno));
rc = 1;
}
@@ -264,7 +264,7 @@ tar_append_file (const char *archive, const char *file)
const char *argv[6];
if (debug_level)
- logmsg (LOG_DEBUG, "tarring %s to %s", file, archive);
+ logmsg (LOG_DEBUG, _("tarring %s to %s"), file, archive);
if (dry_run_mode)
{
UPDATE_STATS (STAT_ARCHIVES);
@@ -286,7 +286,7 @@ tar_append_file (const char *archive, const char *file)
case exec_fail:
case exec_error:
- logmsg (LOG_ERR, "cannot archive %s", file);
+ logmsg (LOG_ERR, _("cannot archive %s"), file);
break;
}
@@ -325,11 +325,12 @@ backup_file (const char *dst_file, const char *dst_dir, const char *file,
if (archive->backup_type == no_backups)
{
if (debug_level)
- logmsg (LOG_DEBUG, "removing previous archive file `%s'",
+ logmsg (LOG_DEBUG, _("removing previous archive file `%s'"),
file_name);
if (!dry_run_mode && unlink (file_name))
{
- logmsg (LOG_ERR, "cannot unlink previous archive file `%s': %s",
+ logmsg (LOG_ERR,
+ _("cannot unlink previous archive file `%s': %s"),
file_name, strerror (errno));
free (file_name);
free (adir);
@@ -341,14 +342,15 @@ backup_file (const char *dst_file, const char *dst_dir, const char *file,
char *archive_file_name =
find_backup_file_name (file_name, archive->backup_type);
if (debug_level)
- logmsg (LOG_DEBUG, "backing up previous archive file `%s' to `%s'",
+ logmsg (LOG_DEBUG,
+ _("backing up previous archive file `%s' to `%s'"),
file_name, archive_file_name);
if (!dry_run_mode)
{
rc = do_move_file (file_name, archive_file_name, uid, gid);
if (rc)
{
- logmsg (LOG_ERR, "backing `%s' up as `%s' failed: %s",
+ logmsg (LOG_ERR, _("backing `%s' up as `%s' failed: %s"),
file_name, archive_file_name, strerror (errno));
free (archive_file_name);
free (file_name);
@@ -361,12 +363,12 @@ backup_file (const char *dst_file, const char *dst_dir, const char *file,
}
if (debug_level)
- logmsg (LOG_DEBUG, "archiving `%s' to `%s'", dst_file, file_name);
+ logmsg (LOG_DEBUG, _("archiving `%s' to `%s'"), dst_file, file_name);
if (!dry_run_mode)
{
rc = do_move_file (dst_file, file_name, uid, gid);
if (rc)
- logmsg (LOG_ERR, "archiving `%s' as `%s' failed: %s",
+ logmsg (LOG_ERR, _("archiving `%s' as `%s' failed: %s"),
dst_file, file_name, strerror (errno));
}
free (file_name);
@@ -395,7 +397,7 @@ do_archive_file (const char *dst_file, const char *dst_dir, const char *file,
}
if (!dry_run_mode && unlink (dst_file))
{
- logmsg (LOG_ERR, "Canot unlink file `%s': %s",
+ logmsg (LOG_ERR, _("canot unlink file `%s': %s"),
dst_file, strerror (errno));
return 1;
}
@@ -421,7 +423,7 @@ dir_move_file (struct file_triplet *trp, struct spool *spool,
dst_file = concat_dir (dst_dir, trp->file[file_id].name, NULL);
if (debug_level)
- logmsg (LOG_DEBUG, "installing %s to %s", trp->file[file_id].name,
+ logmsg (LOG_DEBUG, _("installing %s to %s"), trp->file[file_id].name,
dst_dir);
if (access (dst_file, F_OK) == 0)
@@ -460,7 +462,7 @@ archive_single_file (struct file_triplet *trp, struct spool *spool,
dst_file = safe_file_name (concat_dir (dst_dir, file_name, NULL));
if (!sub_dir_p (dst_file, spool->dest_dir))
{
- logmsg (LOG_ERR, "file to be archived `%s' does not lie under `%s'",
+ logmsg (LOG_ERR, _("file to be archived `%s' does not lie under `%s'"),
dst_file, spool->dest_dir);
free (dst_file);
free (dst_dir);
@@ -470,7 +472,7 @@ archive_single_file (struct file_triplet *trp, struct spool *spool,
if (access (dst_file, F_OK) == 0)
{
if (debug_level)
- logmsg (LOG_DEBUG, "Archiving file `%s'", dst_file);
+ logmsg (LOG_DEBUG, _("archiving file `%s'"), dst_file);
rc = do_archive_file (dst_file, dst_dir, file_name, &spool->archive,
TRIPLET_UID (trp), TRIPLET_GID (trp), reldir);
if (rc == 0)
@@ -479,12 +481,12 @@ archive_single_file (struct file_triplet *trp, struct spool *spool,
else if (errno == ENOENT)
{
if (!noentok)
- logmsg (LOG_NOTICE, "Nothing to archive: file `%s' does not exist",
+ logmsg (LOG_NOTICE, _("nothing to archive: file `%s' does not exist"),
dst_file);
}
else
{
- logmsg (LOG_ERR, "Canot access file `%s': %s",
+ logmsg (LOG_ERR, _("canot access file `%s': %s"),
dst_file, strerror (errno));
rc = 1;
}
@@ -550,7 +552,7 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool,
if (save_cwd (&cwd))
{
- logmsg (LOG_ERR, "cannot save current directory: %s",
+ logmsg (LOG_ERR, _("cannot save current directory: %s"),
strerror (errno));
return 1;
}
@@ -558,7 +560,7 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool,
src = safe_file_name_alloc (wanted_src);
if (!src || src[0] == '/')
{
- logmsg (LOG_ERR, "symlink source `%s' does not lie under `%s'",
+ logmsg (LOG_ERR, _("symlink source `%s' does not lie under `%s'"),
wanted_src, spool->dest_dir);
free (src);
return 1;
@@ -567,7 +569,7 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool,
dst = safe_file_name_alloc (wanted_dst);
if (!dst || dst[0] == '/')
{
- logmsg (LOG_ERR, "symlink destination `%s' does not lie under `%s'",
+ logmsg (LOG_ERR, _("symlink destination `%s' does not lie under `%s'"),
wanted_dst, spool->dest_dir);
free (src);
free (dst);
@@ -575,7 +577,7 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool,
}
if (debug_level)
- logmsg (LOG_DEBUG, "symlinking %s to %s in directory %s",
+ logmsg (LOG_DEBUG, _("symlinking %s to %s in directory %s"),
src, dst, dst_dir);
if (!dry_run_mode)
@@ -598,7 +600,7 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool,
if (rc == 0)
{
if (chdir (dst_dir))
- logmsg (LOG_ERR, "cannot change to %s: %s",
+ logmsg (LOG_ERR, _("cannot change to %s: %s"),
dst_dir, strerror (errno));
else
{
@@ -609,14 +611,14 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool,
if (!S_ISLNK (st.st_mode))
{
logmsg (LOG_ERR,
- "file %s exists and is not a symbolic link",
+ _("file %s exists and is not a symbolic link"),
dst);
rc = 1;
}
else if (unlink (dst))
{
logmsg (LOG_ERR,
- "Cannot unlink %s: %s",
+ _("cannot unlink %s: %s"),
dst, strerror (errno));
rc = 1;
}
@@ -624,7 +626,7 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool,
else if (errno != ENOENT)
{
logmsg (LOG_ERR,
- "cannot stat file %s: %s",
+ _("cannot stat file %s: %s"),
dst, strerror (errno));
rc = 1;
}
@@ -634,7 +636,7 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool,
rc = symlink (src, dst);
if (rc)
logmsg (LOG_ERR,
- "symlinking %s to %s in directory %s failed: %s",
+ _("symlinking %s to %s in directory %s failed: %s"),
src, dst, dst_dir, strerror (errno));
}
}
@@ -643,7 +645,7 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool,
if (restore_cwd (&cwd))
{
- logmsg (LOG_EMERG, "cannot restore current directory: %s",
+ logmsg (LOG_EMERG, _("cannot restore current directory: %s"),
strerror (errno));
exit (1);
}
@@ -663,26 +665,26 @@ do_rmsymlink_file (const char *dst_file, int noentok)
struct stat st;
if (debug_level)
- logmsg (LOG_DEBUG, "Removing symbolic link %s", dst_file);
+ logmsg (LOG_DEBUG, _("removing symbolic link %s"), dst_file);
if (stat (dst_file, &st))
{
if (errno == ENOENT)
{
if (!noentok)
- logmsg (LOG_NOTICE, "Symlink `%s' does not exist", dst_file);
+ logmsg (LOG_NOTICE, _("symlink `%s' does not exist"), dst_file);
return 0;
}
if (!S_ISLNK (st.st_mode))
{
- logmsg (LOG_ERR, "Refusing to unlink %s: is not a symlink",
+ logmsg (LOG_ERR, _("refusing to unlink %s: is not a symlink"),
dst_file);
return 1;
}
}
if (!dry_run_mode && unlink (dst_file))
{
- logmsg (LOG_ERR, "Cannot unlink %s: %s", dst_file, strerror (errno));
+ logmsg (LOG_ERR, _("cannot unlink %s: %s"), dst_file, strerror (errno));
return 1;
}
UPDATE_STATS (STAT_RMSYMLINKS);
@@ -710,8 +712,8 @@ dir_rmsymlink_file (struct file_triplet *trp, struct spool *spool,
dst_file = safe_file_name (concat_dir (dst_dir, file_name, NULL));
if (!sub_dir_p (dst_file, spool->dest_dir))
{
- logmsg (LOG_ERR, "refusing to remove a symlink `%s' that is not "
- "located under `%s'",
+ logmsg (LOG_ERR, _("refusing to remove a symlink `%s' that is not "
+ "located under `%s'"),
dst_file, spool->dest_dir);
free (dst_file);
free (dst_dir);
diff --git a/src/exec.c b/src/exec.c
index 4f4902d..eb4c8c4 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -48,11 +48,11 @@ start_prog (int argc, const char **argv, pid_t *ppid)
close (i);
execvp (argv[0], (char**) argv);
- logmsg (LOG_CRIT, "cannot run %s: %s", argv[0], strerror (errno));
+ logmsg (LOG_CRIT, _("cannot run %s: %s"), argv[0], strerror (errno));
exit (1);
case -1:
- logmsg (LOG_CRIT, "cannot run `%s': fork failed: %s",
+ logmsg (LOG_CRIT, _("cannot run `%s': fork failed: %s"),
argv[0], strerror (errno));
return NULL;
@@ -61,7 +61,7 @@ start_prog (int argc, const char **argv, pid_t *ppid)
close (p[1]);
fp = fdopen (p[0], "r");
if (!fp)
- logmsg (LOG_ERR, "cannot fdopen: %s", strerror (errno));
+ logmsg (LOG_ERR, _("cannot fdopen: %s"), strerror (errno));
*ppid = pid;
}
return fp;
@@ -75,10 +75,10 @@ log_output (int prio, const char *prog, FILE *fp)
size_t size = 0;
char *buf = NULL;
- logmsg (prio, "%s output follows:", prog);
+ logmsg (prio, _("%s output follows:"), prog);
while (getline (&buf, &size, fp) > 0)
logmsg (prio, "%s", buf);
- logmsg (prio, "end of %s output", prog);
+ logmsg (prio, _("end of %s output"), prog);
free (buf);
}
@@ -95,7 +95,7 @@ wydawca_exec (int argc, const char **argv, int *retcode)
fp = start_prog (5, argv, &pid);
if (!fp)
{
- logmsg (LOG_CRIT, "cannot start %s", argv[0]);
+ logmsg (LOG_CRIT, _("cannot start %s"), argv[0]);
return exec_error;
}
@@ -105,15 +105,15 @@ wydawca_exec (int argc, const char **argv, int *retcode)
switch (npid)
{
case -1:
- logmsg (LOG_CRIT, "cannot execute %s: waitpid failed: %s",
+ logmsg (LOG_CRIT, _("cannot execute %s: waitpid failed: %s"),
argv[0], strerror (errno));
fclose (fp);
return exec_error;
case 0:
logmsg (LOG_CRIT,
- "cannot execute %s: the process did not respond "
- "within 5 seconds: %s",
+ _("cannot execute %s: the process did not respond "
+ "within 5 seconds: %s"),
argv[0], strerror (errno));
kill (pid, SIGKILL);
fclose (fp);
@@ -129,7 +129,7 @@ wydawca_exec (int argc, const char **argv, int *retcode)
if (rc)
{
res = exec_fail;
- logmsg (LOG_ERR, "command %s returned %d", argv[0], rc);
+ logmsg (LOG_ERR, _("command %s returned %d"), argv[0], rc);
log_output (LOG_ERR, argv[0], fp);
}
else
@@ -145,13 +145,13 @@ wydawca_exec (int argc, const char **argv, int *retcode)
{
res = exec_error;
if (WIFSIGNALED (status))
- logmsg (LOG_ERR, "%s terminated on signal %d",
+ logmsg (LOG_ERR, _("%s terminated on signal %d"),
argv[0], WTERMSIG (status));
else if (WIFSTOPPED (status))
- logmsg (LOG_ERR, "%s stopped on signal %d",
+ logmsg (LOG_ERR, _("%s stopped on signal %d"),
argv[0], WTERMSIG (status));
else
- logmsg (LOG_ERR, "%s terminated with unrecognized status",
+ logmsg (LOG_ERR, _("%s terminated with unrecognized status"),
argv[0]);
}
fclose (fp);
diff --git a/src/gpg.c b/src/gpg.c
index 453a908..d6e2301 100644
--- a/src/gpg.c
+++ b/src/gpg.c
@@ -26,7 +26,8 @@
int a = expr; \
if (a) \
{ \
- logmsg (LOG_ERR, "%s: GPGME error: %s", #expr, gpgme_strerror (a)); \
+ logmsg (LOG_ERR, _("%s: GPGME error: %s"), #expr, \
+ gpgme_strerror (a)); \
return 1; \
} \
} \
@@ -47,7 +48,7 @@ recursive_rmdir (const char *name)
if (chdir (name))
{
- logmsg (LOG_ERR, "cannot change to directory %s: %s",
+ logmsg (LOG_ERR, _("cannot change to directory %s: %s"),
name, strerror (errno));
return 1;
}
@@ -55,7 +56,7 @@ recursive_rmdir (const char *name)
dir = opendir (".");
if (!dir)
{
- logmsg (LOG_ERR, "cannot open directory %s: %s",
+ logmsg (LOG_ERR, _("cannot open directory %s: %s"),
name, strerror (errno));
return 1;
}
@@ -70,14 +71,14 @@ recursive_rmdir (const char *name)
if (stat (ent->d_name, &st) && errno != ENOENT)
{
- logmsg (LOG_ERR, "cannot stat file `%s': %s",
+ logmsg (LOG_ERR, _("cannot stat file `%s': %s"),
name, strerror (errno));
rc = 1;
}
else if (S_ISDIR (st.st_mode))
rc = rmdir_r (ent->d_name);
else if ((rc = unlink (ent->d_name)) != 0 && errno != ENOENT)
- logmsg (LOG_ERR, "cannot unlink %s: %s",
+ logmsg (LOG_ERR, _("cannot unlink %s: %s"),
ent->d_name, strerror (errno));
}
closedir (dir);
@@ -94,21 +95,21 @@ rmdir_r (const char *name)
if (save_cwd (&cwd))
{
- logmsg (LOG_ERR, "cannot save current directory: %s",
+ logmsg (LOG_ERR, _("cannot save current directory: %s"),
strerror (errno));
return 1;
}
rc = recursive_rmdir (name);
if (restore_cwd (&cwd))
{
- logmsg (LOG_ERR, "cannot restore current directory: %s",
+ logmsg (LOG_ERR, _("cannot restore current directory: %s"),
strerror (errno));
rc = 1;
}
if (rc == 0 && rmdir (name))
{
- logmsg (LOG_ERR, "cannot remove directory %s: %s",
+ logmsg (LOG_ERR, _("cannot remove directory %s: %s"),
name, strerror (errno));
return 1;
}
@@ -121,9 +122,9 @@ static void
remove_homedir ()
{
if (debug_level > 1)
- logmsg (LOG_DEBUG, "Removing GNUPG home directory: %s", homedir);
+ logmsg (LOG_DEBUG, _("removing GNUPG home directory: %s"), homedir);
if (rmdir_r (homedir))
- logmsg (LOG_CRIT, "Failed to remove GPG directory %s", homedir);
+ logmsg (LOG_CRIT, _("failed to remove GPG directory %s"), homedir);
}
/* Create a temporary GPG home directory */
@@ -136,13 +137,13 @@ wydawca_gpg_homedir ()
homedir = xstrdup ("/tmp/wydawca-XXXXXX");
if (!mkdtemp (homedir))
{
- logmsg (LOG_CRIT, "cannot create GPG home directory (%s): %s",
+ logmsg (LOG_CRIT, _("cannot create GPG home directory (%s): %s"),
homedir, strerror (errno));
return 1;
}
atexit (remove_homedir);
if (debug_level > 1)
- logmsg (LOG_DEBUG, "GNUPG home directory: %s", homedir);
+ logmsg (LOG_DEBUG, _("GNUPG home directory: %s"), homedir);
setenv ("GNUPGHOME", homedir, 1);
return 0;
}
@@ -167,31 +168,31 @@ gpg_sig_ok_p (gpgme_ctx_t ctx, gpgme_signature_t sig)
{
case GPG_ERR_NO_ERROR:
if (debug_level)
- logmsg (LOG_NOTICE, "Good signature from %s", uid);
+ logmsg (LOG_NOTICE, _("Good signature from %s"), uid);
break;
case GPG_ERR_BAD_SIGNATURE:
- logmsg (LOG_ERR, "BAD signature from %s", uid);
+ logmsg (LOG_ERR, _("BAD signature from %s"), uid);
return 0;
case GPG_ERR_NO_PUBKEY:
- logmsg (LOG_ERR, "No public key");
+ logmsg (LOG_ERR, _("No public key"));
return 0;
case GPG_ERR_NO_DATA:
- logmsg (LOG_ERR, "No signature");
+ logmsg (LOG_ERR, _("No signature"));
return 0;
case GPG_ERR_SIG_EXPIRED:
- logmsg (LOG_ERR, "Expired signature from %s", uid);
+ logmsg (LOG_ERR, _("Expired signature from %s"), uid);
return 0;
case GPG_ERR_KEY_EXPIRED:
- logmsg (LOG_ERR, "Key expired (%s)", uid);
+ logmsg (LOG_ERR, _("Key expired (%s)"), uid);
return 0;
default:
- logmsg (LOG_ERR, "Unknown signature error");
+ logmsg (LOG_ERR, _("Unknown signature error"));
return 0;
}
}
@@ -245,7 +246,7 @@ verify_directive_signature (struct file_triplet *trp,
{
rc = 1;
UPDATE_STATS (STAT_BAD_SIGNATURE);
- logmsg (LOG_ERR, "%s: directive verification failed: %s",
+ logmsg (LOG_ERR, _("%s: directive verification failed: %s"),
trp->name, gpgme_strerror (ec));
}
@@ -271,8 +272,8 @@ verify_detached_signature (struct file_triplet *trp,
if (!info)
{
logmsg (LOG_CRIT,
- "cannot find path to gpg binary (attempting to verify "
- "the detached signature for %s", trp->name);
+ _("cannot find path to gpg binary (attempting to verify "
+ "the detached signature for %s"), trp->name);
return 1;
}
@@ -287,17 +288,18 @@ verify_detached_signature (struct file_triplet *trp,
{
case exec_success:
if (debug_level)
- logmsg (LOG_DEBUG, "good detached signature for %s", trp->name);
+ logmsg (LOG_DEBUG, _("good detached signature for %s"), trp->name);
return 0;
case exec_fail:
UPDATE_STATS (STAT_BAD_SIGNATURE);
- logmsg (LOG_ERR, "BAD detached signature for %s", trp->name);
+ logmsg (LOG_ERR, _("BAD detached signature for %s"), trp->name);
notify (spool->notification, trp, ev_bad_detached_signature);
break;
case exec_error:
- logmsg (LOG_CRIT, "cannot verify detached signature for %s", trp->name);
+ logmsg (LOG_CRIT, _("cannot verify detached signature for %s"),
+ trp->name);
break;
}
diff --git a/src/mail.c b/src/mail.c
index d44d692..7987819 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -38,7 +38,7 @@ mail_init ()
{
const char *url = NULL;
mu_mailer_get_url_default (&url);
- logmsg (LOG_ERR, "cannot create default mailer `%s': %s",
+ logmsg (LOG_ERR, _("cannot create default mailer `%s': %s"),
url, mu_strerror (rc));
}
}
@@ -85,7 +85,7 @@ mail_send_message (mu_address_t rcpt, const char *text)
{
mu_url_t url = NULL;
mu_mailer_get_url (mailer, &url);
- logmsg (LOG_CRIT, "opening mailer `%s' failed: %s",
+ logmsg (LOG_CRIT, _("opening mailer `%s' failed: %s"),
url ? mu_url_to_string (url) : "(unknown URL)",
mu_strerror (rc));
return;
@@ -95,7 +95,7 @@ mail_send_message (mu_address_t rcpt, const char *text)
rc = mu_mailer_send_message (mailer, msg, from_address, rcpt);
if (rc)
- logmsg (LOG_CRIT, "cannot send message: %s", mu_strerror (rc));
+ logmsg (LOG_CRIT, _("cannot send message: %s"), mu_strerror (rc));
mu_message_destroy (&msg, mu_message_get_owner (msg));
}
@@ -213,7 +213,7 @@ mail_stats ()
if (!admin_address)
{
- logmsg (LOG_ERR, "Cannot mail statistics: admin-address not defined");
+ logmsg (LOG_ERR, _("cannot mail statistics: admin-address not defined"));
return;
}
@@ -224,7 +224,7 @@ mail_stats ()
mu_address_to_string (admin_address, NULL, 0, &size);
buf = xmalloc (size + 1);
mu_address_to_string (admin_address, buf, size + 1, NULL);
- logmsg (LOG_DEBUG, "Sending stats to %s", buf);
+ logmsg (LOG_DEBUG, _("sending stats to %s"), buf);
free (buf);
}
@@ -242,7 +242,7 @@ mail_stats ()
tmpl = resolve_message_template (admin_stat_message);
if (!tmpl)
{
- logmsg (LOG_ERR, "undefined message reference: %s",
+ logmsg (LOG_ERR, _("undefined message reference: %s"),
admin_stat_message);
return;
}
@@ -347,7 +347,7 @@ do_notify (struct file_triplet *trp, enum notification_event ev,
if (!rcpt)
{
- logmsg (LOG_ERR, "not notifying %s (project %s) about %s: %s",
+ logmsg (LOG_ERR, _("not notifying %s (project %s) about %s: %s"),
notification_target_str (ntf->tgt),
trp->project,
notification_event_str (ev), errp);
@@ -361,7 +361,7 @@ do_notify (struct file_triplet *trp, enum notification_event ev,
mu_address_to_string (rcpt, NULL, 0, &size);
buf = xmalloc (size + 1);
mu_address_to_string (rcpt, buf, size + 1, NULL);
- logmsg (LOG_DEBUG, "notifying %s (project %s) about %s",
+ logmsg (LOG_DEBUG, _("notifying %s (project %s) about %s"),
buf, trp->project, notification_event_str (ev));
free (buf);
}
@@ -370,7 +370,7 @@ do_notify (struct file_triplet *trp, enum notification_event ev,
{
const char *msg = resolve_message_template (ntf->msg);
if (!msg)
- logmsg (LOG_ERR, "undefined message reference: %s", ntf->msg);
+ logmsg (LOG_ERR, _("undefined message reference: %s"), ntf->msg);
else
{
char *text = triplet_expand_param (msg, trp);
diff --git a/src/method.c b/src/method.c
index 8fe81fb..ec8e01c 100644
--- a/src/method.c
+++ b/src/method.c
@@ -66,7 +66,7 @@ method_init (struct access_method *method)
if (debug_level > 1)
{
int i;
- logmsg (LOG_DEBUG, "Initializing method: %s \"%s\"",
+ logmsg (LOG_DEBUG, _("initializing method: %s \"%s\""),
mp->name, SP (method->query));
for (i = 0; i < method->parmc; i++)
logmsg (LOG_DEBUG, " parmv[%d]=%s", i, method->parmv[i]);
@@ -110,7 +110,7 @@ method_done (struct access_method *method)
if (debug_level > 1)
{
int i;
- logmsg (LOG_DEBUG, "Closing method: %s \"%s\"",
+ logmsg (LOG_DEBUG, _("closing method: %s \"%s\""),
mp->name, SP (method->query));
for (i = 0; i < method->parmc; i++)
logmsg (LOG_DEBUG, " parmv[%d]=%s", i, method->parmv[i]);
@@ -131,20 +131,21 @@ method_run (struct access_method *method, void *handle, const char *cmd)
if (debug_level > 1)
{
if (cmd)
- logmsg (LOG_DEBUG, "Running method: %s \"%s\"", mp->name, cmd);
+ logmsg (LOG_DEBUG, _("running method: %s \"%s\""), mp->name, cmd);
else
- logmsg (LOG_DEBUG, "Running method: %s", mp->name);
+ logmsg (LOG_DEBUG, _("running method: %s"), mp->name);
}
if (!method->init_passed)
{
- logmsg (LOG_CRIT, "INTERNAL ERROR: Method %s \"%s\" not initialized",
+ logmsg (LOG_CRIT, _("INTERNAL ERROR: method %s \"%s\" not initialized"),
mp->name, SP (method->query));
return 1;
}
if (!mp->run)
{
- logmsg (LOG_CRIT, "INTERNAL ERROR: No run function for method %s \"%s\"",
+ logmsg (LOG_CRIT,
+ _("INTERNAL ERROR: no run function for method %s \"%s\""),
mp->name, SP (method->query));
return 1;
}
diff --git a/src/null.c b/src/null.c
index 5ec85f3..7ead150 100644
--- a/src/null.c
+++ b/src/null.c
@@ -22,12 +22,12 @@ null_move_file (struct file_triplet *trp, struct spool *spool,
{
const char *file_name = trp->file[file_id].name;
if (debug_level)
- logmsg (LOG_DEBUG, "%s: installing file `%s/%s'",
+ logmsg (LOG_DEBUG, _("%s: installing file `%s/%s'"),
spool->url, reldir, file_name);
UPDATE_STATS (STAT_UPLOADS);
if (unlink (file_name))
{
- logmsg (LOG_ERR, "Cannot unlink %s: %s",
+ logmsg (LOG_ERR, _("cannot unlink %s: %s"),
file_name, strerror (errno));
return 1;
}
@@ -39,7 +39,7 @@ null_archive_file (struct file_triplet *trp, struct spool *spool,
const char *file_name, const char *reldir)
{
if (debug_level)
- logmsg (LOG_DEBUG, "%s: archiving `%s'", spool->url, file_name);
+ logmsg (LOG_DEBUG, _("%s: archiving `%s'"), spool->url, file_name);
UPDATE_STATS (STAT_ARCHIVES);
return 0;
}
@@ -50,7 +50,7 @@ null_symlink_file (struct file_triplet *trp, struct spool *spool,
const char *wanted_src, const char *wanted_dst)
{
if (debug_level)
- logmsg (LOG_DEBUG, "%s: symlinking `%s' to `%s'",
+ logmsg (LOG_DEBUG, _("%s: symlinking `%s' to `%s'"),
spool->url, wanted_src, wanted_dst);
UPDATE_STATS (STAT_SYMLINKS);
return 0;
@@ -61,7 +61,7 @@ null_rmsymlink_file (struct file_triplet *trp, struct spool *spool,
const char *reldir, const char *file_name)
{
if (debug_level)
- logmsg (LOG_DEBUG, "%s: removing symlink `%s/%s'",
+ logmsg (LOG_DEBUG, _("%s: removing symlink `%s/%s'"),
spool->url, reldir, file_name);
UPDATE_STATS (STAT_RMSYMLINKS);
return 0;
diff --git a/src/process.c b/src/process.c
index 57a12e7..0d2bf5e 100644
--- a/src/process.c
+++ b/src/process.c
@@ -114,7 +114,7 @@ scan_spool (struct spool *spool)
if (chdir (spool->source_dir))
{
- logmsg (LOG_ERR, "cannot chdir to %s: %s", spool->source_dir,
+ logmsg (LOG_ERR, _("cannot chdir to %s: %s"), spool->source_dir,
strerror (errno));
return;
}
@@ -122,7 +122,7 @@ scan_spool (struct spool *spool)
dir = opendir (".");
if (!dir)
{
- logmsg (LOG_ERR, "cannot open directory %s: %s", spool->source_dir,
+ logmsg (LOG_ERR, _("cannot open directory %s: %s"), spool->source_dir,
strerror (errno));
return;
}
@@ -139,7 +139,7 @@ scan_spool (struct spool *spool)
if (stat (ent->d_name, &st))
{
- logmsg (LOG_ERR, "cannot stat file %s/%s: %s",
+ logmsg (LOG_ERR, _("cannot stat file %s/%s: %s"),
spool->source_dir, ent->d_name,
strerror (errno));
continue;
@@ -147,7 +147,7 @@ scan_spool (struct spool *spool)
if (!S_ISREG (st.st_mode))
{
- logmsg (LOG_NOTICE, "not a regular file: %s/%s",
+ logmsg (LOG_NOTICE, _("not a regular file: %s/%s"),
spool->source_dir, ent->d_name);
continue;
}
@@ -155,7 +155,7 @@ scan_spool (struct spool *spool)
if (!match_uid_p (st.st_uid))
{
if (debug_level)
- logmsg (LOG_DEBUG, "ignoring file: %s/%s",
+ logmsg (LOG_DEBUG, _("ignoring file: %s/%s"),
spool->source_dir, ent->d_name);
continue;
}
@@ -164,12 +164,8 @@ scan_spool (struct spool *spool)
parse_file_name (ent->d_name, &finfo);
if (debug_level)
- {
- const char *s = file_type_str (finfo.type);
- logmsg (LOG_DEBUG, "file %s is %s %s, root %.*s", ent->d_name,
- strchr ("aeiou", s[0]) ? "an" : "a", s,
- finfo.root_len, finfo.name);
- }
+ logmsg (LOG_DEBUG, _("file %s: %s, root %.*s"), ent->d_name,
+ file_type_str (finfo.type), finfo.root_len, finfo.name);
register_file (&finfo);
}
@@ -184,7 +180,7 @@ scan_spool (struct spool *spool)
{
if (method_init (spool->access_method[i]))
{
- logmsg (LOG_ERR, "failed to initialize access method %d", i);
+ logmsg (LOG_ERR, _("failed to initialize access method %d"), i);
return;
}
}
diff --git a/src/sql.c b/src/sql.c
index be21a2c..ee40152 100644
--- a/src/sql.c
+++ b/src/sql.c
@@ -62,7 +62,7 @@ sql_init_method (struct access_method *method)
if (!conn)
{
- logmsg (LOG_EMERG, "INTERNAL ERROR: cannot find SQL connection %s",
+ logmsg (LOG_EMERG, _("INTERNAL ERROR: cannot find SQL connection %s"),
method->parmv[0]);
abort ();
}
@@ -74,7 +74,7 @@ sql_init_method (struct access_method *method)
conn->password, conn->database, conn->port,
conn->socket, 0))
{
- logmsg (LOG_ERR, "Failed to connect to database %s: Error: %s\n",
+ logmsg (LOG_ERR, _("failed to connect to database %s: error: %s\n"),
method->parmv[0], mysql_error (&conn->mysql));
return 1;
}
@@ -125,22 +125,22 @@ sql_run_method (struct access_method *method, void *handle, const char *query)
if (!query)
{
- logmsg (LOG_ERR, "No query supplied for method %s", "sql");
+ logmsg (LOG_ERR, _("no query supplied for method %s"), "sql");
return 1;
}
if (mysql_query (mysql, query))
{
- logmsg (LOG_ERR, "Query failed: %s", mysql_error (mysql));
- logmsg (LOG_NOTICE, "The failed query was: %s", query);
+ logmsg (LOG_ERR, _("query failed: %s"), mysql_error (mysql));
+ logmsg (LOG_NOTICE, _("the failed query was: %s"), query);
return 1;
}
conn->result = mysql_store_result (mysql);
if (!conn->result)
{
- logmsg (LOG_ERR, "Cannot get result: %s", mysql_error (mysql));
- logmsg (LOG_NOTICE, "The failed query was: %s", query);
+ logmsg (LOG_ERR, _("cannot get result: %s"), mysql_error (mysql));
+ logmsg (LOG_NOTICE, _("the failed query was: %s"), query);
return 1;
}
@@ -148,9 +148,9 @@ sql_run_method (struct access_method *method, void *handle, const char *query)
method->ncol = mysql_num_fields (conn->result);
if (debug_level > 1)
{
- logmsg (LOG_DEBUG, "Query returned %u columns in %u rows",
+ logmsg (LOG_DEBUG, _("query returned %u columns in %u rows"),
method->ncol, method->nrow);
- logmsg (LOG_DEBUG, "The query was: %s", query);
+ logmsg (LOG_DEBUG, _("the query was: %s"), query);
}
return 0;
diff --git a/src/triplet.c b/src/triplet.c
index c577841..6641211 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -106,7 +106,7 @@ triplet_expired_p (struct file_triplet *trp, time_t ttl)
&& (now - trp->file[i].sb.st_mtime) > ttl)
{
if (debug_level)
- logmsg (LOG_DEBUG, "File %s expired", trp->file[i].name);
+ logmsg (LOG_DEBUG, _("file %s expired"), trp->file[i].name);
return true;
}
}
@@ -149,7 +149,7 @@ check_triplet_state (struct file_triplet *trp)
else
{
if (debug_level)
- logmsg (LOG_DEBUG, "%s: invalid triplet: UIDs differ",
+ logmsg (LOG_DEBUG, _("%s: invalid triplet: UIDs differ"),
trp->name);
return triplet_bad;
}
@@ -169,9 +169,9 @@ remove_triplet (struct file_triplet *trp)
{
if (trp->file[i].name)
{
- logmsg (LOG_NOTICE, "Removing %s", trp->file[i].name);
+ logmsg (LOG_NOTICE, _("removing %s"), trp->file[i].name);
if (!dry_run_mode && unlink (trp->file[i].name))
- logmsg (LOG_ERR, "Cannot remove %s: %s",
+ logmsg (LOG_ERR, _("cannot remove %s: %s"),
trp->file[i].name, strerror (errno));
}
}
@@ -198,7 +198,7 @@ triplet_processor (void *data, void *proc_data)
case triplet_directive:
case triplet_complete:
if (debug_level)
- logmsg (LOG_DEBUG, "Processing triplet `%s'", trp->name);
+ logmsg (LOG_DEBUG, _("processing triplet `%s'"), trp->name);
if (wydawca_uid (TRIPLET_UID (trp)) == 0)
{
process_directives (trp, spool);
@@ -208,7 +208,7 @@ triplet_processor (void *data, void *proc_data)
case triplet_incomplete:
if (debug_level)
- logmsg (LOG_DEBUG, "%s: incomplete triplet", trp->name);
+ logmsg (LOG_DEBUG, _("%s: incomplete triplet"), trp->name);
/* ignore unless expired (see below); */
UPDATE_STATS (STAT_INCOMPLETE_TRIPLETS);
break;
@@ -233,7 +233,7 @@ void
enumerate_triplets (struct spool *spool)
{
if (debug_level)
- logmsg (LOG_DEBUG, "Processing files for %s (%s)",
+ logmsg (LOG_DEBUG, _("processing files for %s (%s)"),
spool->url, mu_url_to_string (spool->dest_url));
if (triplet_table)
{
diff --git a/src/verify.c b/src/verify.c
index 5d82d2f..14651d2 100644
--- a/src/verify.c
+++ b/src/verify.c
@@ -49,7 +49,7 @@ fill_project_name (struct file_triplet *trp)
return 1;
if (directive_get_value (trp, "directory", &directory))
{
- logmsg (LOG_ERR, "%s: missing `directory' directive",
+ logmsg (LOG_ERR, _("%s: missing `directory' directive"),
trp->file[file_directive].name);
return 1;
}
@@ -59,7 +59,7 @@ fill_project_name (struct file_triplet *trp)
size_t len = p - directory;
if (len == 0)
{
- logmsg (LOG_ERR, "%s: empty `directory' directive",
+ logmsg (LOG_ERR, _("%s: empty `directory' directive"),
trp->file[file_directive].name);
return 1;
}
@@ -106,7 +106,7 @@ check_access_rights (struct file_triplet *trp, struct spool *spool,
return 1;
if (debug_level)
- logmsg (LOG_DEBUG, "verifying access rights for user %s to project %s",
+ logmsg (LOG_DEBUG, _("verifying access rights for user %s to project %s"),
user, trp->project);
md = method_open (method);
@@ -124,7 +124,7 @@ check_access_rights (struct file_triplet *trp, struct spool *spool,
method_close (method, md);
if (rc)
{
- logmsg (LOG_ERR, "Cannot verify access rights for %s on %s",
+ logmsg (LOG_ERR, _("cannot verify access rights for %s on %s"),
user, trp->project);
return 1;
}
@@ -133,7 +133,7 @@ check_access_rights (struct file_triplet *trp, struct spool *spool,
if (!result || strcmp (result, user))
{
UPDATE_STATS (STAT_ACCESS_VIOLATIONS);
- logmsg (LOG_ERR, "%s: %s has no rights on %s",
+ logmsg (LOG_ERR, _("%s: %s has no rights on %s"),
trp->name, user, trp->project);
notify (spool->notification, trp, ev_bad_ownership);
return 1;
@@ -162,7 +162,7 @@ verify_directive_file (struct file_triplet *trp, struct spool *spool)
pw = getpwuid (TRIPLET_UID (trp));
if (!pw)
{
- logmsg (LOG_ERR, "%s: getpwuid failed: %s",
+ logmsg (LOG_ERR, _("%s: getpwuid failed: %s"),
trp->name, strerror (errno));
method_close (method, md);
return 1;
@@ -179,7 +179,7 @@ verify_directive_file (struct file_triplet *trp, struct spool *spool)
free (command);
if (rc)
{
- logmsg (LOG_ERR, "Cannot get PGP key for %s", trp->user);
+ logmsg (LOG_ERR, _("cannot get PGP key for %s"), trp->user);
method_close (method, md);
return 1;
}
@@ -187,23 +187,23 @@ verify_directive_file (struct file_triplet *trp, struct spool *spool)
pubkey = method_result (method, md, 0, 0);
if (!pubkey || pubkey[0] == 0)
{
- logmsg (LOG_ERR, "No GPG key for %s", trp->user);
+ logmsg (LOG_ERR, _("no GPG key for %s"), trp->user);
method_close (method, md);
return 1;
}
if (debug_level > 3)
- logmsg (LOG_DEBUG, "Public key: %s", pubkey);
+ logmsg (LOG_DEBUG, _("public key: %s"), pubkey);
if (verify_directive_signature (trp, spool, pubkey))
{
/*FIXME: Update stats */
- logmsg (LOG_ERR, "invalid signature for %s", trp->name);
+ logmsg (LOG_ERR, _("invalid signature for %s"), trp->name);
method_close (method, md);
return 1;
}
else if (debug_level)
- logmsg (LOG_DEBUG, "%s: directive file signature OK", trp->name);
+ logmsg (LOG_DEBUG, _("%s: directive file signature OK"), trp->name);
method_close (method, md);
diff --git a/src/wydawca.c b/src/wydawca.c
index aeb56bf..ce78fc1 100644
--- a/src/wydawca.c
+++ b/src/wydawca.c
@@ -261,7 +261,10 @@ collect_uids (int argc, char **argv)
char *p;
unsigned n = strtoul (argv[i], &p, 10);
if (*p)
- error (1, 0, "no such user: %s", argv[i]);
+ {
+ logmsg (LOG_ERR, _("no such user: %s"), argv[i]);
+ exit (1);
+ }
uidv[i] = n;
}
else
@@ -299,7 +302,7 @@ wydawca_uid (uid_t uid)
# error "No way to reset user privileges?"
#endif
if (rc < 0)
- logmsg (LOG_ERR, "cannot switch to UID %d: %s (r=%d, e=%d)",
+ logmsg (LOG_ERR, _("cannot switch to UID %d: %s (r=%d, e=%d)"),
uid, strerror (errno), getuid (), geteuid ());
return rc;
}
@@ -342,10 +345,10 @@ main (int argc, char **argv)
mail_init ();
- logmsg (LOG_NOTICE, "wydawca (%s) started", PACKAGE_STRING);
+ logmsg (LOG_NOTICE, _("wydawca (%s) started"), PACKAGE_STRING);
scan_directories ();
- logmsg (LOG_NOTICE, "wydawca (%s) finished", PACKAGE_STRING);
+ logmsg (LOG_NOTICE, _("wydawca (%s) finished"), PACKAGE_STRING);
logstats ();
mail_finish ();

Return to:

Send suggestions and report system problems to the System administrator.