(trunk, libT) #5165: fix r13625 oops
This commit is contained in:
parent
cff58b1904
commit
a2d2a10226
|
@ -200,7 +200,7 @@ on_announce_done (tr_session * session,
|
|||
|
||||
if (response_code != HTTP_OK)
|
||||
{
|
||||
const char * fmt = _ ("Tracker gave HTTP response code %1$ld (%2$s)");
|
||||
const char * fmt = _("Tracker gave HTTP response code %1$ld (%2$s)");
|
||||
const char * response_str = tr_webGetResponseStr (response_code);
|
||||
response->errmsg = tr_strdup_printf (fmt, response_code, response_str);
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ on_scrape_done (tr_session * session,
|
|||
|
||||
if (response_code != HTTP_OK)
|
||||
{
|
||||
const char * fmt = _ ("Tracker gave HTTP response code %1$ld (%2$s)");
|
||||
const char * fmt = _("Tracker gave HTTP response code %1$ld (%2$s)");
|
||||
const char * response_str = tr_webGetResponseStr (response_code);
|
||||
response->errmsg = tr_strdup_printf (fmt, response_code, response_str);
|
||||
}
|
||||
|
|
|
@ -258,7 +258,7 @@ on_scrape_response (struct tau_scrape_request * request,
|
|||
if ((action == TAU_ACTION_ERROR) && (buflen > 0))
|
||||
errmsg = tr_strndup (evbuffer_pullup (buf, -1), buflen);
|
||||
else
|
||||
errmsg = tr_strdup (_ ("Unknown error"));
|
||||
errmsg = tr_strdup (_("Unknown error"));
|
||||
|
||||
tau_scrape_request_fail (request, true, false, errmsg);
|
||||
tr_free (errmsg);
|
||||
|
@ -408,7 +408,7 @@ on_announce_response (struct tau_announce_request * request,
|
|||
if ((action == TAU_ACTION_ERROR) && (buflen > 0))
|
||||
errmsg = tr_strndup (evbuffer_pullup (buf, -1), buflen);
|
||||
else
|
||||
errmsg = tr_strdup (_ ("Unknown error"));
|
||||
errmsg = tr_strdup (_("Unknown error"));
|
||||
|
||||
tau_announce_request_fail (request, true, false, errmsg);
|
||||
tr_free (errmsg);
|
||||
|
@ -495,7 +495,7 @@ tau_tracker_on_dns (int errcode, struct evutil_addrinfo *addr, void * vtracker)
|
|||
|
||||
if (errcode)
|
||||
{
|
||||
char * errmsg = tr_strdup_printf (_ ("DNS Lookup failed: %s"),
|
||||
char * errmsg = tr_strdup_printf (_("DNS Lookup failed: %s"),
|
||||
evdns_err_to_string (errcode));
|
||||
dbgmsg (tracker->key, "%s", errmsg);
|
||||
tau_tracker_fail_all (tracker, false, false, errmsg);
|
||||
|
@ -596,7 +596,7 @@ on_tracker_connection_response (struct tau_tracker * tracker,
|
|||
if ((action == TAU_ACTION_ERROR) && (buflen > 0))
|
||||
errmsg = tr_strndup (evbuffer_pullup (buf, -1), buflen);
|
||||
else
|
||||
errmsg = tr_strdup (_ ("Connection failed"));
|
||||
errmsg = tr_strdup (_("Connection failed"));
|
||||
|
||||
dbgmsg (tracker->key, "%s", errmsg);
|
||||
tau_tracker_fail_all (tracker, true, false, errmsg);
|
||||
|
|
|
@ -1055,11 +1055,11 @@ on_announce_done (const tr_announce_response * response,
|
|||
|
||||
if (!response->did_connect)
|
||||
{
|
||||
on_announce_error (tier, _ ("Could not connect to tracker"), event);
|
||||
on_announce_error (tier, _("Could not connect to tracker"), event);
|
||||
}
|
||||
else if (response->did_timeout)
|
||||
{
|
||||
on_announce_error (tier, _ ("Tracker did not respond"), event);
|
||||
on_announce_error (tier, _("Tracker did not respond"), event);
|
||||
}
|
||||
else if (response->errmsg)
|
||||
{
|
||||
|
@ -1121,7 +1121,7 @@ on_announce_done (const tr_announce_response * response,
|
|||
}
|
||||
else
|
||||
{
|
||||
tr_strlcpy (tier->lastAnnounceStr, _ ("Success"),
|
||||
tr_strlcpy (tier->lastAnnounceStr, _("Success"),
|
||||
sizeof (tier->lastAnnounceStr));
|
||||
}
|
||||
|
||||
|
@ -1330,11 +1330,11 @@ on_scrape_done (const tr_scrape_response * response, void * vsession)
|
|||
|
||||
if (!response->did_connect)
|
||||
{
|
||||
on_scrape_error (session, tier, _ ("Could not connect to tracker"));
|
||||
on_scrape_error (session, tier, _("Could not connect to tracker"));
|
||||
}
|
||||
else if (response->did_timeout)
|
||||
{
|
||||
on_scrape_error (session, tier, _ ("Tracker did not respond"));
|
||||
on_scrape_error (session, tier, _("Tracker did not respond"));
|
||||
}
|
||||
else if (response->errmsg)
|
||||
{
|
||||
|
|
|
@ -1114,7 +1114,7 @@ bencWalk (const tr_benc * top,
|
|||
|
||||
default:
|
||||
/* did caller give us an uninitialized val? */
|
||||
tr_err ("%s", _ ("Invalid metadata"));
|
||||
tr_err ("%s", _("Invalid metadata"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1713,7 +1713,7 @@ tr_bencToFile (const tr_benc * top, tr_fmt_mode mode, const char * filename)
|
|||
|
||||
if (nleft > 0)
|
||||
{
|
||||
tr_err (_ ("Couldn't save temporary file \"%1$s\": %2$s"), tmp, tr_strerror (err));
|
||||
tr_err (_("Couldn't save temporary file \"%1$s\": %2$s"), tmp, tr_strerror (err));
|
||||
tr_close_file (fd);
|
||||
unlink (tmp);
|
||||
}
|
||||
|
@ -1728,12 +1728,12 @@ tr_bencToFile (const tr_benc * top, tr_fmt_mode mode, const char * filename)
|
|||
if (!rename (tmp, filename))
|
||||
#endif
|
||||
{
|
||||
tr_inf (_ ("Saved \"%s\""), filename);
|
||||
tr_inf (_("Saved \"%s\""), filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = errno;
|
||||
tr_err (_ ("Couldn't save file \"%1$s\": %2$s"), filename, tr_strerror (err));
|
||||
tr_err (_("Couldn't save file \"%1$s\": %2$s"), filename, tr_strerror (err));
|
||||
unlink (tmp);
|
||||
}
|
||||
}
|
||||
|
@ -1741,7 +1741,7 @@ tr_bencToFile (const tr_benc * top, tr_fmt_mode mode, const char * filename)
|
|||
else
|
||||
{
|
||||
err = errno;
|
||||
tr_err (_ ("Couldn't save temporary file \"%1$s\": %2$s"), tmp, tr_strerror (err));
|
||||
tr_err (_("Couldn't save temporary file \"%1$s\": %2$s"), tmp, tr_strerror (err));
|
||||
}
|
||||
|
||||
tr_free (tmp);
|
||||
|
|
|
@ -83,7 +83,7 @@ blocklistLoad (tr_blocklist * b)
|
|||
int fd;
|
||||
size_t byteCount;
|
||||
struct stat st;
|
||||
const char * err_fmt = _ ("Couldn't read \"%1$s\": %2$s");
|
||||
const char * err_fmt = _("Couldn't read \"%1$s\": %2$s");
|
||||
|
||||
blocklistClose (b);
|
||||
|
||||
|
@ -112,7 +112,7 @@ blocklistLoad (tr_blocklist * b)
|
|||
|
||||
{
|
||||
char * base = tr_basename (b->filename);
|
||||
tr_inf (_ ("Blocklist \"%s\" contains %zu entries"), base, b->ruleCount);
|
||||
tr_inf (_("Blocklist \"%s\" contains %zu entries"), base, b->ruleCount);
|
||||
tr_free (base);
|
||||
}
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ _tr_blocklistSetContent (tr_blocklist * b, const char * filename)
|
|||
FILE * out;
|
||||
int inCount = 0;
|
||||
char line[2048];
|
||||
const char * err_fmt = _ ("Couldn't read \"%1$s\": %2$s");
|
||||
const char * err_fmt = _("Couldn't read \"%1$s\": %2$s");
|
||||
struct tr_ipv4_range * ranges = NULL;
|
||||
size_t ranges_alloc = 0;
|
||||
size_t ranges_count = 0;
|
||||
|
@ -365,7 +365,7 @@ _tr_blocklistSetContent (tr_blocklist * b, const char * filename)
|
|||
if (!parseLine (line, &range))
|
||||
{
|
||||
/* don't try to display the actual lines - it causes issues */
|
||||
tr_err (_ ("blocklist skipped invalid address at line %d"), inCount);
|
||||
tr_err (_("blocklist skipped invalid address at line %d"), inCount);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -414,10 +414,10 @@ _tr_blocklistSetContent (tr_blocklist * b, const char * filename)
|
|||
}
|
||||
|
||||
if (fwrite (ranges, sizeof (struct tr_ipv4_range), ranges_count, out) != ranges_count)
|
||||
tr_err (_ ("Couldn't save file \"%1$s\": %2$s"), b->filename, tr_strerror (errno));
|
||||
tr_err (_("Couldn't save file \"%1$s\": %2$s"), b->filename, tr_strerror (errno));
|
||||
else {
|
||||
char * base = tr_basename (b->filename);
|
||||
tr_inf (_ ("Blocklist \"%s\" updated with %zu entries"), base, ranges_count);
|
||||
tr_inf (_("Blocklist \"%s\" updated with %zu entries"), base, ranges_count);
|
||||
tr_free (base);
|
||||
}
|
||||
|
||||
|
|
|
@ -357,7 +357,7 @@ cached_file_open (struct tr_cached_file * o,
|
|||
char * dir = tr_dirname (filename);
|
||||
const int err = tr_mkdirp (dir, 0777) ? errno : 0;
|
||||
if (err) {
|
||||
tr_err (_ ("Couldn't create \"%1$s\": %2$s"), dir, tr_strerror (err));
|
||||
tr_err (_("Couldn't create \"%1$s\": %2$s"), dir, tr_strerror (err));
|
||||
tr_free (dir);
|
||||
return err;
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ cached_file_open (struct tr_cached_file * o,
|
|||
if (o->fd == -1)
|
||||
{
|
||||
const int err = errno;
|
||||
tr_err (_ ("Couldn't open \"%1$s\": %2$s"), filename, tr_strerror (err));
|
||||
tr_err (_("Couldn't open \"%1$s\": %2$s"), filename, tr_strerror (err));
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -393,7 +393,7 @@ cached_file_open (struct tr_cached_file * o,
|
|||
if (ftruncate (o->fd, file_size) == -1)
|
||||
{
|
||||
const int err = errno;
|
||||
tr_err (_ ("Couldn't truncate \"%1$s\": %2$s"), filename, tr_strerror (err));
|
||||
tr_err (_("Couldn't truncate \"%1$s\": %2$s"), filename, tr_strerror (err));
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
@ -679,7 +679,7 @@ tr_fdSocketCreate (tr_session * session, int domain, int type)
|
|||
if (gFd->peerCount < session->peerLimit)
|
||||
if ((s = socket (domain, type, 0)) < 0)
|
||||
if (sockerrno != EAFNOSUPPORT)
|
||||
tr_err (_ ("Couldn't create socket: %s"), tr_strerror (sockerrno));
|
||||
tr_err (_("Couldn't create socket: %s"), tr_strerror (sockerrno));
|
||||
|
||||
if (s > -1)
|
||||
++gFd->peerCount;
|
||||
|
|
|
@ -60,7 +60,7 @@ getFiles (const char * dir,
|
|||
i = stat (buf, &sb);
|
||||
if (i)
|
||||
{
|
||||
tr_err (_ ("Torrent Creator is skipping file \"%s\": %s"),
|
||||
tr_err (_("Torrent Creator is skipping file \"%s\": %s"),
|
||||
buf, tr_strerror (errno));
|
||||
tr_free (buf);
|
||||
return list;
|
||||
|
|
|
@ -108,7 +108,7 @@ tr_metainfoMigrate (tr_session * session, tr_info * inf)
|
|||
out = fopen (name, "wb+");
|
||||
if (!out)
|
||||
{
|
||||
tr_nerr (inf->name, _ ("Couldn't create \"%1$s\": %2$s"), name, tr_strerror (errno));
|
||||
tr_nerr (inf->name, _("Couldn't create \"%1$s\": %2$s"), name, tr_strerror (errno));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -604,7 +604,7 @@ tr_metainfoParse (const tr_session * session,
|
|||
|
||||
if (badTag)
|
||||
{
|
||||
tr_nerr (inf->name, _ ("Invalid metadata entry \"%s\""), badTag);
|
||||
tr_nerr (inf->name, _("Invalid metadata entry \"%s\""), badTag);
|
||||
tr_metainfoFree (inf);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define COMMAND_WAIT_SECS 8
|
||||
|
||||
static const char *
|
||||
getKey (void) { return _ ("Port Forwarding (NAT-PMP)"); }
|
||||
getKey (void) { return _("Port Forwarding (NAT-PMP)"); }
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ logVal (const char * func,
|
|||
if (ret == NATPMP_TRYAGAIN)
|
||||
return;
|
||||
if (ret >= 0)
|
||||
tr_ninf (getKey (), _ ("%s succeeded (%d)"), func, ret);
|
||||
tr_ninf (getKey (), _("%s succeeded (%d)"), func, ret);
|
||||
else
|
||||
tr_ndbg (
|
||||
getKey (),
|
||||
|
@ -138,7 +138,7 @@ tr_natpmpPulse (struct tr_natpmp * nat, tr_port private_port, bool is_enabled, t
|
|||
{
|
||||
char str[128];
|
||||
evutil_inet_ntop (AF_INET, &response.pnu.publicaddress.addr, str, sizeof (str));
|
||||
tr_ninf (getKey (), _ ("Found public address \"%s\""), str);
|
||||
tr_ninf (getKey (), _("Found public address \"%s\""), str);
|
||||
nat->state = TR_NATPMP_IDLE;
|
||||
}
|
||||
else if (val != NATPMP_TRYAGAIN)
|
||||
|
@ -173,7 +173,7 @@ tr_natpmpPulse (struct tr_natpmp * nat, tr_port private_port, bool is_enabled, t
|
|||
{
|
||||
const int private_port = resp.pnu.newportmapping.privateport;
|
||||
|
||||
tr_ninf (getKey (), _ ("no longer forwarding port %d"), private_port);
|
||||
tr_ninf (getKey (), _("no longer forwarding port %d"), private_port);
|
||||
|
||||
if (nat->private_port == private_port)
|
||||
{
|
||||
|
@ -218,7 +218,7 @@ tr_natpmpPulse (struct tr_natpmp * nat, tr_port private_port, bool is_enabled, t
|
|||
nat->renew_time = tr_time () + (resp.pnu.newportmapping.lifetime / 2);
|
||||
nat->private_port = resp.pnu.newportmapping.privateport;
|
||||
nat->public_port = resp.pnu.newportmapping.mappedpublicport;
|
||||
tr_ninf (getKey (), _ ("Port %d forwarded successfully"), nat->private_port);
|
||||
tr_ninf (getKey (), _("Port %d forwarded successfully"), nat->private_port);
|
||||
}
|
||||
else if (val != NATPMP_TRYAGAIN)
|
||||
{
|
||||
|
|
|
@ -265,7 +265,7 @@ tr_netOpenPeerSocket (tr_session * session,
|
|||
sourcelen = setup_sockaddr (source_addr, 0, &source_sock);
|
||||
if (bind (s, (struct sockaddr *) &source_sock, sourcelen))
|
||||
{
|
||||
tr_err (_ ("Couldn't set source address %s on %d: %s"),
|
||||
tr_err (_("Couldn't set source address %s on %d: %s"),
|
||||
tr_address_to_string (source_addr), s, tr_strerror (errno));
|
||||
return -errno;
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ tr_netOpenPeerSocket (tr_session * session,
|
|||
tmperrno = sockerrno;
|
||||
if ((tmperrno != ENETUNREACH && tmperrno != EHOSTUNREACH)
|
||||
|| addr->type == TR_AF_INET)
|
||||
tr_err (_ ("Couldn't connect socket %d to %s, port %d (errno %d - %s)"),
|
||||
tr_err (_("Couldn't connect socket %d to %s, port %d (errno %d - %s)"),
|
||||
s, tr_address_to_string (addr), (int)ntohs (port), tmperrno,
|
||||
tr_strerror (tmperrno));
|
||||
tr_netClose (session, s);
|
||||
|
@ -357,14 +357,14 @@ tr_netBindTCPImpl (const tr_address * addr, tr_port port, bool suppressMsgs, int
|
|||
const char * hint;
|
||||
|
||||
if (err == EADDRINUSE)
|
||||
hint = _ ("Is another copy of Transmission already running?");
|
||||
hint = _("Is another copy of Transmission already running?");
|
||||
else
|
||||
hint = NULL;
|
||||
|
||||
if (hint == NULL)
|
||||
fmt = _ ("Couldn't bind port %d on %s: %s");
|
||||
fmt = _("Couldn't bind port %d on %s: %s");
|
||||
else
|
||||
fmt = _ ("Couldn't bind port %d on %s: %s (%s)");
|
||||
fmt = _("Couldn't bind port %d on %s: %s (%s)");
|
||||
|
||||
tr_err (fmt, port, tr_address_to_string (addr), tr_strerror (err), hint);
|
||||
}
|
||||
|
|
|
@ -1805,7 +1805,7 @@ peerCallbackFunc (tr_peer * peer, const tr_peer_event * e, void * vt)
|
|||
|
||||
if (!ok)
|
||||
{
|
||||
tr_torerr (tor, _ ("Piece %lu, which was just downloaded, failed its checksum test"),
|
||||
tr_torerr (tor, _("Piece %lu, which was just downloaded, failed its checksum test"),
|
||||
(unsigned long)p);
|
||||
}
|
||||
|
||||
|
|
|
@ -1895,7 +1895,7 @@ fillOutputBuffer (tr_peermsgs * msgs, time_t now)
|
|||
/* check the piece if it needs checking... */
|
||||
if (!err && tr_torrentPieceNeedsCheck (msgs->torrent, req.index))
|
||||
if ((err = !tr_torrentCheckPiece (msgs->torrent, req.index)))
|
||||
tr_torrentSetLocalError (msgs->torrent, _ ("Please Verify Local Data! Piece #%zu is corrupt."), (size_t)req.index);
|
||||
tr_torrentSetLocalError (msgs->torrent, _("Please Verify Local Data! Piece #%zu is corrupt."), (size_t)req.index);
|
||||
|
||||
if (err)
|
||||
{
|
||||
|
|
|
@ -357,7 +357,7 @@ moveFiles (const char * oldDir, const char * newDir)
|
|||
}
|
||||
|
||||
if (count)
|
||||
tr_inf (_ ("Migrated %1$d files from \"%2$s\" to \"%3$s\""), count, oldDir, newDir);
|
||||
tr_inf (_("Migrated %1$d files from \"%2$s\" to \"%3$s\""), count, oldDir, newDir);
|
||||
|
||||
closedir (dirh);
|
||||
}
|
||||
|
@ -532,7 +532,7 @@ isWebClientDir (const char * path)
|
|||
struct stat sb;
|
||||
char * tmp = tr_buildPath (path, "index.html", NULL);
|
||||
const int ret = !stat (tmp, &sb);
|
||||
tr_inf (_ ("Searching for web interface file \"%s\""), tmp);
|
||||
tr_inf (_("Searching for web interface file \"%s\""), tmp);
|
||||
tr_free (tmp);
|
||||
|
||||
return ret;
|
||||
|
@ -727,7 +727,7 @@ tr_getFreeSpace (const char * path)
|
|||
#if defined (_MSC_VER)
|
||||
__declspec (align (4)) static LONG volatile g_sl;
|
||||
#else
|
||||
static LONG volatile g_sl __attribute__ ((aligned (4)));
|
||||
static LONG volatile g_sl __attribute__((aligned (4)));
|
||||
#endif
|
||||
|
||||
/* Wait for spin lock */
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "utils.h"
|
||||
|
||||
static const char *
|
||||
getKey (void) { return _ ("Port Forwarding"); }
|
||||
getKey (void) { return _("Port Forwarding"); }
|
||||
|
||||
struct tr_shared
|
||||
{
|
||||
|
@ -55,10 +55,10 @@ getNatStateStr (int state)
|
|||
{
|
||||
switch (state)
|
||||
{
|
||||
case TR_PORT_MAPPING: return _ ("Starting");
|
||||
case TR_PORT_MAPPED: return _ ("Forwarded");
|
||||
case TR_PORT_UNMAPPING: return _ ("Stopping");
|
||||
case TR_PORT_UNMAPPED: return _ ("Not forwarded");
|
||||
case TR_PORT_MAPPING: return _("Starting");
|
||||
case TR_PORT_MAPPED: return _("Forwarded");
|
||||
case TR_PORT_UNMAPPING: return _("Stopping");
|
||||
case TR_PORT_UNMAPPED: return _("Not forwarded");
|
||||
default: return "???";
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ natPulse (tr_shared * s, bool do_check)
|
|||
newStatus = tr_sharedTraversalStatus (s);
|
||||
|
||||
if (newStatus != oldStatus)
|
||||
tr_ninf (getKey (), _ ("State changed from \"%1$s\" to \"%2$s\""),
|
||||
tr_ninf (getKey (), _("State changed from \"%1$s\" to \"%2$s\""),
|
||||
getNatStateStr (oldStatus),
|
||||
getNatStateStr (newStatus));
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ stop_timer (tr_shared * s)
|
|||
static void
|
||||
stop_forwarding (tr_shared * s)
|
||||
{
|
||||
tr_ninf (getKey (), "%s", _ ("Stopped"));
|
||||
tr_ninf (getKey (), "%s", _("Stopped"));
|
||||
natPulse (s, false);
|
||||
|
||||
tr_natpmpClose (s->natpmp);
|
||||
|
|
|
@ -933,75 +933,75 @@ tr_rpcInit (tr_session * session, tr_benc * settings)
|
|||
|
||||
key = TR_PREFS_KEY_RPC_ENABLED;
|
||||
if (!tr_bencDictFindBool (settings, key, &boolVal))
|
||||
tr_nerr (MY_NAME, _ ("Couldn't find settings key \"%s\""), key);
|
||||
tr_nerr (MY_NAME, _("Couldn't find settings key \"%s\""), key);
|
||||
else
|
||||
s->isEnabled = boolVal;
|
||||
|
||||
key = TR_PREFS_KEY_RPC_PORT;
|
||||
if (!tr_bencDictFindInt (settings, key, &i))
|
||||
tr_nerr (MY_NAME, _ ("Couldn't find settings key \"%s\""), key);
|
||||
tr_nerr (MY_NAME, _("Couldn't find settings key \"%s\""), key);
|
||||
else
|
||||
s->port = i;
|
||||
|
||||
key = TR_PREFS_KEY_RPC_URL;
|
||||
if (!tr_bencDictFindStr (settings, TR_PREFS_KEY_RPC_URL, &str))
|
||||
tr_nerr (MY_NAME, _ ("Couldn't find settings key \"%s\""), key);
|
||||
tr_nerr (MY_NAME, _("Couldn't find settings key \"%s\""), key);
|
||||
else
|
||||
s->url = tr_strdup (str);
|
||||
|
||||
key = TR_PREFS_KEY_RPC_WHITELIST_ENABLED;
|
||||
if (!tr_bencDictFindBool (settings, key, &boolVal))
|
||||
tr_nerr (MY_NAME, _ ("Couldn't find settings key \"%s\""), key);
|
||||
tr_nerr (MY_NAME, _("Couldn't find settings key \"%s\""), key);
|
||||
else
|
||||
tr_rpcSetWhitelistEnabled (s, boolVal);
|
||||
|
||||
key = TR_PREFS_KEY_RPC_AUTH_REQUIRED;
|
||||
if (!tr_bencDictFindBool (settings, key, &boolVal))
|
||||
tr_nerr (MY_NAME, _ ("Couldn't find settings key \"%s\""), key);
|
||||
tr_nerr (MY_NAME, _("Couldn't find settings key \"%s\""), key);
|
||||
else
|
||||
tr_rpcSetPasswordEnabled (s, boolVal);
|
||||
|
||||
key = TR_PREFS_KEY_RPC_WHITELIST;
|
||||
if (!tr_bencDictFindStr (settings, key, &str) && str)
|
||||
tr_nerr (MY_NAME, _ ("Couldn't find settings key \"%s\""), key);
|
||||
tr_nerr (MY_NAME, _("Couldn't find settings key \"%s\""), key);
|
||||
else
|
||||
tr_rpcSetWhitelist (s, str);
|
||||
|
||||
key = TR_PREFS_KEY_RPC_USERNAME;
|
||||
if (!tr_bencDictFindStr (settings, key, &str))
|
||||
tr_nerr (MY_NAME, _ ("Couldn't find settings key \"%s\""), key);
|
||||
tr_nerr (MY_NAME, _("Couldn't find settings key \"%s\""), key);
|
||||
else
|
||||
tr_rpcSetUsername (s, str);
|
||||
|
||||
key = TR_PREFS_KEY_RPC_PASSWORD;
|
||||
if (!tr_bencDictFindStr (settings, key, &str))
|
||||
tr_nerr (MY_NAME, _ ("Couldn't find settings key \"%s\""), key);
|
||||
tr_nerr (MY_NAME, _("Couldn't find settings key \"%s\""), key);
|
||||
else
|
||||
tr_rpcSetPassword (s, str);
|
||||
|
||||
key = TR_PREFS_KEY_RPC_BIND_ADDRESS;
|
||||
if (!tr_bencDictFindStr (settings, TR_PREFS_KEY_RPC_BIND_ADDRESS, &str)) {
|
||||
tr_nerr (MY_NAME, _ ("Couldn't find settings key \"%s\""), key);
|
||||
tr_nerr (MY_NAME, _("Couldn't find settings key \"%s\""), key);
|
||||
address = tr_inaddr_any;
|
||||
} else if (!tr_address_from_string (&address, str)) {
|
||||
tr_nerr (MY_NAME, _ ("%s is not a valid address"), str);
|
||||
tr_nerr (MY_NAME, _("%s is not a valid address"), str);
|
||||
address = tr_inaddr_any;
|
||||
} else if (address.type != TR_AF_INET) {
|
||||
tr_nerr (MY_NAME, _ ("%s is not an IPv4 address. RPC listeners must be IPv4"), str);
|
||||
tr_nerr (MY_NAME, _("%s is not an IPv4 address. RPC listeners must be IPv4"), str);
|
||||
address = tr_inaddr_any;
|
||||
}
|
||||
s->bindAddress = address.addr.addr4;
|
||||
|
||||
if (s->isEnabled)
|
||||
{
|
||||
tr_ninf (MY_NAME, _ ("Serving RPC and Web requests on port 127.0.0.1:%d%s"), (int) s->port, s->url);
|
||||
tr_ninf (MY_NAME, _("Serving RPC and Web requests on port 127.0.0.1:%d%s"), (int) s->port, s->url);
|
||||
tr_runInEventThread (session, startServer, s);
|
||||
|
||||
if (s->isWhitelistEnabled)
|
||||
tr_ninf (MY_NAME, "%s", _ ("Whitelist enabled"));
|
||||
tr_ninf (MY_NAME, "%s", _("Whitelist enabled"));
|
||||
|
||||
if (s->isPasswordEnabled)
|
||||
tr_ninf (MY_NAME, "%s", _ ("Password required"));
|
||||
tr_ninf (MY_NAME, "%s", _("Password required"));
|
||||
}
|
||||
|
||||
return s;
|
||||
|
|
|
@ -1257,7 +1257,7 @@ gotNewBlocklist (tr_session * session,
|
|||
filename = tr_buildPath (configDir, "blocklist.tmp", NULL);
|
||||
fd = tr_open_file_for_writing (filename);
|
||||
if (fd < 0)
|
||||
tr_snprintf (result, sizeof (result), _ ("Couldn't save file \"%1$s\": %2$s"), filename, tr_strerror (errno));
|
||||
tr_snprintf (result, sizeof (result), _("Couldn't save file \"%1$s\": %2$s"), filename, tr_strerror (errno));
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
@ -1268,14 +1268,14 @@ gotNewBlocklist (tr_session * session,
|
|||
if (stream.avail_out < buflen) {
|
||||
const int e = write (fd, buf, buflen - stream.avail_out);
|
||||
if (e < 0) {
|
||||
tr_snprintf (result, sizeof (result), _ ("Couldn't save file \"%1$s\": %2$s"), filename, tr_strerror (errno));
|
||||
tr_snprintf (result, sizeof (result), _("Couldn't save file \"%1$s\": %2$s"), filename, tr_strerror (errno));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (err != Z_OK) {
|
||||
if ((err != Z_STREAM_END) && (err != Z_DATA_ERROR))
|
||||
tr_snprintf (result, sizeof (result), _ ("Error uncompressing blocklist: %s (%d)"), zError (err), err);
|
||||
tr_snprintf (result, sizeof (result), _("Error uncompressing blocklist: %s (%d)"), zError (err), err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1284,7 +1284,7 @@ gotNewBlocklist (tr_session * session,
|
|||
|
||||
if (err == Z_DATA_ERROR) /* couldn't inflate it... it's probably already uncompressed */
|
||||
if (write (fd, response, response_byte_count) < 0)
|
||||
tr_snprintf (result, sizeof (result), _ ("Couldn't save file \"%1$s\": %2$s"), filename, tr_strerror (errno));
|
||||
tr_snprintf (result, sizeof (result), _("Couldn't save file \"%1$s\": %2$s"), filename, tr_strerror (errno));
|
||||
|
||||
if (*result)
|
||||
tr_err ("%s", result);
|
||||
|
|
|
@ -719,7 +719,7 @@ tr_sessionInitImpl (void * vdata)
|
|||
|
||||
/* first %s is the application name
|
||||
second %s is the version number */
|
||||
tr_inf (_ ("%s %s started"), TR_NAME, LONG_VERSION_STRING);
|
||||
tr_inf (_("%s %s started"), TR_NAME, LONG_VERSION_STRING);
|
||||
|
||||
tr_statsInit (session);
|
||||
|
||||
|
@ -1940,7 +1940,7 @@ sessionLoadTorrents (void * vdata)
|
|||
tr_list_free (&list, NULL);
|
||||
|
||||
if (n)
|
||||
tr_inf (_ ("Loaded %d torrents"), n);
|
||||
tr_inf (_("Loaded %d torrents"), n);
|
||||
|
||||
if (data->setmeCount)
|
||||
*data->setmeCount = n;
|
||||
|
|
|
@ -272,7 +272,7 @@ tr_torrentSetMetadataPiece (tr_torrent * tor, int piece, const void * data, in
|
|||
|
||||
if (success && !tr_getBlockSize (info.pieceSize))
|
||||
{
|
||||
tr_torrentSetLocalError (tor, "%s", _ ("Magnet torrent's metadata is not usable"));
|
||||
tr_torrentSetLocalError (tor, "%s", _("Magnet torrent's metadata is not usable"));
|
||||
success = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -522,14 +522,14 @@ onTrackerResponse (tr_torrent * tor, const tr_tracker_event * event, void * unus
|
|||
}
|
||||
|
||||
case TR_TRACKER_WARNING:
|
||||
tr_torerr (tor, _ ("Tracker warning: \"%s\""), event->text);
|
||||
tr_torerr (tor, _("Tracker warning: \"%s\""), event->text);
|
||||
tor->error = TR_STAT_TRACKER_WARNING;
|
||||
tr_strlcpy (tor->errorTracker, event->tracker, sizeof (tor->errorTracker));
|
||||
tr_strlcpy (tor->errorString, event->text, sizeof (tor->errorString));
|
||||
break;
|
||||
|
||||
case TR_TRACKER_ERROR:
|
||||
tr_torerr (tor, _ ("Tracker error: \"%s\""), event->text);
|
||||
tr_torerr (tor, _("Tracker error: \"%s\""), event->text);
|
||||
tor->error = TR_STAT_TRACKER_ERROR;
|
||||
tr_strlcpy (tor->errorTracker, event->tracker, sizeof (tor->errorTracker));
|
||||
tr_strlcpy (tor->errorString, event->text, sizeof (tor->errorString));
|
||||
|
@ -784,7 +784,7 @@ setLocalErrorIfFilesDisappeared (tr_torrent * tor)
|
|||
if (disappeared)
|
||||
{
|
||||
tr_deeplog_tor (tor, "%s", "[LAZY] uh oh, the files disappeared");
|
||||
tr_torrentSetLocalError (tor, "%s", _ ("No data found! Ensure your drives are connected or use \"Set Location\". To re-download, remove the torrent and re-add it."));
|
||||
tr_torrentSetLocalError (tor, "%s", _("No data found! Ensure your drives are connected or use \"Set Location\". To re-download, remove the torrent and re-add it."));
|
||||
}
|
||||
|
||||
return disappeared;
|
||||
|
@ -1674,7 +1674,7 @@ torrentStart (tr_torrent * tor, bool bypass_queue)
|
|||
|
||||
/* allow finished torrents to be resumed */
|
||||
if (tr_torrentIsSeedRatioDone (tor)) {
|
||||
tr_torinf (tor, _ ("Restarted manually -- disabling its seed ratio"));
|
||||
tr_torinf (tor, _("Restarted manually -- disabling its seed ratio"));
|
||||
tr_torrentSetRatioMode (tor, TR_RATIOLIMIT_UNLIMITED);
|
||||
}
|
||||
|
||||
|
@ -1826,7 +1826,7 @@ closeTorrent (void * vtor)
|
|||
tr_bencDictAddInt (d, "id", tor->uniqueId);
|
||||
tr_bencDictAddInt (d, "date", tr_time ());
|
||||
|
||||
tr_torinf (tor, "%s", _ ("Removing torrent"));
|
||||
tr_torinf (tor, "%s", _("Removing torrent"));
|
||||
|
||||
stopTorrent (tor);
|
||||
|
||||
|
@ -1910,13 +1910,13 @@ getCompletionString (int type)
|
|||
"Done" means we're done downloading the files we wanted, but NOT all
|
||||
that exist */
|
||||
case TR_PARTIAL_SEED:
|
||||
return _ ("Done");
|
||||
return _("Done");
|
||||
|
||||
case TR_SEED:
|
||||
return _ ("Complete");
|
||||
return _("Complete");
|
||||
|
||||
default:
|
||||
return _ ("Incomplete");
|
||||
return _("Incomplete");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2053,7 +2053,7 @@ tr_torrentRecheckCompleteness (tr_torrent * tor)
|
|||
|
||||
if (recentChange)
|
||||
{
|
||||
tr_torinf (tor, _ ("State changed from \"%1$s\" to \"%2$s\""),
|
||||
tr_torinf (tor, _("State changed from \"%1$s\" to \"%2$s\""),
|
||||
getCompletionString (tor->completeness),
|
||||
getCompletionString (completeness));
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "utils.h"
|
||||
|
||||
static const char *
|
||||
getKey (void) { return _ ("Port Forwarding (UPnP)"); }
|
||||
getKey (void) { return _("Port Forwarding (UPnP)"); }
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -197,10 +197,10 @@ tr_upnpPulse (tr_upnp * handle,
|
|||
if (UPNP_GetValidIGD (devlist, &handle->urls, &handle->data,
|
||||
handle->lanaddr, sizeof (handle->lanaddr)) == UPNP_IGD_VALID_CONNECTED)
|
||||
{
|
||||
tr_ninf (getKey (), _ (
|
||||
tr_ninf (getKey (), _(
|
||||
"Found Internet Gateway Device \"%s\""),
|
||||
handle->urls.controlURL);
|
||||
tr_ninf (getKey (), _ (
|
||||
tr_ninf (getKey (), _(
|
||||
"Local Address is \"%s\""), handle->lanaddr);
|
||||
handle->state = TR_UPNP_IDLE;
|
||||
handle->hasDiscovered = 1;
|
||||
|
@ -230,7 +230,7 @@ tr_upnpPulse (tr_upnp * handle,
|
|||
if ((tr_upnpGetSpecificPortMappingEntry (handle, "TCP") != UPNPCOMMAND_SUCCESS) ||
|
||||
(tr_upnpGetSpecificPortMappingEntry (handle, "UDP") != UPNPCOMMAND_SUCCESS))
|
||||
{
|
||||
tr_ninf (getKey (), _ ("Port %d isn't forwarded"), handle->port);
|
||||
tr_ninf (getKey (), _("Port %d isn't forwarded"), handle->port);
|
||||
handle->isMapped = false;
|
||||
}
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ tr_upnpPulse (tr_upnp * handle,
|
|||
tr_upnpDeletePortMapping (handle, "UDP", handle->port);
|
||||
|
||||
tr_ninf (getKey (),
|
||||
_ ("Stopping port forwarding through \"%s\", service \"%s\""),
|
||||
_("Stopping port forwarding through \"%s\", service \"%s\""),
|
||||
handle->urls.controlURL, handle->data.first.servicetype);
|
||||
|
||||
handle->isMapped = 0;
|
||||
|
@ -274,12 +274,12 @@ tr_upnpPulse (tr_upnp * handle,
|
|||
handle->isMapped = !err_tcp | !err_udp;
|
||||
}
|
||||
tr_ninf (getKey (),
|
||||
_ ("Port forwarding through \"%s\", service \"%s\". (local address: %s:%d)"),
|
||||
_("Port forwarding through \"%s\", service \"%s\". (local address: %s:%d)"),
|
||||
handle->urls.controlURL, handle->data.first.servicetype,
|
||||
handle->lanaddr, port);
|
||||
if (handle->isMapped)
|
||||
{
|
||||
tr_ninf (getKey (), "%s", _ ("Port forwarding successful!"));
|
||||
tr_ninf (getKey (), "%s", _("Port forwarding successful!"));
|
||||
handle->port = port;
|
||||
handle->state = TR_UPNP_IDLE;
|
||||
}
|
||||
|
|
|
@ -435,7 +435,7 @@ tr_loadFile (const char * path,
|
|||
struct stat sb;
|
||||
int fd;
|
||||
ssize_t n;
|
||||
const char * const err_fmt = _ ("Couldn't read \"%1$s\": %2$s");
|
||||
const char * const err_fmt = _("Couldn't read \"%1$s\": %2$s");
|
||||
|
||||
/* try to stat the file */
|
||||
errno = 0;
|
||||
|
@ -449,7 +449,7 @@ tr_loadFile (const char * path,
|
|||
|
||||
if ((sb.st_mode & S_IFMT) != S_IFREG)
|
||||
{
|
||||
tr_err (err_fmt, path, _ ("Not a regular file"));
|
||||
tr_err (err_fmt, path, _("Not a regular file"));
|
||||
errno = EISDIR;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ tr_loadFile (const char * path,
|
|||
if (!buf)
|
||||
{
|
||||
const int err = errno;
|
||||
tr_err (err_fmt, path, _ ("Memory allocation failed"));
|
||||
tr_err (err_fmt, path, _("Memory allocation failed"));
|
||||
tr_close_file (fd);
|
||||
errno = err;
|
||||
return NULL;
|
||||
|
@ -570,7 +570,7 @@ tr_mkdirp (const char * path_in,
|
|||
if (tr_mkdir (path, permissions))
|
||||
{
|
||||
const int err = errno;
|
||||
tr_err (_ (
|
||||
tr_err (_(
|
||||
"Couldn't create \"%1$s\": %2$s"), path,
|
||||
tr_strerror (err));
|
||||
tr_free (path);
|
||||
|
@ -581,8 +581,8 @@ tr_mkdirp (const char * path_in,
|
|||
else if ((sb.st_mode & S_IFMT) != S_IFDIR)
|
||||
{
|
||||
/* Node exists but isn't a folder */
|
||||
char * buf = tr_strdup_printf (_ ("File \"%s\" is in the way"), path);
|
||||
tr_err (_ ("Couldn't create \"%1$s\": %2$s"), path_in, buf);
|
||||
char * buf = tr_strdup_printf (_("File \"%s\" is in the way"), path);
|
||||
tr_err (_("Couldn't create \"%1$s\": %2$s"), path_in, buf);
|
||||
tr_free (buf);
|
||||
tr_free (path);
|
||||
errno = ENOTDIR;
|
||||
|
@ -982,7 +982,7 @@ isValidURLChars (const char * url, int url_len)
|
|||
"abcdefghijklmnopqrstuvwxyz" /* lowalpha */
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" /* upalpha */
|
||||
"0123456789" /* digit */
|
||||
"-_.!~*' ()" /* mark */
|
||||
"-_.!~*'()" /* mark */
|
||||
";/?:@&=+$," /* reserved */
|
||||
"<>#%<\"" /* delims */
|
||||
"{}|\\^[]`"; /* unwise */
|
||||
|
@ -1506,7 +1506,7 @@ char*
|
|||
tr_strratio (char * buf, size_t buflen, double ratio, const char * infinity)
|
||||
{
|
||||
if ((int)ratio == TR_RATIO_NA)
|
||||
tr_strlcpy (buf, _ ("None"), buflen);
|
||||
tr_strlcpy (buf, _("None"), buflen);
|
||||
else if ((int)ratio == TR_RATIO_INF)
|
||||
tr_strlcpy (buf, infinity, buflen);
|
||||
else
|
||||
|
|
|
@ -226,7 +226,7 @@ verifyThreadFunc (void * unused UNUSED)
|
|||
tr_free (node);
|
||||
tr_lockUnlock (getVerifyLock ());
|
||||
|
||||
tr_torinf (tor, "%s", _ ("Verifying torrent"));
|
||||
tr_torinf (tor, "%s", _("Verifying torrent"));
|
||||
tr_torrentSetVerifyState (tor, TR_VERIFY_NOW);
|
||||
changed = verifyTorrent (tor, &stopCurrent);
|
||||
tr_torrentSetVerifyState (tor, TR_VERIFY_NONE);
|
||||
|
@ -270,7 +270,7 @@ tr_verifyAdd (tr_torrent * tor, tr_verify_done_cb verify_done_cb)
|
|||
struct verify_node * node;
|
||||
|
||||
assert (tr_isTorrent (tor));
|
||||
tr_torinf (tor, "%s", _ ("Queued for verification"));
|
||||
tr_torinf (tor, "%s", _("Queued for verification"));
|
||||
|
||||
node = tr_new (struct verify_node, 1);
|
||||
node->torrent = tor;
|
||||
|
|
Loading…
Reference in New Issue