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);
}
}