(message): Use "%s" to fix incorrect translation with printf pattern(s)

Signed-off-by: Andrew V. Samoilov <a.samoilov@gmail.com>
This commit is contained in:
Andrew V. Samoilov 2017-05-25 21:32:46 +03:00 committed by Andrew Borodin
parent 23dec99195
commit 1b47c88ff1
7 changed files with 24 additions and 23 deletions

View File

@ -214,20 +214,19 @@ background_attention (int fd, void *closure)
TaskList *p;
int to_child_fd = -1;
enum ReturnType type;
const char *background_process_error = _("Background process error");
ctx = closure;
bytes = read (fd, &routine.pointer, sizeof (routine));
if (bytes == -1 || (size_t) bytes < (sizeof (routine)))
{
const char *background_process_error = _("Background process error");
unregister_task_running (ctx->pid, fd);
if (!waitpid (ctx->pid, &status, WNOHANG))
{
/* the process is still running, but it misbehaves - kill it */
kill (ctx->pid, SIGTERM);
message (D_ERROR, background_process_error, _("Unknown error in child"));
message (D_ERROR, background_process_error, "%s", _("Unknown error in child"));
return 0;
}
@ -235,7 +234,7 @@ background_attention (int fd, void *closure)
if (WIFEXITED (status) && (WEXITSTATUS (status) == 0))
return 0;
message (D_ERROR, background_process_error, _("Child died unexpectedly"));
message (D_ERROR, background_process_error, "%s", _("Child died unexpectedly"));
return 0;
}
@ -249,7 +248,7 @@ background_attention (int fd, void *closure)
if (argc > MAXCALLARGS)
{
message (D_ERROR, _("Background protocol error"),
message (D_ERROR, _("Background protocol error"), "%s",
_("Background process sent us a request for more arguments\n"
"than we can handle."));
}
@ -290,7 +289,7 @@ background_attention (int fd, void *closure)
to_child_fd = p->to_child_fd;
if (to_child_fd == -1)
message (D_ERROR, _("Background process error"), _("Unknown error in child"));
message (D_ERROR, background_process_error, "%s", _("Unknown error in child"));
/* Handle the call */
if (type == Return_Integer)

View File

@ -132,7 +132,7 @@ static void
do_possible_cd (const vfs_path_t * new_dir_vpath)
{
if (!do_cd (new_dir_vpath, cd_exact))
message (D_ERROR, _("Warning"),
message (D_ERROR, _("Warning"), "%s",
_("The Commander can't change to the directory that\n"
"the subshell claims you are in. Perhaps you have\n"
"deleted your working directory, or given yourself\n"
@ -334,7 +334,7 @@ do_executev (const char *shell, int flags, char *const argv[])
#endif /* ENABLE_SUBSHELL */
)
{
printf (_("Press any key to continue..."));
printf ("%s", _("Press any key to continue..."));
fflush (stdout);
tty_raw_mode ();
get_key_code (0);
@ -430,10 +430,12 @@ shell_execute (const char *command, int flags)
#ifdef ENABLE_SUBSHELL
if (mc_global.tty.use_subshell)
{
if (subshell_state == INACTIVE)
do_execute (mc_global.shell->path, cmd ? cmd : command, flags | EXECUTE_AS_SHELL);
else
message (D_ERROR, MSG_ERROR, _("The shell is already running a command"));
message (D_ERROR, MSG_ERROR, "%s", _("The shell is already running a command"));
}
else
#endif /* ENABLE_SUBSHELL */
do_execute (mc_global.shell->path, cmd ? cmd : command, flags | EXECUTE_AS_SHELL);
@ -486,8 +488,8 @@ toggle_panels (void)
{
if (output_starts_shell)
{
fprintf (stderr, _("Type 'exit' to return to the Midnight Commander"));
fprintf (stderr, "\n\r\n\r");
fputs (_("Type 'exit' to return to the Midnight Commander"), stderr);
fputs ("\n\r\n\r", stderr);
my_system (EXECUTE_INTERNAL, mc_global.shell->path, NULL);
}
@ -646,7 +648,6 @@ execute_external_editor_or_viewer (const char *command, const vfs_path_t * filen
do_executev (command, EXECUTE_INTERNAL, NULL);
g_free (extern_cmd_options);
}
execute_cleanup_with_vfs_arg (filename_vpath, &localcopy_vpath, &mtime);

View File

@ -359,7 +359,7 @@ start_link_area (int x, int y, const char *link_name)
Link_Area *la;
if (inside_link_area)
message (D_NORMAL, _("Warning"), _("Internal bug: Double start of link area"));
message (D_NORMAL, _("Warning"), "%s", _("Internal bug: Double start of link area"));
/* Allocate memory for a new link area */
la = g_new (Link_Area, 1);

View File

@ -194,7 +194,7 @@ learn_check_key (int c)
}
else
{
message (D_ERROR, learn_title,
message (D_ERROR, learn_title, "%s",
_
("Great! You have a complete terminal database!\n"
"All your keys work well."));

View File

@ -1316,7 +1316,7 @@ smbfs_open_link (char *host, char *path, const char *user, int *port, char *this
if (my_errno != EPERM)
return 0;
message (D_ERROR, MSG_ERROR, _("Authentication failed"));
message (D_ERROR, MSG_ERROR, "%s", _("Authentication failed"));
/* authentication failed, try again */
smbfs_auth_remove (bucket->host, bucket->service);

View File

@ -240,13 +240,13 @@ undelfs_loaddel (void)
delarray = g_try_malloc (sizeof (struct deleted_info) * max_delarray);
if (!delarray)
{
message (D_ERROR, undelfserr, _("not enough memory"));
message (D_ERROR, undelfserr, "%s", _("not enough memory"));
return 0;
}
block_buf = g_try_malloc (fs->blocksize * 3);
if (!block_buf)
{
message (D_ERROR, undelfserr, _("while allocating block buffer"));
message (D_ERROR, undelfserr, "%s", _("while allocating block buffer"));
goto free_delarray;
}
retval = ext2fs_open_inode_scan (fs, 0, &scan);
@ -292,7 +292,8 @@ undelfs_loaddel (void)
(max_delarray + 50));
if (!delarray_new)
{
message (D_ERROR, undelfserr, _("no more memory while reallocating array"));
message (D_ERROR, undelfserr, "%s",
_("no more memory while reallocating array"));
goto error_out;
}
delarray = delarray_new;
@ -402,7 +403,7 @@ undelfs_readdir (void *vfs_info)
if (vfs_info != fs)
{
message (D_ERROR, undelfserr, _("vfs_info is not fs!"));
message (D_ERROR, undelfserr, "%s", _("vfs_info is not fs!"));
return NULL;
}
if (readdir_ptr == num_delarray)
@ -448,7 +449,7 @@ undelfs_open (const vfs_path_t * vpath, int flags, mode_t mode)
if (!ext2_fname || strcmp (ext2_fname, file))
{
message (D_ERROR, undelfserr, _("You have to chdir to extract files first"));
message (D_ERROR, undelfserr, "%s", _("You have to chdir to extract files first"));
g_free (file);
g_free (f);
return 0;
@ -594,7 +595,7 @@ undelfs_read (void *vfs_info, char *buffer, size_t count)
retval = ext2fs_block_iterate (fs, p->inode, 0, NULL, undelfs_dump_read, p);
if (retval)
{
message (D_ERROR, undelfserr, _("while iterating over blocks"));
message (D_ERROR, undelfserr, "%s", _("while iterating over blocks"));
return -1;
}
if (p->error_code && !p->finished)
@ -670,9 +671,9 @@ undelfs_lstat (const vfs_path_t * vpath, struct stat *buf)
if (!ext2_fname || strcmp (ext2_fname, file))
{
message (D_ERROR, undelfserr, _("You have to chdir to extract files first"));
g_free (file);
g_free (f);
message (D_ERROR, undelfserr, "%s", _("You have to chdir to extract files first"));
return 0;
}
inode_index = undelfs_getindex (f);

View File

@ -416,7 +416,7 @@ mcview_execute_cmd (WView * view, long command)
mcview_moveto_offset (view, addr);
else
{
message (D_ERROR, _("Warning"), _("Invalid value"));
message (D_ERROR, _("Warning"), "%s", _("Invalid value"));
view->dirty++;
}
}