Release ProZilla 2.2.0 with translated status output

This commit is contained in:
Mario Fetka
2026-07-14 17:13:57 +02:00
parent a922885174
commit da5195c6bf
14 changed files with 1402 additions and 725 deletions
+25 -18
View File
@@ -25,6 +25,7 @@
#include <assert.h>
#include <limits.h>
#include <errno.h>
#include <inttypes.h>
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#else
@@ -150,7 +151,7 @@ DL_Window::dl_start(int num_connections, boolean ftpsearch)
connection = proz_connection_init(&u, &getinfo_mutex);
proz_connection_set_msg_proc(connection, ms, this);
PrintMessage("Creating the thread that gets info about file..\n");
PrintMessage(_("Creating the thread that gets info about file..\n"));
proz_get_url_info_loop(connection, &info_thread);
status = DL_GETTING_INFO;
@@ -322,7 +323,7 @@ DL_Window::start_download()
if (ret == -1)
{
PrintMessage("Write Error: There may not be enough free space or a disk write failed when attempting to create output file\n");
PrintMessage(_("Write Error: There may not be enough free space or a disk write failed when attempting to create output file\n"));
status = DL_ABORTED;
return;
}
@@ -330,11 +331,11 @@ DL_Window::start_download()
/*Display resume status */
if (download->resume_support)
{
PrintMessage("RESUME supported\n\n");
PrintMessage(_("RESUME supported\n\n"));
}
else
{
PrintMessage("RESUME NOT supported\n");
PrintMessage(_("RESUME NOT supported\n"));
}
gettimeofday(&update_time, NULL);
@@ -360,12 +361,12 @@ DL_Window::handle_info_thread()
if (connection->main_file_size != -1)
{
PrintMessage("File Size = %lld Kb\n\n",
connection->main_file_size / 1024);
PrintMessage(_("File Size = %jd Kb\n\n"),
(intmax_t) (connection->main_file_size / 1024));
}
else
{
PrintMessage("File Size is UNKOWN\n\n");
PrintMessage(_("File Size is UNKNOWN\n\n"));
}
//Added ftpsearch only is size > min size
@@ -398,7 +399,7 @@ DL_Window::handle_info_thread()
{
if ((connection->main_file_size / 1024 >= rt.min_search_size) && (do_ftpsearch == TRUE))
{
PrintMessage("File size is less than the minimum, skipping ftpsearch");
PrintMessage(_("File size is less than the minimum, skipping ftpsearch"));
}
do_download();
@@ -409,7 +410,7 @@ DL_Window::handle_info_thread()
if ((connection->err == FTPNSFOD) ||
(connection->err == HTTPNSFOD))
{
PrintMessage("The URL %s doesnt exist!\n",
PrintMessage(_("The URL %s doesnt exist!\n"),
connection->u.url);
got_dl = FALSE;
got_info = FALSE;
@@ -417,7 +418,7 @@ DL_Window::handle_info_thread()
}
else
{
PrintMessage("An error occurred: %s \n",
PrintMessage(_("An error occurred: %s \n"),
proz_strerror(connection->err));
got_dl = FALSE;
got_info = FALSE;
@@ -439,7 +440,7 @@ DL_Window::handle_ftpsearch()
if (ftpsearch_win->request->num_mirrors == 0)
{
using_ftpsearch = FALSE;
PrintMessage("No suitable mirrors were found, downloading from original server\n");
PrintMessage(_("No suitable mirrors were found, downloading from original server\n"));
do_download();
return;
}
@@ -499,10 +500,10 @@ DL_Window::handle_download_thread()
if (err == DLDONE)
{
PrintMessage("Got DL succesfully, now renaming file\n");
PrintMessage(_("Got DL succesfully, now renaming file\n"));
got_dl = TRUE;
PrintMessage("Renaming file %s .....\n",
PrintMessage(_("Renaming file %s .....\n"),
download->u.file);
status = DL_JOINING;
proz_download_join_downloads(download);
@@ -520,7 +521,7 @@ DL_Window::handle_download_thread()
if (err == DLLOCALFATAL)
{
PrintMessage("One connection of the download %s encountered a unrecoverable local error, usually lack of free space, or a write to bad medium, or a problem with permissions,so please fix this and retry\n",
PrintMessage(_("One connection of the download %s encountered a unrecoverable local error, usually lack of free space, or a write to bad medium, or a problem with permissions,so please fix this and retry\n"),
connection->u.url);
got_dl = FALSE;
status = DL_FATALERR;
@@ -566,7 +567,7 @@ DL_Window::handle_joining_thread()
/*has the user pressed OK at the end of the download */
if (bDone == true)
{
PrintMessage("All Done.\n");
PrintMessage(_("All Done.\n"));
//curses_query_user_input("Press any key to exit.");
proz_download_delete_dl_file(download);
proz_download_free_download(download, 0);
@@ -656,9 +657,15 @@ DL_Window::print_status(download_t *download, int quiet_mode)
//WGET looks like this:
//xx% [=======> ] nnn,nnn,nnn XXXX.XXK/s ETA hh:mm:ss
fprintf(stdout, " %.2lf%% %zdKb/%zdkb %0.3fKb/s ETA %s \r",
((float)totalDownloaded) / ((float)totalFile / 100),
totalDownloaded, totalFile, (float)aveSpeed, timeLeft);
if (totalFile > 0)
fprintf(stdout,
" %.2f%% %jdKb/%jdkb %0.3fKb/s ETA %s \r",
((double) totalDownloaded * 100.0) / (double) totalFile,
(intmax_t) totalDownloaded, (intmax_t) totalFile,
(double) aveSpeed, timeLeft);
else
fprintf(stdout, " %jdKb %0.3fKb/s ETA %s \r",
(intmax_t) totalDownloaded, (double) aveSpeed, timeLeft);
fflush(stdout);
}
}
+2 -2
View File
@@ -50,7 +50,7 @@ FTPS_Window::fetch_mirror_info(urlinfo * u, off_t file_size,
request = proz_ftps_request_init(u, file_size, ftps_loc,
server_type, num_req_mirrors);
PrintMessage("Attempting to get %d mirrors from %s\n\n", num_req_mirrors, ftps_loc);
PrintMessage(_("Attempting to get %d mirrors from %s\n\n"), num_req_mirrors, ftps_loc);
//proz_connection_set_msg_proc (request->connection,
// ftps_win_message_proc, this);
proz_get_complete_mirror_list(request);
@@ -92,7 +92,7 @@ FTPS_Window::callback()
request->ping_timeout.tv_usec = 0;
//Launch the pinging thread
PrintMessage("Got mirror info, %d server(s) found\n", request->num_mirrors);
PrintMessage(_("Got mirror info, %d server(s) found\n"), request->num_mirrors);
proz_mass_ping(request);
ping_running = TRUE;
return MASSPINGINPROGRESS;
+5 -3
View File
@@ -38,6 +38,7 @@
#include <ctype.h>
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include "interface.h"
#include "misc.h"
#include "main.h"
@@ -313,12 +314,13 @@ void DisplayCursesInfo(download_t * download)
attrset(COLOR_PAIR(HIGHLIGHT_PAIR));
if (download->main_file_size > 0)
mvprintw(line++, 1, _("File Size = %lldK"), download->main_file_size / 1024);
mvprintw(line++, 1, _("File Size = %jdK"),
(intmax_t) (download->main_file_size / 1024));
else
mvprintw(line++, 1, _("File Size = UNKNOWN"));
snprintf(buf, sizeof(buf), _("Total Bytes received %lld Kb (%.2f%%)"),
total_bytes_got,
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);
+1 -1
View File
@@ -537,7 +537,7 @@ main(int argc, char **argv)
if (opt_file)
url_data->file = opt_file;
PrintMessage("Starting.....");
PrintMessage(_("Starting....."));
//In to %s\n",url_data->host);
// start the download
ret = open_new_dl_win(url_data, rt.ftp_search);