Made notice level log messages translatable

This commit is contained in:
Tatsuhiro Tsujikawa 2011-12-02 22:38:53 +09:00
parent dd3f688743
commit 26d4ca8a6a
12 changed files with 32 additions and 23 deletions

View File

@ -5,5 +5,14 @@ src/OptionHandler.cc
src/OptionHandlerImpl.h
src/usage_text.h
src/version_usage.cc
src/message.h
src/BtSetup.cc
src/AbstractCommand.cc
src/AdaptiveURISelector.cc
src/BtStopDownloadCommand.cc
src/DHTConnectionImpl.cc
src/HttpListenCommand.cc
src/PeerListenCommand.cc
src/RequestGroup.cc
src/SingleFileAllocationIterator.cc
src/TimedHaltCommand.cc
src/message.h

View File

@ -440,8 +440,8 @@ void AbstractCommand::onAbort() {
// Local file exists, but given servers(or at least contacted
// ones) doesn't support resume. Let's restart download from
// scratch.
A2_LOG_NOTICE(fmt("CUID#%lld - Failed to resume download."
" Download from scratch.",
A2_LOG_NOTICE(fmt(_("CUID#%lld - Failed to resume download."
" Download from scratch."),
getCuid()));
A2_LOG_DEBUG(fmt("CUID#%lld - Gathering URIs that has CANNOT_RESUME"
" error",

View File

@ -224,15 +224,15 @@ void AdaptiveURISelector::adjustLowestSpeedLimit
unsigned int low_lowest = 4 * 1024;
unsigned int max = getMaxDownloadSpeed(uris);
if (max > 0 && lowest > max / 4) {
A2_LOG_NOTICE(fmt("Lowering lowest-speed-limit since known max speed is"
" too near (new:%d was:%d max:%d)",
A2_LOG_NOTICE(fmt(_("Lowering lowest-speed-limit since known max speed is"
" too near (new:%d was:%d max:%d)"),
max / 4,
lowest,
max));
command->setLowestDownloadSpeedLimit(max / 4);
} else if (max == 0 && lowest > low_lowest) {
A2_LOG_NOTICE(fmt("Lowering lowest-speed-limit since we have no clue"
" about available speed (now:%d was:%d)",
A2_LOG_NOTICE(fmt(_("Lowering lowest-speed-limit since we have no clue"
" about available speed (now:%d was:%d)"),
low_lowest,
lowest));
command->setLowestDownloadSpeedLimit(low_lowest);

View File

@ -61,8 +61,8 @@ void BtStopDownloadCommand::preProcess()
enableExit();
}
if(checkPoint_.difference(global::wallclock()) >= timeout_) {
A2_LOG_NOTICE(fmt("GID#%lld Stop downloading torrent due to"
" --bt-stop-timeout option.",
A2_LOG_NOTICE(fmt(_("GID#%lld Stop downloading torrent due to"
" --bt-stop-timeout option."),
requestGroup_->getGID()));
requestGroup_->setForceHaltRequested(true);
getDownloadEngine()->setRefreshInterval(0);

View File

@ -86,7 +86,7 @@ bool DHTConnectionImpl::bind(uint16_t& port, const std::string& addr)
std::pair<std::string, uint16_t> svaddr;
socket_->getAddrInfo(svaddr);
port = svaddr.second;
A2_LOG_NOTICE(fmt("IPv%d DHT: listening to port %u", ipv, port));
A2_LOG_NOTICE(fmt(_("IPv%d DHT: listening to port %u"), ipv, port));
return true;
} catch(RecoverableException& e) {
A2_LOG_ERROR_EX(fmt("IPv%d DHT: failed to bind port %u", ipv, port), e);

View File

@ -109,7 +109,7 @@ bool HttpListenCommand::bindPort(uint16_t port)
A2_LOG_INFO(fmt(MSG_LISTENING_PORT,
getCuid(), port));
e_->addSocketForReadCheck(serverSocket_, this);
A2_LOG_NOTICE(fmt("IPv%d RPC: listening to port %u", ipv, port));
A2_LOG_NOTICE(fmt(_("IPv%d RPC: listening to port %u"), ipv, port));
return true;
} catch(RecoverableException& e) {
A2_LOG_ERROR_EX(fmt("IPv%d RPC: failed to bind port %u", ipv, port), e);

View File

@ -271,10 +271,10 @@ error_code::Value MultiUrlRequestInfo::execute()
if(!option_->blank(PREF_SAVE_SESSION)) {
const std::string& filename = option_->get(PREF_SAVE_SESSION);
if(sessionSerializer.save(filename)) {
A2_LOG_NOTICE(fmt("Serialized session to '%s' successfully.",
A2_LOG_NOTICE(fmt(_("Serialized session to '%s' successfully."),
filename.c_str()));
} else {
A2_LOG_NOTICE(fmt("Failed to serialize session to '%s'.",
A2_LOG_NOTICE(fmt(_("Failed to serialize session to '%s'."),
filename.c_str()));
}
}

View File

@ -80,7 +80,8 @@ bool PeerListenCommand::bindPort(uint16_t& port, SegList<int>& sgl)
socket_->bind(A2STR::NIL, port, family_);
socket_->beginListen();
socket_->setNonBlockingMode();
A2_LOG_NOTICE(fmt("IPv%d BitTorrent: listening to port %u", ipv, port));
A2_LOG_NOTICE(fmt(_("IPv%d BitTorrent: listening to port %u"),
ipv, port));
return true;
} catch(RecoverableException& ex) {
A2_LOG_ERROR_EX(fmt("IPv%d BitTorrent: failed to bind port %u",

View File

@ -378,8 +378,8 @@ void RequestGroup::createInitialCommand
e->addCommand(dhtCommands);
}
} else {
A2_LOG_NOTICE("For BitTorrent Magnet URI, enabling DHT is strongly"
" recommended. See --enable-dht option.");
A2_LOG_NOTICE(_("For BitTorrent Magnet URI, enabling DHT is strongly"
" recommended. See --enable-dht option."));
}
SharedHandle<CheckIntegrityEntry> entry
@ -683,8 +683,8 @@ void RequestGroup::adjustFilename
option_->getAsBool(PREF_REMOVE_CONTROL_FILE) &&
infoFile->exists()) {
infoFile->removeFile();
A2_LOG_NOTICE(fmt("Removed control file for %s because it is requested by"
" user.",
A2_LOG_NOTICE(fmt(_("Removed control file for %s because it is requested by"
" user."),
infoFile->getFilename().c_str()));
}
if(infoFile->exists()) {

View File

@ -339,7 +339,7 @@ public:
}
} else {
A2_LOG_NOTICE
(fmt("Download GID#%lld not complete: %s",
(fmt(_("Download GID#%lld not complete: %s"),
group->getGID(),
group->getDownloadContext()->getBasePath().c_str()));
group->saveControlFile();

View File

@ -72,9 +72,9 @@ void SingleFileAllocationIterator::init()
static bool noticeDone = false;
if(!noticeDone) {
noticeDone = true;
A2_LOG_NOTICE("Allocating disk space. Use --file-allocation=none to"
" disable it. See --file-allocation option in man page for"
" more details.");
A2_LOG_NOTICE(_("Allocating disk space. Use --file-allocation=none to"
" disable it. See --file-allocation option in man page for"
" more details."));
}
#ifdef HAVE_POSIX_MEMALIGN
buffer_ = reinterpret_cast<unsigned char*>

View File

@ -66,7 +66,6 @@ void TimedHaltCommand::process()
A2_LOG_NOTICE(fmt(MSG_TIME_HAS_PASSED,
static_cast<long int>(getInterval())));
if(forceHalt_) {
A2_LOG_NOTICE("This is emergency shutdown.");
getDownloadEngine()->requestForceHalt();
} else {
getDownloadEngine()->requestHalt();