Harden translated output formatting

This commit is contained in:
Mario Fetka
2026-07-14 17:56:23 +02:00
parent da5195c6bf
commit 1ec17f758e
3 changed files with 26 additions and 26 deletions
+9 -9
View File
@@ -275,8 +275,8 @@ void DisplayCursesInfo(download_t * download)
// erase();
refresh();
attrset(COLOR_PAIR(HIGHLIGHT_PAIR) | A_BOLD);
snprintf(buf, sizeof(buf), _("Connection Server Status Received"));
mvprintw(line++, 1, buf);
snprintf(buf, sizeof(buf), "%s", _("Connection Server Status Received"));
mvprintw(line++, 1, "%s", buf);
attrset(COLOR_PAIR(NULL_PAIR));
@@ -304,7 +304,7 @@ void DisplayCursesInfo(download_t * download)
(float)proz_connection_get_total_bytes_got(download->
pconnections[i]) / 1024,
((float)download->pconnections[i]->main_file_size / 1024) / download->num_connections);
mvprintw(line++, 1, buf);
mvprintw(line++, 1, "%s", buf);
}
line = line + 2;
@@ -317,17 +317,17 @@ void DisplayCursesInfo(download_t * download)
mvprintw(line++, 1, _("File Size = %jdK"),
(intmax_t) (download->main_file_size / 1024));
else
mvprintw(line++, 1, _("File Size = UNKNOWN"));
mvprintw(line++, 1, "%s", _("File Size = UNKNOWN"));
snprintf(buf, sizeof(buf), _("Total Bytes received %jd Kb (%.2f%%)"),
(intmax_t) total_bytes_got,
(((float)total_bytes_got * 100) / ((float)download->main_file_size / 1024)));
line++;
mvprintw(line++, 1, buf);
mvprintw(line++, 1, "%s", buf);
snprintf(buf, sizeof(buf), _("Current speed = %1.2fKb/s, Average D/L speed = %1.2fKb/s"),
current_dl_speed, proz_download_get_average_speed(download) / 1024);
mvprintw(line++, 1, buf);
mvprintw(line++, 1, "%s", buf);
clrtoeol();
if ((secs_left = proz_download_get_est_time_left(download)) != -1)
@@ -341,15 +341,15 @@ void DisplayCursesInfo(download_t * download)
snprintf(buf, sizeof(buf), _("Time Remaining %d Hours %d minutes"), secs_left / 3600,
(secs_left % 3600) / 60);
mvprintw(line++, 1, buf);
mvprintw(line++, 1, "%s", buf);
clrtoeol();
line++;
attrset(COLOR_PAIR(HIGHLIGHT_PAIR) | A_BOLD);
if (download->resume_support)
mvprintw(line++, 1, _("Resume Supported"));
mvprintw(line++, 1, "%s", _("Resume Supported"));
else
mvprintw(line++, 1, _("Resume NOT Supported"));
mvprintw(line++, 1, "%s", _("Resume NOT Supported"));
}
attrset(COLOR_PAIR(NULL_PAIR));
refresh();
+16 -16
View File
@@ -257,13 +257,13 @@ main(int argc, char **argv)
/*
* The call failed due to a invalid arg
*/
printf(_("Error: Invalid arguments for the -k option\n" "Please type proz --help for help\n"));
printf("%s", _("Error: Invalid arguments for the -k option\n" "Please type proz --help for help\n"));
exit(0);
}
if (rt.num_connections == 0)
{
printf(_("Hey! How can I download anything with 0 (Zero)" " connections!?\n" "Please type proz --help for help\n"));
printf("%s", _("Hey! How can I download anything with 0 (Zero)" " connections!?\n" "Please type proz --help for help\n"));
exit(0);
}
@@ -275,7 +275,7 @@ main(int argc, char **argv)
/*
* The call failed due to a invalid arg
*/
printf(_("Error: Invalid arguments for the -t or --tries option(s)\n" "Please type proz --help for help\n"));
printf("%s", _("Error: Invalid arguments for the -t or --tries option(s)\n" "Please type proz --help for help\n"));
exit(0);
}
break;
@@ -335,7 +335,7 @@ main(int argc, char **argv)
/*
* The call failed due to a invalid arg
*/
printf(_("Error: Invalid arguments for the --retry-delay option\n" "Please type proz --help for help\n"));
printf("%s", _("Error: Invalid arguments for the --retry-delay option\n" "Please type proz --help for help\n"));
exit(0);
}
break;
@@ -347,7 +347,7 @@ main(int argc, char **argv)
/*
* The call failed due to a invalid arg
*/
printf(_("Error: Invalid arguments for the --timeout option\n" "Please type proz --help for help\n"));
printf("%s", _("Error: Invalid arguments for the --timeout option\n" "Please type proz --help for help\n"));
exit(0);
}
break;
@@ -385,13 +385,13 @@ main(int argc, char **argv)
/*
* The call failed due to a invalid arg
*/
printf(_("Error: Invalid arguments for the --pt option\n" "Please type proz --help for help\n"));
printf("%s", _("Error: Invalid arguments for the --pt option\n" "Please type proz --help for help\n"));
exit(0);
}
if (rt.max_ping_wait == 0)
{
printf(_("Hey! Does waiting for a server response for Zero(0)" " seconds make and sense to you!?\n" "Please type proz --help for help\n"));
printf("%s", _("Hey! Does waiting for a server response for Zero(0)" " seconds make and sense to you!?\n" "Please type proz --help for help\n"));
exit(0);
}
@@ -404,13 +404,13 @@ main(int argc, char **argv)
/*
* The call failed due to a invalid arg
*/
printf(_("Error: Invalid arguments for the --pao option\n" "Please type proz --help for help\n"));
printf("%s", _("Error: Invalid arguments for the --pao option\n" "Please type proz --help for help\n"));
exit(0);
}
if (rt.max_simul_pings == 0)
{
printf(_("Hey you! Will pinging Zero(0) servers at once" " achive anything for me!?\n" "Please type proz --help for help\n"));
printf("%s", _("Hey you! Will pinging Zero(0) servers at once" " achive anything for me!?\n" "Please type proz --help for help\n"));
exit(0);
}
@@ -423,13 +423,13 @@ main(int argc, char **argv)
/*
* The call failed due to a invalid arg
*/
printf(_("Error: Invalid arguments for the --pao option\n" "Please type proz --help for help\n"));
printf("%s", _("Error: Invalid arguments for the --pao option\n" "Please type proz --help for help\n"));
exit(0);
}
if (rt.ftps_mirror_req_n == 0)
{
printf(_("Hey! Will requesting Zero(0) servers at once" "from the ftpearch achive anything!?\n" "Please type proz --help for help\n"));
printf("%s", _("Hey! Will requesting Zero(0) servers at once" "from the ftpearch achive anything!?\n" "Please type proz --help for help\n"));
exit(0);
}
@@ -442,7 +442,7 @@ main(int argc, char **argv)
/*
* The call failed due to a invalid arg
*/
printf(_("Error: Invalid arguments for the --max-bps option\n" "Please type proz --help for help\n"));
printf("%s", _("Error: Invalid arguments for the --max-bps option\n" "Please type proz --help for help\n"));
exit(0);
}
break;
@@ -458,7 +458,7 @@ main(int argc, char **argv)
/*
* The call failed due to a invalid arg
*/
printf(_("Error: Invalid arguments for the --min-size option\n" "Please type proz --help for help\n"));
printf("%s", _("Error: Invalid arguments for the --min-size option\n" "Please type proz --help for help\n"));
exit(0);
}
break;
@@ -471,13 +471,13 @@ main(int argc, char **argv)
/*
* The call failed due to a invalid arg
*/
printf(_("Error: Invalid arguments for the --ftpsid option\n" "Please type proz --help for help\n"));
printf("%s", _("Error: Invalid arguments for the --ftpsid option\n" "Please type proz --help for help\n"));
exit(0);
}
if (rt.ftpsearch_server_id < 0 || rt.ftpsearch_server_id > 1)
{
printf(_("The available servers are (0) filesearching.com and (1) ftpsearch.elmundo.es\n" "Please type proz --help for help\n"));
printf("%s", _("The available servers are (0) filesearching.com and (1) ftpsearch.elmundo.es\n" "Please type proz --help for help\n"));
exit(0);
}
@@ -486,7 +486,7 @@ main(int argc, char **argv)
default:
printf(_("Error: Invalid option\n"));
printf("%s", _("Error: Invalid option\n"));
exit(0);
}
}