summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-03-02 10:43:00 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-03-02 10:43:00 +0000
commit0276b3bb379e3fdfe448762700a70542f58f2709 (patch)
treeb091e5a0da587f62fad0434d15d4466d0610ca66 /src
parent0f6d2fd451a1ef2a8756a5c5ce4117b6685eb908 (diff)
* DownloadEngine.{h, cc}:
* ConsoleDownloadEngine.{h, cc}: Console output message(size, speed) is now generated by ConsoleDownloadEngine not by DownloadEngine. * main.cc: Download complete/abort message is now generated by main. * Makefile.am (SUBDIRS): Add m4. (ACLOCAL_AMFLAGS): New variable. (EXTRA_DIST): New variable. * configure.in (AC_CONFIG_FILES): Add po/Makefile.in, * gettext: added gettext functionality
Diffstat (limited to 'src')
-rw-r--r--src/ConsoleDownloadEngine.cc37
-rw-r--r--src/ConsoleDownloadEngine.h35
-rw-r--r--src/Makefile.am2
-rw-r--r--src/Makefile.in30
-rw-r--r--src/common.h3
-rw-r--r--src/main.cc134
-rw-r--r--src/message.h64
7 files changed, 203 insertions, 102 deletions
diff --git a/src/ConsoleDownloadEngine.cc b/src/ConsoleDownloadEngine.cc
new file mode 100644
index 00000000..44efd279
--- /dev/null
+++ b/src/ConsoleDownloadEngine.cc
@@ -0,0 +1,37 @@
+/* <!-- copyright */
+/*
+ * aria2 - a simple utility for downloading files faster
+ *
+ * Copyright (C) 2006 Tatsuhiro Tsujikawa
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/* copyright --> */
+#include "ConsoleDownloadEngine.h"
+#include "Util.h"
+
+ConsoleDownloadEngine::ConsoleDownloadEngine() {}
+
+ConsoleDownloadEngine::~ConsoleDownloadEngine() {}
+
+void ConsoleDownloadEngine::sendStatistics(long long int currentSize, long long int totalSize) {
+ cout << "\r ";
+ cout << "\rProgress " <<
+ Util::llitos(currentSize, true) << " Bytes/" <<
+ Util::llitos(totalSize, true) << " Bytes " <<
+ (totalSize == 0 ? 0 : (currentSize*100)/totalSize) << "% " <<
+ speed/1000.0 << "KB/s " <<
+ "(" << commands.size() << " connections)" << flush;
+}
diff --git a/src/ConsoleDownloadEngine.h b/src/ConsoleDownloadEngine.h
new file mode 100644
index 00000000..80b2ceb6
--- /dev/null
+++ b/src/ConsoleDownloadEngine.h
@@ -0,0 +1,35 @@
+/* <!-- copyright */
+/*
+ * aria2 - a simple utility for downloading files faster
+ *
+ * Copyright (C) 2006 Tatsuhiro Tsujikawa
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/* copyright --> */
+#ifndef _D_CONSOLE_DOWNLOAD_ENGINE_H_
+#define _D_CONSOLE_DOWNLOAD_ENGINE_H_
+
+#include "DownloadEngine.h"
+
+class ConsoleDownloadEngine : public DownloadEngine {
+protected:
+ void sendStatistics(long long int currentSize, long long int totalSize);
+public:
+ ConsoleDownloadEngine();
+ ~ConsoleDownloadEngine();
+};
+
+#endif // _D_CONSOLE_DOWNLOAD_ENGINE_H_
diff --git a/src/Makefile.am b/src/Makefile.am
index 3a21655f..775f3075 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,6 +49,6 @@ SRCS = Socket.cc Socket.h\
noinst_LIBRARIES = libaria2c.a
libaria2c_a_SOURCES = $(SRCS)
aria2c_LDADD = libaria2c.a
-FLAGS = -Wall -D_FILE_OFFSET_BITS=64
+FLAGS = -Wall -D_FILE_OFFSET_BITS=64 -I../lib
libaria2c_a_CXXFLAGS = $(FLAGS)
aria2c_CXXFLAGS = $(FLAGS)
diff --git a/src/Makefile.in b/src/Makefile.in
index a030db26..685c5a8f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -35,11 +35,17 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
bin_PROGRAMS = aria2c$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -135,15 +141,24 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+GMSGFMT = @GMSGFMT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -152,11 +167,14 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+USE_NLS = @USE_NLS@
VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
@@ -171,10 +189,18 @@ am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
+build = @build@
build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
+host = @host@
host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -241,7 +267,7 @@ SRCS = Socket.cc Socket.h\
noinst_LIBRARIES = libaria2c.a
libaria2c_a_SOURCES = $(SRCS)
aria2c_LDADD = libaria2c.a
-FLAGS = -Wall -D_FILE_OFFSET_BITS=64
+FLAGS = -Wall -D_FILE_OFFSET_BITS=64 -I../lib
libaria2c_a_CXXFLAGS = $(FLAGS)
aria2c_CXXFLAGS = $(FLAGS)
all: all-am
diff --git a/src/common.h b/src/common.h
index 1ac60d63..d624266d 100644
--- a/src/common.h
+++ b/src/common.h
@@ -22,6 +22,9 @@
#include <iostream>
#include <assert.h>
#include <limits.h>
+#include <gettext.h>
+#define _(String) gettext (String)
+
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/src/main.cc b/src/main.cc
index 266d1d15..71a40f76 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -54,7 +54,7 @@ void clearRequest(Request* req) {
DownloadEngine* e;
void handler(int signal) {
- cout << "\nSIGINT signal received." << endl;
+ cout << _("\nSIGINT signal received.") << endl;
e->segmentMan->save();
if(e->diskWriter != NULL) {
e->diskWriter->closeFile();
@@ -69,7 +69,7 @@ void addCommand(int cuid, const char* url, string referer, vector<Request*> requ
e->commands.push(InitiateConnectionCommandFactory::createInitiateConnectionCommand(cuid, req, e));
requests.push_back(req);
} else {
- cerr << "Unrecognized URL or unsupported protocol: " << req->getUrl() << endl;
+ cerr << _("Unrecognized URL or unsupported protocol: ") << req->getUrl() << endl;
delete(req);
}
}
@@ -99,65 +99,65 @@ void showVersion() {
void showUsage() {
cout << endl;
- cout << "Usage: " << PACKAGE_NAME << " [options] URL ..." << endl;
+ cout << _("Usage: ") << PACKAGE_NAME << _(" [options] URL ...") << endl;
cout << endl;
- cout << "Options:" << endl;
- cout << " -d, --dir=DIR The directory to store downloaded file." << endl;
- cout << " -o, --out=FILE The file name for downloaded file." << endl;
- cout << " -l, --log=LOG The file path to store log. If '-' is specified," << endl;
- cout << " log is written to stdout." << endl;
- cout << " -D, --daemon Run as daemon." << endl;
- cout << " -s, --split=N Download a file using N connections. N must be" << endl;
- cout << " between 1 and 5. This option affects all URLs." << endl;
- cout << " Thus, aria2 connects to each URL with N connections." << endl;
- cout << " --retry-wait=SEC Set amount of time in second between requests" << endl;
- cout << " for errors. Specify a value between 0 and 60." << endl;
- cout << " Default: 5" << endl;
- cout << " -t, --timeout=SEC Set timeout in second. Default: 60" << endl;
- cout << " -m, --max-tries=N Set number of tries. 0 means unlimited." << endl;
- cout << " Default: 5" << endl;
- cout << " --min-segment-size=SIZE[K|M] Set minimum segment size. You can append" << endl;
+ cout << _("Options:") << endl;
+ cout << _(" -d, --dir=DIR The directory to store downloaded file.") << endl;
+ cout << _(" -o, --out=FILE The file name for downloaded file.") << endl;
+ cout << _(" -l, --log=LOG The file path to store log. If '-' is specified,") << endl;
+ cout << _(" log is written to stdout.") << endl;
+ cout << _(" -D, --daemon Run as daemon.") << endl;
+ cout << _(" -s, --split=N Download a file using N connections. N must be") << endl;
+ cout << _(" between 1 and 5. This option affects all URLs.") << endl;
+ cout << _(" Thus, aria2 connects to each URL with N connections.") << endl;
+ cout << _(" --retry-wait=SEC Set amount of time in second between requests") << endl;
+ cout << _(" for errors. Specify a value between 0 and 60.") << endl;
+ cout << " Default: 5" << endl;
+ cout << _(" -t, --timeout=SEC Set timeout in second. Default: 60") << endl;
+ cout << _(" -m, --max-tries=N Set number of tries. 0 means unlimited.") << endl;
+ cout << " Default: 5" << endl;
+ cout << _(" --min-segment-size=SIZE[K|M] Set minimum segment size. You can append") << endl;
cout << " K or M(1K = 1024, 1M = 1024K)." << endl;
- cout << " --http-proxy=HOST:PORT Use HTTP proxy server. This affects to all" << endl;
- cout << " URLs." << endl;
- cout << " --http-user=USER Set HTTP user. This affects to all URLs." << endl;
- cout << " --http-passwd=PASSWD Set HTTP password. This affects to all URLs." << endl;
- cout << " --http-proxy-user=USER Set HTTP proxy user. This affects to all URLs" << endl;
- cout << " --http-proxy-passwd=PASSWD Set HTTP proxy password. This affects to all URLs." << endl;
- cout << " --http-proxy-method=METHOD Set the method to use in proxy request." << endl;
- cout << " METHOD is either 'get' or 'tunnel'." << endl;
- cout << " Default: tunnel" << endl;
- cout << " --http-auth-scheme=SCHEME Set HTTP authentication scheme. Currently, basic" << endl;
- cout << " is the only supported scheme. You MUST specify" << endl;
- cout << " this option in order to use HTTP authentication" << endl;
- cout << " as well as --http-proxy option." << endl;
- cout << " --referer=REFERER Set Referer. This affects to all URLs." << endl;
- cout << " --ftp-user=USER Set FTP user. This affects to all URLs." << endl;
- cout << " Default: anonymous" << endl;
- cout << " --ftp-passwd=PASSWD Set FTP password. This affects to all URLs." << endl;
- cout << " Default: ARIA2USER@" << endl;
- cout << " --ftp-type=TYPE Set FTP transfer type. TYPE is either 'binary'" << endl;
- cout << " or 'ascii'." << endl;
- cout << " Default: binary" << endl;
- cout << " -p, --ftp-pasv Use passive mode in FTP." << endl;
- cout << " --ftp-via-http-proxy=METHOD Use HTTP proxy in FTP. METHOD is either 'get' or" << endl;
- cout << " 'tunnel'." << endl;
- cout << " Default: tunnel" << endl;
- cout << " -v, --version Print the version number and exit." << endl;
- cout << " -h, --help Print this message and exit." << endl;
+ cout << _(" --http-proxy=HOST:PORT Use HTTP proxy server. This affects to all") << endl;
+ cout << _(" URLs.") << endl;
+ cout << _(" --http-user=USER Set HTTP user. This affects to all URLs.") << endl;
+ cout << _(" --http-passwd=PASSWD Set HTTP password. This affects to all URLs.") << endl;
+ cout << _(" --http-proxy-user=USER Set HTTP proxy user. This affects to all URLs") << endl;
+ cout << _(" --http-proxy-passwd=PASSWD Set HTTP proxy password. This affects to all URLs.") << endl;
+ cout << _(" --http-proxy-method=METHOD Set the method to use in proxy request.") << endl;
+ cout << _(" METHOD is either 'get' or 'tunnel'.") << endl;
+ cout << " Default: tunnel" << endl;
+ cout << _(" --http-auth-scheme=SCHEME Set HTTP authentication scheme. Currently, basic") << endl;
+ cout << _(" is the only supported scheme. You MUST specify") << endl;
+ cout << _(" this option in order to use HTTP authentication") << endl;
+ cout << _(" as well as --http-proxy option.") << endl;
+ cout << _(" --referer=REFERER Set Referer. This affects to all URLs.") << endl;
+ cout << _(" --ftp-user=USER Set FTP user. This affects to all URLs.") << endl;
+ cout << _(" Default: anonymous") << endl;
+ cout << _(" --ftp-passwd=PASSWD Set FTP password. This affects to all URLs.") << endl;
+ cout << _(" Default: ARIA2USER@") << endl;
+ cout << _(" --ftp-type=TYPE Set FTP transfer type. TYPE is either 'binary'") << endl;
+ cout << _(" or 'ascii'.") << endl;
+ cout << _(" Default: binary") << endl;
+ cout << _(" -p, --ftp-pasv Use passive mode in FTP.") << endl;
+ cout << _(" --ftp-via-http-proxy=METHOD Use HTTP proxy in FTP. METHOD is either 'get' or") << endl;
+ cout << _(" 'tunnel'.") << endl;
+ cout << " Default: tunnel" << endl;
+ cout << _(" -v, --version Print the version number and exit.") << endl;
+ cout << _(" -h, --help Print this message and exit.") << endl;
cout << endl;
- cout << "URL:" << endl;
- cout << " You can specify multiple URLs. All URLs must point to the same file" << endl;
- cout << " or downloading fails." << endl;
+ cout << _("URL:") << endl;
+ cout << _(" You can specify multiple URLs. All URLs must point to the same file") << endl;
+ cout << _(" or downloading fails.") << endl;
cout << endl;
- cout << "Examples:" << endl;
- cout << " Download a file by 1 connection:" << endl;
+ cout << _("Examples:") << endl;
+ cout << _(" Download a file by 1 connection:") << endl;
cout << " aria2c http://AAA.BBB.CCC/file.zip" << endl;
- cout << " Download a file by 2 connections:" << endl;
+ cout << _(" Download a file by 2 connections:") << endl;
cout << " aria2c -s 2 http://AAA.BBB.CCC/file.zip" << endl;
- cout << " Download a file by 2 connections, each connects to a different server:" << endl;
+ cout << _(" Download a file by 2 connections, each connects to a different server:") << endl;
cout << " aria2c http://AAA.BBB.CCC/file.zip http://DDD.EEE.FFF/GGG/file.zip" << endl;
- cout << " You can mix up different protocols:" << endl;
+ cout << _(" You can mix up different protocols:") << endl;
cout << " aria2c http://AAA.BBB.CCC/file.zip ftp://DDD.EEE.FFF/GGG/file.zip" << endl;
cout << endl;
cout << "Reports bugs to <tujikawa at rednoah dot com>" << endl;
@@ -227,7 +227,7 @@ int main(int argc, char* argv[]) {
int port = (int)strtol(proxy.second.c_str(), NULL, 10);
if(proxy.first.empty() || proxy.second.empty() ||
!(0 < port && port <= 65535)) {
- cerr << "unrecognized proxy format" << endl;
+ cerr << _("unrecognized proxy format") << endl;
showUsage();
exit(1);
}
@@ -253,7 +253,7 @@ int main(int argc, char* argv[]) {
if(string(V_BASIC) == optarg) {
op->put(PREF_HTTP_AUTH_SCHEME, V_BASIC);
} else {
- cerr << "Currently, supported authentication scheme is basic." << endl;
+ cerr << _("Currently, supported authentication scheme is basic.") << endl;
}
break;
case 7:
@@ -262,7 +262,7 @@ int main(int argc, char* argv[]) {
case 8: {
int wait = (int)strtol(optarg, NULL, 10);
if(!(0 <= wait && wait <= 60)) {
- cerr << "retry-wait must be between 0 and 60." << endl;
+ cerr << _("retry-wait must be between 0 and 60.") << endl;
showUsage();
exit(1);
}
@@ -279,7 +279,7 @@ int main(int argc, char* argv[]) {
if(string(optarg) == V_BINARY || string(optarg) == V_ASCII) {
op->put(PREF_FTP_TYPE, optarg);
} else {
- cerr << "ftp-type must be either 'binary' or 'ascii'." << endl;
+ cerr << _("ftp-type must be either 'binary' or 'ascii'.") << endl;
showUsage();
exit(1);
}
@@ -288,7 +288,7 @@ int main(int argc, char* argv[]) {
if(string(optarg) == V_GET || string(optarg) == V_TUNNEL) {
op->put(PREF_FTP_VIA_HTTP_PROXY, optarg);
} else {
- cerr << "ftp-via-http-proxy must be either 'get' or 'tunnel'." << endl;
+ cerr << _("ftp-via-http-proxy must be either 'get' or 'tunnel'.") << endl;
showUsage();
exit(1);
}
@@ -306,7 +306,7 @@ int main(int argc, char* argv[]) {
}
long long int size = strtoll(optarg, NULL, 10)*mult;
if(size <= 0) {
- cerr << "min-segment-size invalid" << endl;
+ cerr << _("min-segment-size invalid") << endl;
showUsage();
exit(1);
}
@@ -317,7 +317,7 @@ int main(int argc, char* argv[]) {
if(string(optarg) == V_GET || string(optarg) == V_TUNNEL) {
op->put(PREF_HTTP_PROXY_METHOD, optarg);
} else {
- cerr << "http-proxy-method must be either 'get' or 'tunnel'." << endl;
+ cerr << _("http-proxy-method must be either 'get' or 'tunnel'.") << endl;
showUsage();
exit(1);
}
@@ -344,7 +344,7 @@ int main(int argc, char* argv[]) {
case 's':
split = (int)strtol(optarg, NULL, 10);
if(!(1 <= split && split <= 5)) {
- cerr << "split must be between 1 and 5." << endl;
+ cerr << _("split must be between 1 and 5.") << endl;
showUsage();
exit(1);
}
@@ -354,7 +354,7 @@ int main(int argc, char* argv[]) {
if(1 <= timeout && timeout <= 600) {
op->put(PREF_TIMEOUT, Util::itos(timeout));
} else {
- cerr << "timeout must be between 1 and 600" << endl;
+ cerr << _("timeout must be between 1 and 600") << endl;
showUsage();
exit(1);
}
@@ -363,7 +363,7 @@ int main(int argc, char* argv[]) {
case 'm': {
int retries = (int)strtol(optarg, NULL, 10);
if(retries < 0) {
- cerr << "max-retires invalid" << endl;
+ cerr << _("max-retires invalid") << endl;
showUsage();
exit(1);
}
@@ -385,7 +385,7 @@ int main(int argc, char* argv[]) {
}
}
if(optind == argc) {
- cerr << "specify at least one URL" << endl;
+ cerr << _("specify at least one URL") << endl;
showUsage();
exit(1);
}
@@ -436,9 +436,9 @@ int main(int argc, char* argv[]) {
e->run();
if(e->segmentMan->finished()) {
- cout << "\nThe download was complete. <" << e->segmentMan->getFilePath() << ">" << endl;
+ cout << _("\nThe download was complete. <") << e->segmentMan->getFilePath() << ">" << endl;
} else {
- cout << "\nThe download was not complete because of errors. Check the log." << endl;
+ cout << _("\nThe download was not complete because of errors. Check the log.") << endl;
}
for_each(requests.begin(), requests.end(), clearRequest);
diff --git a/src/message.h b/src/message.h
index cfbeca10..ebe0ef45 100644
--- a/src/message.h
+++ b/src/message.h
@@ -24,39 +24,39 @@
#include "common.h"
-#define MSG_DOWNLOAD_COMPLETED "CUID#%d - The download for one segment completed successfully."
-#define MSG_NO_SEGMENT_AVAILABLE "CUID#%d - No segment available."
-#define MSG_CONNECTING_TO_SERVER "CUID#%d - Connecting to %s:%d"
-#define MSG_SEGMENT_CHANGED "CUID#%d - The segment changed. We send the request again with new Range header."
-#define MSG_REDIRECT "CUID#%d - Redirecting to %s"
-#define MSG_SENDING_REQUEST "CUID#%d - Requesting:\n%s"
-#define MSG_RECEIVE_RESPONSE "CUID#%d - Response received:\n%s"
-#define MSG_DOWNLOAD_ABORTED "CUID#%d - Download aborted."
-#define MSG_RESTARTING_DOWNLOAD "CUID#%d - Restarting the download."
-#define MSG_MAX_TRY "CUID#%d - %d times attempted, but no success. Download aborted."
-#define MSG_UNREGISTER_CUID "CUID#%d - Unregistering cuid from segmentManager."
+#define MSG_DOWNLOAD_COMPLETED _("CUID#%d - The download for one segment completed successfully.")
+#define MSG_NO_SEGMENT_AVAILABLE _("CUID#%d - No segment available.")
+#define MSG_CONNECTING_TO_SERVER _("CUID#%d - Connecting to %s:%d")
+#define MSG_SEGMENT_CHANGED _("CUID#%d - The segment changed. We send the request again with new Range header.")
+#define MSG_REDIRECT _("CUID#%d - Redirecting to %s")
+#define MSG_SENDING_REQUEST _("CUID#%d - Requesting:\n%s")
+#define MSG_RECEIVE_RESPONSE _("CUID#%d - Response received:\n%s")
+#define MSG_DOWNLOAD_ABORTED _("CUID#%d - Download aborted.")
+#define MSG_RESTARTING_DOWNLOAD _("CUID#%d - Restarting the download.")
+#define MSG_MAX_TRY _("CUID#%d - %d times attempted, but no success. Download aborted.")
+#define MSG_UNREGISTER_CUID _("CUID#%d - Unregistering cuid from segmentManager.")
-#define MSG_SEGMENT_FILE_EXISTS "The segment file %s exists."
-#define MSG_SEGMENT_FILE_DOES_NOT_EXIST "The segment file %s does not exist."
-#define MSG_SAVING_SEGMENT_FILE "Saving the segment file %s"
-#define MSG_SAVED_SEGMENT_FILE "The segment file was saved successfully."
-#define MSG_LOADING_SEGMENT_FILE "Loading the segment file %s."
-#define MSG_LOADED_SEGMENT_FILE "The segment file was loaded successfully."
+#define MSG_SEGMENT_FILE_EXISTS _("The segment file %s exists.")
+#define MSG_SEGMENT_FILE_DOES_NOT_EXIST _("The segment file %s does not exist.")
+#define MSG_SAVING_SEGMENT_FILE _("Saving the segment file %s")
+#define MSG_SAVED_SEGMENT_FILE _("The segment file was saved successfully.")
+#define MSG_LOADING_SEGMENT_FILE _("Loading the segment file %s.")
+#define MSG_LOADED_SEGMENT_FILE _("The segment file was loaded successfully.")
-#define EX_TIME_OUT "Timeout."
-#define EX_INVALID_CHUNK_SIZE "Invalid chunk size."
-#define EX_TOO_LARGE_CHUNK "Too large chunk. size = %d"
-#define EX_INVALID_HEADER "Invalid header."
-#define EX_INVALID_RESPONSE "Invalid response."
-#define EX_NO_HEADER "No header found."
-#define EX_NO_STATUS_HEADER "No status header."
-#define EX_PROXY_CONNECTION_FAILED "Proxy connection failed."
-#define EX_CONNECTION_FAILED "Connection failed."
-#define EX_FILENAME_MISMATCH "The requested filename and the previously registered one are not same. %s != %s"
-#define EX_BAD_STATUS "The response status is not successful. status = %d"
-#define EX_TOO_LARGE_FILE "Too large file size. size = %lld"
-#define EX_TRANSFER_ENCODING_NOT_SUPPORTED "Transfer encoding %s is not supported."
-#define EX_SSL_INIT_FAILURE "SSL initialization failed."
-#define EX_SIZE_MISMATCH "Size mismatch %lld != %lld"
+#define EX_TIME_OUT _("Timeout.")
+#define EX_INVALID_CHUNK_SIZE _("Invalid chunk size.")
+#define EX_TOO_LARGE_CHUNK _("Too large chunk. size = %d")
+#define EX_INVALID_HEADER _("Invalid header.")
+#define EX_INVALID_RESPONSE _("Invalid response.")
+#define EX_NO_HEADER _("No header found.")
+#define EX_NO_STATUS_HEADER _("No status header.")
+#define EX_PROXY_CONNECTION_FAILED _("Proxy connection failed.")
+#define EX_CONNECTION_FAILED _("Connection failed.")
+#define EX_FILENAME_MISMATCH _("The requested filename and the previously registered one are not same. %s != %s")
+#define EX_BAD_STATUS _("The response status is not successful. status = %d")
+#define EX_TOO_LARGE_FILE _("Too large file size. size = %lld")
+#define EX_TRANSFER_ENCODING_NOT_SUPPORTED _("Transfer encoding %s is not supported.")
+#define EX_SSL_INIT_FAILURE _("SSL initialization failed.")
+#define EX_SIZE_MISMATCH _("Size mismatch %lld != %lld")
#endif // _D_MESSAGE_H_