aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--README.i18n45
-rw-r--r--README.md5
-rw-r--r--src/common/CMakeLists.txt6
-rw-r--r--src/common/i18n.h36
-rw-r--r--src/simplewallet/simplewallet.cpp509
-rw-r--r--src/simplewallet/simplewallet.h5
-rw-r--r--translations/monero.ts996
-rwxr-xr-xutils/translations/build-translations.sh16
-rwxr-xr-xutils/translations/update-translations.sh16
9 files changed, 1385 insertions, 249 deletions
diff --git a/README.i18n b/README.i18n
new file mode 100644
index 000000000..2b913f7d8
--- /dev/null
+++ b/README.i18n
@@ -0,0 +1,45 @@
+The Monero command line tools can be translated in various languages.
+In order to use the same translation workflow as the future GUI, they
+use Qt Linguist translation files. However, to avoid the dependencies
+on Qt this normally implies, they use a custom loader to read those
+files at runtime. In order to update, or build translations files, you
+do need to have Qt tools installed, however. For translating, you need
+either the Qt Linguist GUI, or another tool that supports Qt ts files,
+such as Transifex. To run, you do not need anything Qt.
+
+To update ts files after changing source code:
+
+ ./utils/translations/update-translations.sh
+
+To add a new language, eg Spanish (ISO code es):
+
+ cp transations/monero.ts transations/monero_es.ts
+
+To edit translations for Spanish:
+
+ linguist translations/monero_es.ts
+
+To build translations after modiying them:
+
+ ./utils/translations/build-translations.sh
+
+To test a translation:
+
+ LANG=es ./build/release/bin/simplewallet
+
+To add new translatable sources in the source:
+
+ Use the tr(string) function if possible. If the code is in a class,
+ and this class doesn't already have a tr() static function, add one,
+ which uses a context named after what lupdate uses for the context,
+ usually the fully qualified class name (eg, cryptonote::simple_wallet).
+ If you need to use tr in code that's not in a class, you can use the
+ fully qualified version (eg, simple_wallet::tr) of the one matching
+ the context you want.
+ Use QT_TRANSLATE_NOOP(string) if you want to specify a context manually.
+
+If you're getting messages of the form:
+
+ Class 'cryptonote::simple_wallet' lacks Q_OBJECT macro
+
+all is fine, we don't actually need that here.
diff --git a/README.md b/README.md
index 1945408bb..e2ba191da 100644
--- a/README.md
+++ b/README.md
@@ -167,3 +167,8 @@ Dependencies: Doxygen 1.8.0 or later, Graphviz 2.28 or later (optional).
* To build, change to the root of the source code directory, and run `doxygen Doxyfile`
* If you have installed Graphviz, you can also generate in-doc diagrams by instead running `HAVE_DOT=YES doxygen Doxyfile`
* The output will be built in doc/html/
+
+## Internationalization
+
+See README.i18n
+
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 620e1add9..b1db006d9 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -30,7 +30,8 @@ set(common_sources
base58.cpp
command_line.cpp
dns_utils.cpp
- util.cpp)
+ util.cpp
+ i18n.cpp)
set(common_headers)
@@ -46,7 +47,8 @@ set(common_private_headers
scoped_message_writer.h
unordered_containers_boost_serialization.h
util.h
- varint.h)
+ varint.h
+ i18n.h)
bitmonero_private_headers(common
${common_private_headers})
diff --git a/src/common/i18n.h b/src/common/i18n.h
new file mode 100644
index 000000000..2aeac2287
--- /dev/null
+++ b/src/common/i18n.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2014-2015, The Monero Project
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this list of
+// conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#pragma once
+
+#define QT_TRANSLATE_NOOP(context,str) i18n_translate(str,context)
+
+int i18n_set_language(const char *directory, const char *base);
+const char *i18n_translate(const char *str, const std::string &context);
+static inline std::string get_default_i18n_context() { return std::string(); }
+static inline const char *tr(const char *str) { return i18n_translate(str,get_default_i18n_context()); }
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index dee53c478..da5be17e3 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -40,7 +40,9 @@
#include <boost/lexical_cast.hpp>
#include <boost/program_options.hpp>
#include <boost/algorithm/string.hpp>
+#include <boost/format.hpp>
#include "include_base_utils.h"
+#include "common/i18n.h"
#include "common/command_line.h"
#include "common/util.h"
#include "p2p/net_node.h"
@@ -65,6 +67,7 @@ using namespace cryptonote;
using boost::lexical_cast;
namespace po = boost::program_options;
namespace bf = boost::filesystem;
+typedef cryptonote::simple_wallet sw;
#define EXTENDED_LOGS_FILE "wallet_details.log"
@@ -74,20 +77,20 @@ unsigned int epee::g_test_dbg_lock_sleep = 0;
namespace
{
- const command_line::arg_descriptor<std::string> arg_wallet_file = {"wallet-file", "Use wallet <arg>", ""};
- const command_line::arg_descriptor<std::string> arg_generate_new_wallet = {"generate-new-wallet", "Generate new wallet and save it to <arg> or <address>.wallet by default", ""};
- const command_line::arg_descriptor<std::string> arg_generate_from_view_key = {"generate-from-view-key", "Generate wallet from (address:viewkey:filename) and save it to <filename>", ""};
- const command_line::arg_descriptor<std::string> arg_daemon_address = {"daemon-address", "Use daemon instance at <host>:<port>", ""};
- const command_line::arg_descriptor<std::string> arg_daemon_host = {"daemon-host", "Use daemon instance at host <arg> instead of localhost", ""};
- const command_line::arg_descriptor<std::string> arg_password = {"password", "Wallet password", "", true};
- const command_line::arg_descriptor<std::string> arg_electrum_seed = {"electrum-seed", "Specify electrum seed for wallet recovery/creation", ""};
- const command_line::arg_descriptor<bool> arg_restore_deterministic_wallet = {"restore-deterministic-wallet", "Recover wallet using electrum-style mnemonic", false};
- const command_line::arg_descriptor<bool> arg_non_deterministic = {"non-deterministic", "creates non-deterministic view and spend keys", false};
- const command_line::arg_descriptor<int> arg_daemon_port = {"daemon-port", "Use daemon instance at port <arg> instead of 8081", 0};
+ const command_line::arg_descriptor<std::string> arg_wallet_file = {"wallet-file", sw::tr("Use wallet <arg>"), ""};
+ const command_line::arg_descriptor<std::string> arg_generate_new_wallet = {"generate-new-wallet", sw::tr("Generate new wallet and save it to <arg> or <address>.wallet by default"), ""};
+ const command_line::arg_descriptor<std::string> arg_generate_from_view_key = {"generate-from-view-key", sw::tr("Generate wallet from (address:viewkey:filename) and save it to <filename>"), ""};
+ const command_line::arg_descriptor<std::string> arg_daemon_address = {"daemon-address", sw::tr("Use daemon instance at <host>:<port>"), ""};
+ const command_line::arg_descriptor<std::string> arg_daemon_host = {"daemon-host", sw::tr("Use daemon instance at host <arg> instead of localhost"), ""};
+ const command_line::arg_descriptor<std::string> arg_password = {"password", sw::tr("Wallet password"), "", true};
+ const command_line::arg_descriptor<std::string> arg_electrum_seed = {"electrum-seed", sw::tr("Specify electrum seed for wallet recovery/creation"), ""};
+ const command_line::arg_descriptor<bool> arg_restore_deterministic_wallet = {"restore-deterministic-wallet", sw::tr("Recover wallet using electrum-style mnemonic"), false};
+ const command_line::arg_descriptor<bool> arg_non_deterministic = {"non-deterministic", sw::tr("creates non-deterministic view and spend keys"), false};
+ const command_line::arg_descriptor<int> arg_daemon_port = {"daemon-port", sw::tr("Use daemon instance at port <arg> instead of 8081"), 0};
const command_line::arg_descriptor<uint32_t> arg_log_level = {"log-level", "", LOG_LEVEL_0};
- const command_line::arg_descriptor<std::string> arg_log_file = {"log-file", "Specify log file", ""};
- const command_line::arg_descriptor<bool> arg_testnet = {"testnet", "Used to deploy test nets. The daemon must be launched with --testnet flag", false};
- const command_line::arg_descriptor<bool> arg_restricted = {"restricted-rpc", "Restricts RPC to view only commands", false};
+ const command_line::arg_descriptor<std::string> arg_log_file = {"log-file", sw::tr("Specify log file"), ""};
+ const command_line::arg_descriptor<bool> arg_testnet = {"testnet", sw::tr("Used to deploy test nets. The daemon must be launched with --testnet flag"), false};
+ const command_line::arg_descriptor<bool> arg_restricted = {"restricted-rpc", sw::tr("Restricts RPC to view only commands"), false};
const command_line::arg_descriptor< std::vector<std::string> > arg_command = {"command", ""};
@@ -98,7 +101,7 @@ namespace
{
if (status == CORE_RPC_STATUS_BUSY)
{
- err = "daemon is busy. Please try later";
+ err = sw::tr("daemon is busy. Please try later");
}
else if (status != CORE_RPC_STATUS_OK)
{
@@ -107,7 +110,7 @@ namespace
}
else
{
- err = "possible lost connection to daemon";
+ err = sw::tr("possible lost connection to daemon");
}
return err;
}
@@ -188,7 +191,7 @@ namespace
message_writer fail_msg_writer()
{
- return message_writer(epee::log_space::console_color_red, true, "Error: ", LOG_LEVEL_0);
+ return message_writer(epee::log_space::console_color_red, true, sw::tr("Error: "), LOG_LEVEL_0);
}
}
@@ -196,7 +199,7 @@ namespace
std::string simple_wallet::get_commands_str()
{
std::stringstream ss;
- ss << "Commands: " << ENDL;
+ ss << tr("Commands: ") << ENDL;
std::string usage = m_cmd_binder.get_usage();
boost::replace_all(usage, "\n", "\n ");
usage.insert(0, " ");
@@ -227,7 +230,7 @@ bool simple_wallet::seed(const std::vector<std::string> &args/* = std::vector<st
if (m_wallet->watch_only())
{
- fail_msg_writer() << "This wallet is watch-only and cannot have a seed.";
+ fail_msg_writer() << tr("This wallet is watch-only and cannot have a seed.");
return true;
}
if (m_wallet->is_deterministic())
@@ -247,7 +250,7 @@ bool simple_wallet::seed(const std::vector<std::string> &args/* = std::vector<st
}
else
{
- fail_msg_writer() << "The wallet is non-deterministic. Cannot display seed.";
+ fail_msg_writer() << tr("The wallet is non-deterministic. Cannot display seed.");
}
return true;
}
@@ -257,19 +260,19 @@ bool simple_wallet::seed_set_language(const std::vector<std::string> &args/* = s
bool success = false;
if (m_wallet->watch_only())
{
- fail_msg_writer() << "This wallet is watch-only and doesn't have a seed.";
+ fail_msg_writer() << tr("This wallet is watch-only and doesn't have a seed.");
return true;
}
if (!m_wallet->is_deterministic())
{
- fail_msg_writer() << "This wallet is non-deterministic and doesn't have a seed.";
+ fail_msg_writer() << tr("This wallet is non-deterministic and doesn't have a seed.");
return true;
}
tools::password_container pwd_container;
success = pwd_container.read_password();
if (!success)
{
- fail_msg_writer() << "failed to read wallet password";
+ fail_msg_writer() << tr("failed to read wallet password");
return true;
}
@@ -277,7 +280,7 @@ bool simple_wallet::seed_set_language(const std::vector<std::string> &args/* = s
success = m_wallet->verify_password(pwd_container.password());
if (!success)
{
- fail_msg_writer() << "invalid password";
+ fail_msg_writer() << tr("invalid password");
return true;
}
@@ -297,33 +300,33 @@ simple_wallet::simple_wallet()
: m_daemon_port(0)
, m_refresh_progress_reporter(*this)
{
- m_cmd_binder.set_handler("start_mining", boost::bind(&simple_wallet::start_mining, this, _1), "start_mining [<number_of_threads>] - Start mining in daemon");
- m_cmd_binder.set_handler("stop_mining", boost::bind(&simple_wallet::stop_mining, this, _1), "Stop mining in daemon");
- m_cmd_binder.set_handler("save_bc", boost::bind(&simple_wallet::save_bc, this, _1), "Save current blockchain data");
- m_cmd_binder.set_handler("refresh", boost::bind(&simple_wallet::refresh, this, _1), "Resynchronize transactions and balance");
- m_cmd_binder.set_handler("balance", boost::bind(&simple_wallet::show_balance, this, _1), "Show current wallet balance");
- m_cmd_binder.set_handler("incoming_transfers", boost::bind(&simple_wallet::show_incoming_transfers, this, _1), "incoming_transfers [available|unavailable] - Show incoming transfers - all of them or filter them by availability");
- m_cmd_binder.set_handler("payments", boost::bind(&simple_wallet::show_payments, this, _1), "payments <payment_id_1> [<payment_id_2> ... <payment_id_N>] - Show payments <payment_id_1>, ... <payment_id_N>");
- m_cmd_binder.set_handler("bc_height", boost::bind(&simple_wallet::show_blockchain_height, this, _1), "Show blockchain height");
- m_cmd_binder.set_handler("transfer", boost::bind(&simple_wallet::transfer, this, _1), "transfer [<mixin_count>] <addr_1> <amount_1> [<addr_2> <amount_2> ... <addr_N> <amount_N>] [payment_id] - Transfer <amount_1>,... <amount_N> to <address_1>,... <address_N>, respectively. <mixin_count> is the number of transactions yours is indistinguishable from (from 0 to maximum available)");
- m_cmd_binder.set_handler("sweep_dust", boost::bind(&simple_wallet::sweep_dust, this, _1), "Send all dust outputs to the same address with mixin 0");
- m_cmd_binder.set_handler("set_log", boost::bind(&simple_wallet::set_log, this, _1), "set_log <level> - Change current log detalization level, <level> is a number 0-4");
- m_cmd_binder.set_handler("address", boost::bind(&simple_wallet::print_address, this, _1), "Show current wallet public address");
- m_cmd_binder.set_handler("integrated_address", boost::bind(&simple_wallet::print_integrated_address, this, _1), "Convert a payment ID to an integrated address for the current wallet public address (no arguments use a random payment ID), or display standard addres and payment ID corresponding to an integrated addres");
- m_cmd_binder.set_handler("save", boost::bind(&simple_wallet::save, this, _1), "Save wallet synchronized data");
- m_cmd_binder.set_handler("save_watch_only", boost::bind(&simple_wallet::save_watch_only, this, _1), "Save watch only keys file");
- m_cmd_binder.set_handler("viewkey", boost::bind(&simple_wallet::viewkey, this, _1), "Get viewkey");
- m_cmd_binder.set_handler("spendkey", boost::bind(&simple_wallet::spendkey, this, _1), "Get spendkey");
- m_cmd_binder.set_handler("seed", boost::bind(&simple_wallet::seed, this, _1), "Get deterministic seed");
- m_cmd_binder.set_handler("set", boost::bind(&simple_wallet::set_variable, this, _1), "available options: seed language - Set wallet seed langage");
- m_cmd_binder.set_handler("help", boost::bind(&simple_wallet::help, this, _1), "Show this help");
+ m_cmd_binder.set_handler("start_mining", boost::bind(&simple_wallet::start_mining, this, _1), tr("start_mining [<number_of_threads>] - Start mining in daemon"));
+ m_cmd_binder.set_handler("stop_mining", boost::bind(&simple_wallet::stop_mining, this, _1), tr("Stop mining in daemon"));
+ m_cmd_binder.set_handler("save_bc", boost::bind(&simple_wallet::save_bc, this, _1), tr("Save current blockchain data"));
+ m_cmd_binder.set_handler("refresh", boost::bind(&simple_wallet::refresh, this, _1), tr("Resynchronize transactions and balance"));
+ m_cmd_binder.set_handler("balance", boost::bind(&simple_wallet::show_balance, this, _1), tr("Show current wallet balance"));
+ m_cmd_binder.set_handler("incoming_transfers", boost::bind(&simple_wallet::show_incoming_transfers, this, _1), tr("incoming_transfers [available|unavailable] - Show incoming transfers - all of them or filter them by availability"));
+ m_cmd_binder.set_handler("payments", boost::bind(&simple_wallet::show_payments, this, _1), tr("payments <payment_id_1> [<payment_id_2> ... <payment_id_N>] - Show payments <payment_id_1>, ... <payment_id_N>"));
+ m_cmd_binder.set_handler("bc_height", boost::bind(&simple_wallet::show_blockchain_height, this, _1), tr("Show blockchain height"));
+ m_cmd_binder.set_handler("transfer", boost::bind(&simple_wallet::transfer, this, _1), tr("transfer [<mixin_count>] <addr_1> <amount_1> [<addr_2> <amount_2> ... <addr_N> <amount_N>] [payment_id] - Transfer <amount_1>,... <amount_N> to <address_1>,... <address_N>, respectively. <mixin_count> is the number of transactions yours is indistinguishable from (from 0 to maximum available)"));
+ m_cmd_binder.set_handler("sweep_dust", boost::bind(&simple_wallet::sweep_dust, this, _1), tr("Send all dust outputs to the same address with mixin 0"));
+ m_cmd_binder.set_handler("set_log", boost::bind(&simple_wallet::set_log, this, _1), tr("set_log <level> - Change current log detalization level, <level> is a number 0-4"));
+ m_cmd_binder.set_handler("address", boost::bind(&simple_wallet::print_address, this, _1), tr("Show current wallet public address"));
+ m_cmd_binder.set_handler("integrated_address", boost::bind(&simple_wallet::print_integrated_address, this, _1), tr("Convert a payment ID to an integrated address for the current wallet public address (no arguments use a random payment ID), or display standard addres and payment ID corresponding to an integrated addres"));
+ m_cmd_binder.set_handler("save", boost::bind(&simple_wallet::save, this, _1), tr("Save wallet synchronized data"));
+ m_cmd_binder.set_handler("save_watch_only", boost::bind(&simple_wallet::save_watch_only, this, _1), tr("Save watch only keys file"));
+ m_cmd_binder.set_handler("viewkey", boost::bind(&simple_wallet::viewkey, this, _1), tr("Get viewkey"));
+ m_cmd_binder.set_handler("spendkey", boost::bind(&simple_wallet::spendkey, this, _1), tr("Get spendkey"));
+ m_cmd_binder.set_handler("seed", boost::bind(&simple_wallet::seed, this, _1), tr("Get deterministic seed"));
+ m_cmd_binder.set_handler("set", boost::bind(&simple_wallet::set_variable, this, _1), tr("available options: seed language - Set wallet seed langage"));
+ m_cmd_binder.set_handler("help", boost::bind(&simple_wallet::help, this, _1), tr("Show this help"));
}
//----------------------------------------------------------------------------------------------------
bool simple_wallet::set_variable(const std::vector<std::string> &args)
{
if (args.empty())
{
- fail_msg_writer() << "set: needs an argument. available options: seed";
+ fail_msg_writer() << tr("set: needs an argument. available options: seed");
return true;
}
else
@@ -332,7 +335,7 @@ bool simple_wallet::set_variable(const std::vector<std::string> &args)
{
if (args.size() == 1)
{
- fail_msg_writer() << "set seed: needs an argument. available options: language";
+ fail_msg_writer() << tr("set seed: needs an argument. available options: language");
return true;
}
else if (args[1] == "language")
@@ -344,7 +347,7 @@ bool simple_wallet::set_variable(const std::vector<std::string> &args)
}
}
}
- fail_msg_writer() << "set: unrecognized argument(s)";
+ fail_msg_writer() << tr("set: unrecognized argument(s)");
return true;
}
//----------------------------------------------------------------------------------------------------
@@ -352,18 +355,18 @@ bool simple_wallet::set_log(const std::vector<std::string> &args)
{
if(args.size() != 1)
{
- fail_msg_writer() << "use: set_log <log_level_number_0-4>";
+ fail_msg_writer() << tr("use: set_log <log_level_number_0-4>");
return true;
}
uint16_t l = 0;
if(!epee::string_tools::get_xtype_from_string(l, args[0]))
{
- fail_msg_writer() << "wrong number format, use: set_log <log_level_number_0-4>";
+ fail_msg_writer() << tr("wrong number format, use: set_log <log_level_number_0-4>");
return true;
}
if(LOG_LEVEL_4 < l)
{
- fail_msg_writer() << "wrong number range, use: set_log <log_level_number_0-4>";
+ fail_msg_writer() << tr("wrong number range, use: set_log <log_level_number_0-4>");
return true;
}
@@ -378,13 +381,13 @@ bool simple_wallet::ask_wallet_create_if_needed()
bool valid_path = false;
do {
wallet_path = command_line::input_line(
- "Specify wallet file name (e.g., wallet.bin). If the wallet doesn't exist, it will be created.\n"
- "Wallet file name: "
+ tr("Specify wallet file name (e.g., wallet.bin). If the wallet doesn't exist, it will be created.\n"
+ "Wallet file name: ")
);
valid_path = tools::wallet2::wallet_valid_path_format(wallet_path);
if (!valid_path)
{
- fail_msg_writer() << "wallet file path not valid: " << wallet_path;
+ fail_msg_writer() << tr("wallet file path not valid: ") << wallet_path;
}
}
while (!valid_path);
@@ -403,7 +406,7 @@ bool simple_wallet::ask_wallet_create_if_needed()
{
if (!m_generate_new.empty() || m_restore_deterministic_wallet || !m_generate_from_view_key.empty())
{
- fail_msg_writer() << "Attempting to generate or restore wallet, but specified file(s) exist. Exiting to not risk overwriting.";
+ fail_msg_writer() << tr("Attempting to generate or restore wallet, but specified file(s) exist. Exiting to not risk overwriting.");
return false;
}
}
@@ -417,12 +420,12 @@ bool simple_wallet::ask_wallet_create_if_needed()
{
if(!wallet_file_exists)
{
- std::cout << "The wallet doesn't exist, generating new one" << std::endl;
+ std::cout << tr("The wallet doesn't exist, generating new one") << std::endl;
m_generate_new = wallet_path;
r = true;
}else
{
- fail_msg_writer() << "failed to open wallet \"" << wallet_path << "\". Keys file wasn't found";
+ fail_msg_writer() << tr("Keys file wasn't found: failed to open wallet: ") << "\"" << wallet_path << "\".";
r = false;
}
}
@@ -436,9 +439,9 @@ bool simple_wallet::ask_wallet_create_if_needed()
*/
void simple_wallet::print_seed(std::string seed)
{
- success_msg_writer(true) << "\nPLEASE NOTE: the following 25 words can be used to recover access to your wallet. " <<
- "Please write them down and store them somewhere safe and secure. Please do not store them in " <<
- "your email or on file storage services outside of your immediate control.\n";
+ success_msg_writer(true) << "\n" << tr("PLEASE NOTE: the following 25 words can be used to recover access to your wallet. "
+ "Please write them down and store them somewhere safe and secure. Please do not store them in "
+ "your email or on file storage services outside of your immediate control.\n");
boost::replace_nth(seed, " ", 15, "\n");
boost::replace_nth(seed, " ", 7, "\n");
// don't log
@@ -452,13 +455,13 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
if (!m_daemon_address.empty() && !m_daemon_host.empty() && 0 != m_daemon_port)
{
- fail_msg_writer() << "you can't specify daemon host or port several times";
+ fail_msg_writer() << tr("you can't specify daemon host or port several times");
return false;
}
if((!m_generate_new.empty()) + (!m_wallet_file.empty()) + (!m_generate_from_view_key.empty()) > 1)
{
- fail_msg_writer() << "Specifying more than one of --generate-new-wallet=\"wallet_name\", --wallet-file=\"wallet_name\" and --generate-from-keys doesn't make sense!";
+ fail_msg_writer() << tr("Specifying more than one of --generate-new-wallet=\"wallet_name\", --wallet-file=\"wallet_name\" and --generate-from-keys doesn't make sense!");
return false;
}
else if (m_generate_new.empty() && m_wallet_file.empty() && m_generate_from_view_key.empty())
@@ -489,7 +492,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
bool r = pwd_container.read_password();
if (!r)
{
- fail_msg_writer() << "failed to read wallet password";
+ fail_msg_writer() << tr("failed to read wallet password");
return false;
}
}
@@ -504,7 +507,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
{
if (m_non_deterministic)
{
- fail_msg_writer() << "Cannot specify both --restore-deterministic-wallet and --non-deterministic";
+ fail_msg_writer() << tr("Cannot specify both --restore-deterministic-wallet and --non-deterministic");
return false;
}
@@ -513,14 +516,14 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
m_electrum_seed = command_line::input_line("Specify electrum seed: ");
if (m_electrum_seed.empty())
{
- fail_msg_writer() << "specify a recovery parameter with the --electrum-seed=\"words list here\"";
+ fail_msg_writer() << tr("specify a recovery parameter with the --electrum-seed=\"words list here\"");
return false;
}
}
if (!crypto::ElectrumWords::words_to_bytes(m_electrum_seed, m_recovery_key, old_language))
{
- fail_msg_writer() << "electrum-style word list failed verification";
+ fail_msg_writer() << tr("electrum-style word list failed verification");
return false;
}
}
@@ -531,7 +534,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
boost::split(parts,m_generate_from_view_key, boost::is_any_of(":"));
if (parts.size() < 3)
{
- fail_msg_writer() << "--generate-from-view-key needs a address:viewkey:filename triple";
+ fail_msg_writer() << tr("--generate-from-view-key needs a address:viewkey:filename triple");
return false;
}
@@ -541,7 +544,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
crypto::hash new_payment_id;
if(!get_account_integrated_address_from_str(address, has_payment_id, new_payment_id, testnet, parts[0]))
{
- fail_msg_writer() << "Failed to parse address";
+ fail_msg_writer() << tr("Failed to parse address");
return false;
}
@@ -549,7 +552,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
cryptonote::blobdata viewkey_data;
if(!epee::string_tools::parse_hexstr_to_binbuff(parts[1], viewkey_data))
{
- fail_msg_writer() << "Failed to parse view key secret key";
+ fail_msg_writer() << tr("Failed to parse view key secret key");
return false;
}
crypto::secret_key viewkey = *reinterpret_cast<const crypto::secret_key*>(viewkey_data.data());
@@ -603,9 +606,9 @@ bool simple_wallet::try_connect_to_daemon()
{
if (!m_wallet->check_connection())
{
- fail_msg_writer() << "wallet failed to connect to daemon (" << m_daemon_address << "). " <<
- "Daemon either is not started or passed wrong port. " <<
- "Please, make sure that daemon is running or restart the wallet with correct daemon address.";
+ fail_msg_writer() << tr("wallet failed to connect to daemon: ") << m_daemon_address << ". " <<
+ tr("Daemon either is not started or passed wrong port. "
+ "Please, make sure that daemon is running or restart the wallet with correct daemon address.");
return false;
}
return true;
@@ -624,7 +627,7 @@ std::string simple_wallet::get_mnemonic_language()
std::string language_choice;
int language_number = -1;
crypto::ElectrumWords::get_language_list(language_list);
- std::cout << "List of available languages for your wallet's seed:" << std::endl;
+ std::cout << tr("List of available languages for your wallet's seed:") << std::endl;
int ii;
std::vector<std::string>::iterator it;
for (it = language_list.begin(), ii = 0; it != language_list.end(); it++, ii++)
@@ -633,19 +636,19 @@ std::string simple_wallet::get_mnemonic_language()
}
while (language_number < 0)
{
- language_choice = command_line::input_line("Enter the number corresponding to the language of your choice: ");
+ language_choice = command_line::input_line(tr("Enter the number corresponding to the language of your choice: "));
try
{
language_number = std::stoi(language_choice);
if (!((language_number >= 0) && (static_cast<unsigned int>(language_number) < language_list.size())))
{
language_number = -1;
- fail_msg_writer() << "Invalid language choice passed. Please try again.\n";
+ fail_msg_writer() << tr("Invalid language choice passed. Please try again.\n");
}
}
catch (std::exception &e)
{
- fail_msg_writer() << "Invalid language choice passed. Please try again.\n";
+ fail_msg_writer() << tr("Invalid language choice passed. Please try again.\n");
}
}
return language_list[language_number];
@@ -668,8 +671,8 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
if (was_deprecated_wallet)
{
// The user had used an older version of the wallet with old style mnemonics.
- message_writer(epee::log_space::console_color_green, false) << "\nYou had been using " <<
- "a deprecated version of the wallet. Please use the new seed that we provide.\n";
+ message_writer(epee::log_space::console_color_green, false) << "\n" << tr("You had been using "
+ "a deprecated version of the wallet. Please use the new seed that we provide.\n");
}
mnemonic_language = get_mnemonic_language();
}
@@ -684,13 +687,13 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
try
{
recovery_val = m_wallet->generate(wallet_file, password, recovery_key, recover, two_random);
- message_writer(epee::log_space::console_color_white, true) << "Generated new wallet: "
+ message_writer(epee::log_space::console_color_white, true) << tr("Generated new wallet: ")
<< m_wallet->get_account().get_public_address_str(m_wallet->testnet());
- std::cout << "view key: " << string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key) << ENDL;
+ std::cout << tr("view key: ") << string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key) << ENDL;
}
catch (const std::exception& e)
{
- fail_msg_writer() << "failed to generate new wallet: " << e.what();
+ fail_msg_writer() << tr("failed to generate new wallet: ") << e.what();
return false;
}
@@ -703,12 +706,12 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
success_msg_writer() <<
"**********************************************************************\n" <<
- "Your wallet has been generated.\n" <<
- "To start synchronizing with the daemon use \"refresh\" command.\n" <<
- "Use \"help\" command to see the list of available commands.\n" <<
- "Always use \"exit\" command when closing simplewallet to save\n" <<
- "current session's state. Otherwise, you will possibly need to synchronize \n" <<
- "your wallet again. Your wallet key is NOT under risk anyway.\n"
+ tr("Your wallet has been generated.\n"
+ "To start synchronizing with the daemon use \"refresh\" command.\n"
+ "Use \"help\" command to see the list of available commands.\n"
+ "Always use \"exit\" command when closing simplewallet to save\n"
+ "current session's state. Otherwise, you will possibly need to synchronize \n"
+ "your wallet again. Your wallet key is NOT under risk anyway.\n")
;
if (!two_random)
@@ -731,13 +734,13 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
try
{
m_wallet->generate(wallet_file, password, address, viewkey);
- message_writer(epee::log_space::console_color_white, true) << "Generated new watch-only wallet: "
+ message_writer(epee::log_space::console_color_white, true) << tr("Generated new watch-only wallet: ")
<< m_wallet->get_account().get_public_address_str(m_wallet->testnet());
- std::cout << "view key: " << string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key) << ENDL;
+ std::cout << tr("view key: ") << string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key) << ENDL;
}
catch (const std::exception& e)
{
- fail_msg_writer() << "failed to generate new wallet: " << e.what();
+ fail_msg_writer() << tr("failed to generate new wallet: ") << e.what();
return false;
}
@@ -750,7 +753,7 @@ bool simple_wallet::open_wallet(const string &wallet_file, const std::string& pa
{
if (!tools::wallet2::wallet_valid_path_format(wallet_file))
{
- fail_msg_writer() << "wallet file path not valid: " << wallet_file;
+ fail_msg_writer() << tr("wallet file path not valid: ") << wallet_file;
return false;
}
@@ -761,8 +764,8 @@ bool simple_wallet::open_wallet(const string &wallet_file, const std::string& pa
try
{
m_wallet->load(m_wallet_file, password);
- std::string wallet_type = m_wallet->watch_only() ? "watch-only wallet" : "wallet";
- message_writer(epee::log_space::console_color_white, true) << "Opened " << wallet_type << ": "
+ message_writer(epee::log_space::console_color_white, true) <<
+ (m_wallet->watch_only() ? tr("Opened watch-only wallet") : tr("Opened wallet")) << ": "
<< m_wallet->get_account().get_public_address_str(m_wallet->testnet());
// If the wallet file is deprecated, we should ask for mnemonic language again and store
// everything in the new format.
@@ -771,8 +774,8 @@ bool simple_wallet::open_wallet(const string &wallet_file, const std::string& pa
{
if (m_wallet->is_deterministic())
{
- message_writer(epee::log_space::console_color_green, false) << "\nYou had been using " <<
- "a deprecated version of the wallet. Please proceed to upgrade your wallet.\n";
+ message_writer(epee::log_space::console_color_green, false) << "\n" << tr("You had been using "
+ "a deprecated version of the wallet. Please proceed to upgrade your wallet.\n");
std::string mnemonic_language = get_mnemonic_language();
m_wallet->set_seed_language(mnemonic_language);
m_wallet->rewrite(m_wallet_file, password);
@@ -784,15 +787,15 @@ bool simple_wallet::open_wallet(const string &wallet_file, const std::string& pa
}
else
{
- message_writer(epee::log_space::console_color_green, false) << "\nYou had been using " <<
- "a deprecated version of the wallet. Your wallet file format is being upgraded now.\n";
+ message_writer(epee::log_space::console_color_green, false) << "\n" << tr("You had been using "
+ "a deprecated version of the wallet. Your wallet file format is being upgraded now.\n");
m_wallet->rewrite(m_wallet_file, password);
}
}
}
catch (const std::exception& e)
{
- fail_msg_writer() << "failed to load wallet: " << e.what();
+ fail_msg_writer() << tr("failed to load wallet: ") << e.what();
return false;
}
@@ -801,7 +804,7 @@ bool simple_wallet::open_wallet(const string &wallet_file, const std::string& pa
refresh(std::vector<std::string>());
success_msg_writer() <<
"**********************************************************************\n" <<
- "Use \"help\" command to see the list of available commands.\n" <<
+ tr("Use \"help\" command to see the list of available commands.\n") <<
"**********************************************************************";
return true;
}
@@ -811,7 +814,7 @@ bool simple_wallet::close_wallet()
bool r = m_wallet->deinit();
if (!r)
{
- fail_msg_writer() << "failed to deinit wallet";
+ fail_msg_writer() << tr("failed to deinit wallet");
return false;
}
@@ -833,7 +836,7 @@ bool simple_wallet::save(const std::vector<std::string> &args)
try
{
m_wallet->store();
- success_msg_writer() << "Wallet data saved";
+ success_msg_writer() << tr("Wallet data saved");
}
catch (const std::exception& e)
{
@@ -848,22 +851,22 @@ bool simple_wallet::save_watch_only(const std::vector<std::string> &args/* = std
bool success = false;
tools::password_container pwd_container;
- success = pwd_container.read_password("Password for the new watch-only wallet");
+ success = pwd_container.read_password(tr("Password for the new watch-only wallet"));
if (!success)
{
- fail_msg_writer() << "failed to read wallet password";
+ fail_msg_writer() << tr("failed to read wallet password");
return true;
}
std::string password = pwd_container.password();
- success = pwd_container.read_password("Enter new password again");
+ success = pwd_container.read_password(tr("Enter new password again"));
if (!success)
{
- fail_msg_writer() << "failed to read wallet password";
+ fail_msg_writer() << tr("failed to read wallet password");
return true;
}
if (password != pwd_container.password())
{
- fail_msg_writer() << "passwords do not match";
+ fail_msg_writer() << tr("passwords do not match");
return true;
}
@@ -900,8 +903,8 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args)
if (!ok)
{
- fail_msg_writer() << "invalid arguments. Please use start_mining [<number_of_threads>], " <<
- "<number_of_threads> should be from 1 to " << max_mining_threads_count;
+ fail_msg_writer() << tr("invalid arguments. Please use start_mining [<number_of_threads>], "
+ "<number_of_threads> should be from 1 to ") << max_mining_threads_count;
return true;
}
@@ -909,9 +912,9 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args)
bool r = net_utils::invoke_http_json_remote_command2(m_daemon_address + "/start_mining", req, res, m_http_client);
std::string err = interpret_rpc_response(r, res.status);
if (err.empty())
- success_msg_writer() << "Mining started in daemon";
+ success_msg_writer() << tr("Mining started in daemon");
else
- fail_msg_writer() << "mining has NOT been started: " << err;
+ fail_msg_writer() << tr("mining has NOT been started: ") << err;
return true;
}
//----------------------------------------------------------------------------------------------------
@@ -925,9 +928,9 @@ bool simple_wallet::stop_mining(const std::vector<std::string>& args)
bool r = net_utils::invoke_http_json_remote_command2(m_daemon_address + "/stop_mining", req, res, m_http_client);
std::string err = interpret_rpc_response(r, res.status);
if (err.empty())
- success_msg_writer() << "Mining stopped in daemon";
+ success_msg_writer() << tr("Mining stopped in daemon");
else
- fail_msg_writer() << "mining has NOT been stopped: " << err;
+ fail_msg_writer() << tr("mining has NOT been stopped: ") << err;
return true;
}
//----------------------------------------------------------------------------------------------------
@@ -941,9 +944,9 @@ bool simple_wallet::save_bc(const std::vector<std::string>& args)
bool r = net_utils::invoke_http_json_remote_command2(m_daemon_address + "/save_bc", req, res, m_http_client);
std::string err = interpret_rpc_response(r, res.status);
if (err.empty())
- success_msg_writer() << "Blockchain saved";
+ success_msg_writer() << tr("Blockchain saved");
else
- fail_msg_writer() << "Blockchain can't be saved: " << err;
+ fail_msg_writer() << tr("Blockchain can't be saved: ") << err;
return true;
}
//----------------------------------------------------------------------------------------------------
@@ -955,27 +958,27 @@ void simple_wallet::on_new_block(uint64_t height, const cryptonote::block& block
void simple_wallet::on_money_received(uint64_t height, const cryptonote::transaction& tx, size_t out_index)
{
message_writer(epee::log_space::console_color_green, false) <<
- "Height " << height <<
- ", transaction " << get_transaction_hash(tx) <<
- ", received " << print_money(tx.vout[out_index].amount);
+ tr("Height ") << height << ", " <<
+ tr("transaction ") << get_transaction_hash(tx) << ", " <<
+ tr("received ") << print_money(tx.vout[out_index].amount);
m_refresh_progress_reporter.update(height, true);
}
//----------------------------------------------------------------------------------------------------
void simple_wallet::on_money_spent(uint64_t height, const cryptonote::transaction& in_tx, size_t out_index, const cryptonote::transaction& spend_tx)
{
message_writer(epee::log_space::console_color_magenta, false) <<
- "Height " << height <<
- ", transaction " << get_transaction_hash(spend_tx) <<
- ", spent " << print_money(in_tx.vout[out_index].amount);
+ tr("Height ") << height << ", " <<
+ tr("transaction ") << get_transaction_hash(spend_tx) << ", " <<
+ tr("spent ") << print_money(in_tx.vout[out_index].amount);
m_refresh_progress_reporter.update(height, true);
}
//----------------------------------------------------------------------------------------------------
void simple_wallet::on_skip_transaction(uint64_t height, const cryptonote::transaction& tx)
{
message_writer(epee::log_space::console_color_red, true) <<
- "Height " << height <<
- ", transaction " << get_transaction_hash(tx) <<
- ", unsupported transaction format";
+ tr("Height ") << height << ", " <<
+ tr("transaction ") << get_transaction_hash(tx) << ", " <<
+ tr("unsupported transaction format");
m_refresh_progress_reporter.update(height, true);
}
//----------------------------------------------------------------------------------------------------
@@ -984,7 +987,7 @@ bool simple_wallet::refresh(const std::vector<std::string>& args)
if (!try_connect_to_daemon())
return true;
- message_writer() << "Starting refresh...";
+ message_writer() << tr("Starting refresh...");
size_t fetched_blocks = 0;
size_t start_height = 0;
@@ -1007,46 +1010,46 @@ bool simple_wallet::refresh(const std::vector<std::string>& args)
ok = true;
// Clear line "Height xxx of xxx"
std::cout << "\r \r";
- success_msg_writer(true) << "Refresh done, blocks received: " << fetched_blocks;
+ success_msg_writer(true) << tr("Refresh done, blocks received: ") << fetched_blocks;
show_balance();
}
catch (const tools::error::daemon_busy&)
{
- ss << "daemon is busy. Please try later";
+ ss << tr("daemon is busy. Please try later");
}
catch (const tools::error::no_connection_to_daemon&)
{
- ss << "no connection to daemon. Please, make sure daemon is running";
+ ss << tr("no connection to daemon. Please, make sure daemon is running");
}
catch (const tools::error::wallet_rpc_error& e)
{
LOG_ERROR("Unknown RPC error: " << e.to_string());
- ss << "RPC error \"" << e.what() << '"';
+ ss << tr("RPC error: ") << e.what();
}
catch (const tools::error::refresh_error& e)
{
LOG_ERROR("refresh error: " << e.to_string());
- ss << e.what();
+ ss << tr("Error refreshing: ") << e.what();
}
catch (const tools::error::wallet_internal_error& e)
{
LOG_ERROR("internal error: " << e.to_string());
- ss << "internal error: " << e.what();
+ ss << tr("internal error: ") << e.what();
}
catch (const std::exception& e)
{
LOG_ERROR("unexpected error: " << e.what());
- ss << "unexpected error: " << e.what();
+ ss << tr("unexpected error: ") << e.what();
}
catch (...)
{
LOG_ERROR("Unknown error");
- ss << "unknown error";
+ ss << tr("unknown error");
}
if (!ok)
{
- fail_msg_writer() << "refresh failed: " << ss.str() << ". Blocks received: " << fetched_blocks;
+ fail_msg_writer() << tr("refresh failed: ") << ss.str() << ". " << tr("Blocks received: ") << fetched_blocks;
}
return true;
@@ -1054,8 +1057,9 @@ bool simple_wallet::refresh(const std::vector<std::string>& args)
//----------------------------------------------------------------------------------------------------
bool simple_wallet::show_balance(const std::vector<std::string>& args/* = std::vector<std::string>()*/)
{
- success_msg_writer() << "balance: " << print_money(m_wallet->balance()) << ", unlocked balance: " << print_money(m_wallet->unlocked_balance())
- << ", including unlocked dust: " << print_money(m_wallet->unlocked_dust_balance(tools::tx_dust_policy(::config::DEFAULT_DUST_THRESHOLD)));
+ success_msg_writer() << tr("balance: ") << print_money(m_wallet->balance()) << ", "
+ << tr("unlocked balance: ") << print_money(m_wallet->unlocked_balance()) << ", "
+ << tr("including unlocked dust: ") << print_money(m_wallet->unlocked_dust_balance(tools::tx_dust_policy(::config::DEFAULT_DUST_THRESHOLD)));
return true;
}
//----------------------------------------------------------------------------------------------------
@@ -1087,14 +1091,15 @@ bool simple_wallet::show_incoming_transfers(const std::vector<std::string>& args
{
if (!transfers_found)
{
- message_writer() << " amount \tspent\tglobal index\t tx id";
+ message_writer() << boost::format("%21s%8s%16s%68s") % tr("amount") % tr("spent") % tr("global index") % tr("tx id");
transfers_found = true;
}
message_writer(td.m_spent ? epee::log_space::console_color_magenta : epee::log_space::console_color_green, false) <<
- std::setw(21) << print_money(td.amount()) << '\t' <<
- std::setw(3) << (td.m_spent ? 'T' : 'F') << " \t" <<
- std::setw(12) << td.m_global_output_index << '\t' <<
- get_transaction_hash(td.m_tx);
+ boost::format("%21s%8s%16u%68s") %
+ print_money(td.amount()) %
+ (td.m_spent ? "T" : "F") %
+ td.m_global_output_index %
+ get_transaction_hash (td.m_tx);
}
}
@@ -1102,15 +1107,15 @@ bool simple_wallet::show_incoming_transfers(const std::vector<std::string>& args
{
if (!filter)
{
- success_msg_writer() << "No incoming transfers";
+ success_msg_writer() << tr("No incoming transfers");
}
else if (available)
{
- success_msg_writer() << "No incoming available transfers";
+ success_msg_writer() << tr("No incoming available transfers");
}
else
{
- success_msg_writer() << "No incoming unavailable transfers";
+ success_msg_writer() << tr("No incoming unavailable transfers");
}
}
@@ -1121,13 +1126,12 @@ bool simple_wallet::show_payments(const std::vector<std::string> &args)
{
if(args.empty())
{
- fail_msg_writer() << "expected at least one payment_id";
+ fail_msg_writer() << tr("expected at least one payment_id");
return true;
}
- message_writer() << " payment \t" <<
- " transaction \t" <<
- " height\t amount \tunlock time";
+ message_writer() << boost::format("%68s%68s%12s%21s%16s") %
+ tr("payment") % tr("transaction") % tr("height") % tr("amount") % tr("unlock time");
bool payments_found = false;
for(std::string arg : args)
@@ -1139,7 +1143,7 @@ bool simple_wallet::show_payments(const std::vector<std::string> &args)
m_wallet->get_payments(payment_id, payments);
if(payments.empty())
{
- success_msg_writer() << "No payments with id " << payment_id;
+ success_msg_writer() << tr("No payments with id ") << payment_id;
continue;
}
@@ -1150,16 +1154,17 @@ bool simple_wallet::show_payments(const std::vector<std::string> &args)
payments_found = true;
}
success_msg_writer(true) <<
- payment_id << '\t' <<
- pd.m_tx_hash << '\t' <<
- std::setw(8) << pd.m_block_height << '\t' <<
- std::setw(21) << print_money(pd.m_amount) << '\t' <<
+ boost::format("%68s%68s%12s%21s%16s") %
+ payment_id %
+ pd.m_tx_hash %
+ pd.m_block_height %
+ print_money(pd.m_amount) %
pd.m_unlock_time;
}
}
else
{
- fail_msg_writer() << "payment id has invalid format: \"" << arg << "\", expected 64-character string";
+ fail_msg_writer() << tr("payment id has invalid format, expected 64-character string: ") << arg;
}
}
@@ -1185,7 +1190,7 @@ bool simple_wallet::show_blockchain_height(const std::vector<std::string>& args)
if (err.empty())
success_msg_writer() << bc_height;
else
- fail_msg_writer() << "failed to get blockchain height: " << err;
+ fail_msg_writer() << tr("failed to get blockchain height: ") << err;
return true;
}
@@ -1211,13 +1216,13 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_)
if(local_args.size() < 2)
{
- fail_msg_writer() << "wrong number of arguments";
+ fail_msg_writer() << tr("wrong number of arguments");
return true;
}
if(m_wallet->watch_only())
{
- fail_msg_writer() << "This is a watch only wallet";
+ fail_msg_writer() << tr("This is a watch only wallet");
return true;
}
@@ -1239,7 +1244,7 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_)
if(!r)
{
- fail_msg_writer() << "payment id has invalid format: \"" << payment_id_str << "\", expected 64-character string";
+ fail_msg_writer() << tr("payment id has invalid format, expected 64-character string: ") << payment_id_str;
return true;
}
payment_id_seen = true;
@@ -1272,48 +1277,49 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_)
std::string dnssec_str;
if (dnssec_ok)
{
- dnssec_str = "DNSSEC validation passed";
+ dnssec_str = tr("DNSSEC validation passed");
}
else
{
- dnssec_str = "WARNING: DNSSEC validation was unsuccessful, this address may not be correct!";
+ dnssec_str = tr("WARNING: DNSSEC validation was unsuccessful, this address may not be correct!");
}
std::stringstream prompt;
- prompt << "For URL: " << url
+ prompt << tr("For URL: ") << url
<< ", " << dnssec_str << std::endl
- << " Monero Address = " << addresses_from_dns[0]
+ << tr(" Monero Address = ") << addresses_from_dns[0]
<< std::endl
- << "Is this OK? (Y/n) "
+ << tr("Is this OK? (Y/n) ")
;
// prompt the user for confirmation given the dns query and dnssec status
std::string confirm_dns_ok = command_line::input_line(prompt.str());
- if (confirm_dns_ok != "Y" && confirm_dns_ok != "y" && confirm_dns_ok != "Yes" && confirm_dns_ok != "yes")
+ if (confirm_dns_ok != "Y" && confirm_dns_ok != "y" && confirm_dns_ok != "Yes" && confirm_dns_ok != "yes"
+ && confirm_dns_ok != tr("yes") && confirm_dns_ok != tr("no"))
{
- fail_msg_writer() << "You have cancelled the transfer request";
+ fail_msg_writer() << tr("You have cancelled the transfer request");
return true;
}
}
else
{
- fail_msg_writer() << "Failed to get a Monero address from: " << local_args[i];
+ fail_msg_writer() << tr("Failed to get a Monero address from: ") << local_args[i];
return true;
}
}
else if (addresses_from_dns.size() > 1)
{
- fail_msg_writer() << "Multiple Monero addresses found for given URL: " << url << ", this is not yet supported.";
+ fail_msg_writer() << tr("Not yet supported: Multiple Monero addresses found for given URL: ") << url;
}
else
{
- fail_msg_writer() << "Wrong address: " << local_args[i];
+ fail_msg_writer() << tr("Wrong address: ") << local_args[i];
return true;
}
}
if (has_payment_id) {
if (payment_id_seen && payment_id != new_payment_id) {
- fail_msg_writer() << "A single transaction cannot use more than one payment id: " << local_args[i];
+ fail_msg_writer() << tr("A single transaction cannot use more than one payment id: ") << local_args[i];
return true;
}
@@ -1324,7 +1330,7 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_)
bool r = add_extra_nonce_to_tx_extra(extra, extra_nonce);
if(!r)
{
- fail_msg_writer() << "Failed to set up payment id, though it was decoded correctly";
+ fail_msg_writer() << tr("Failed to set up payment id, though it was decoded correctly");
return true;
}
payment_id = new_payment_id;
@@ -1334,8 +1340,8 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_)
bool ok = cryptonote::parse_amount(de.amount, local_args[i + 1]);
if(!ok || 0 == de.amount)
{
- fail_msg_writer() << "amount is wrong: " << local_args[i] << ' ' << local_args[i + 1] <<
- ", expected number from 0 to " << print_money(std::numeric_limits<uint64_t>::max());
+ fail_msg_writer() << tr("amount is wrong: ") << local_args[i] << ' ' << local_args[i + 1] <<
+ ", " << tr("expected number from 0 to ") << print_money(std::numeric_limits<uint64_t>::max());
return true;
}
@@ -1350,14 +1356,13 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_)
// if more than one tx necessary, prompt user to confirm
if (ptx_vector.size() > 1)
{
- std::string prompt_str = "Your transaction needs to be split into ";
- prompt_str += std::to_string(ptx_vector.size());
- prompt_str += " transactions. This will result in a transaction fee being applied to each transaction";
- prompt_str += ". Is this okay? (Y/Yes/N/No)";
+ std::string prompt_str = (boost::format(tr("Your transaction needs to be split into %zu transactions. "
+ "This will result in a transaction fee being applied to each transaction. Is this okay? (Y/Yes/N/No)")) %
+ ptx_vector.size()).str();
std::string accepted = command_line::input_line(prompt_str);
if (accepted != "Y" && accepted != "y" && accepted != "Yes" && accepted != "yes")
{
- fail_msg_writer() << "Transaction cancelled.";
+ fail_msg_writer() << tr("Transaction cancelled.");
// would like to return false, because no tx made, but everything else returns true
// and I don't know what returning false might adversely affect. *sigh*
@@ -1370,7 +1375,7 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_)
{
auto & ptx = ptx_vector.back();
m_wallet->commit_tx(ptx);
- success_msg_writer(true) << "Money successfully sent, transaction " << get_transaction_hash(ptx.tx);
+ success_msg_writer(true) << tr("Money successfully sent, transaction ") << get_transaction_hash(ptx.tx);
// if no exception, remove element from vector
ptx_vector.pop_back();
@@ -1378,43 +1383,45 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_)
}
catch (const tools::error::daemon_busy&)
{
- fail_msg_writer() << "daemon is busy. Please try later";
+ fail_msg_writer() << tr("daemon is busy. Please try later");
}
catch (const tools::error::no_connection_to_daemon&)
{
- fail_msg_writer() << "no connection to daemon. Please, make sure daemon is running.";
+ fail_msg_writer() << tr("no connection to daemon. Please, make sure daemon is running.");
}
catch (const tools::error::wallet_rpc_error& e)
{
LOG_ERROR("Unknown RPC error: " << e.to_string());
- fail_msg_writer() << "RPC error \"" << e.what() << '"';
+ fail_msg_writer() << tr("RPC error: ") << e.what();
}
catch (const tools::error::get_random_outs_error&)
{
- fail_msg_writer() << "failed to get random outputs to mix";
+ fail_msg_writer() << tr("failed to get random outputs to mix");
}
catch (const tools::error::not_enough_money& e)
{
- fail_msg_writer() << "not enough money to transfer, available only " << print_money(e.available()) <<
- ", transaction amount " << print_money(e.tx_amount() + e.fee()) << " = " << print_money(e.tx_amount()) <<
- " + " << print_money(e.fee()) << " (fee)";
+ fail_msg_writer() << boost::format(tr("not enough money to transfer, available only %s, transaction amount %s = %s + %s (fee)")) %
+ print_money(e.available()) %
+ print_money(e.tx_amount() + e.fee()) %
+ print_money(e.tx_amount()) %
+ print_money(e.fee());
}
catch (const tools::error::not_enough_outs_to_mix& e)
{
auto writer = fail_msg_writer();
- writer << "not enough outputs for specified mixin_count = " << e.mixin_count() << ":";
+ writer << tr("not enough outputs for specified mixin_count") << " = " << e.mixin_count() << ":";
for (const cryptonote::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::outs_for_amount& outs_for_amount : e.scanty_outs())
{
- writer << "\noutput amount = " << print_money(outs_for_amount.amount) << ", fount outputs to mix = " << outs_for_amount.outs.size();
+ writer << "\n" << tr("output amount") << " = " << print_money(outs_for_amount.amount) << ", " << tr("found outputs to mix") << " = " << outs_for_amount.outs.size();
}
}
catch (const tools::error::tx_not_constructed&)
{
- fail_msg_writer() << "transaction was not constructed";
+ fail_msg_writer() << tr("transaction was not constructed");
}
catch (const tools::error::tx_rejected& e)
{
- fail_msg_writer() << "transaction " << get_transaction_hash(e.tx()) << " was rejected by daemon with status \"" << e.status() << '"';
+ fail_msg_writer() << (boost::format(tr("transaction %s was rejected by daemon with status: ")) % get_transaction_hash(e.tx())) << e.status();
}
catch (const tools::error::tx_sum_overflow& e)
{
@@ -1422,31 +1429,31 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_)
}
catch (const tools::error::zero_destination&)
{
- fail_msg_writer() << "one of destinations is zero";
+ fail_msg_writer() << tr("one of destinations is zero");
}
catch (const tools::error::tx_too_big& e)
{
- fail_msg_writer() << "Failed to find a suitable way to split transactions";
+ fail_msg_writer() << tr("Failed to find a suitable way to split transactions");
}
catch (const tools::error::transfer_error& e)
{
LOG_ERROR("unknown transfer error: " << e.to_string());
- fail_msg_writer() << "unknown transfer error: " << e.what();
+ fail_msg_writer() << tr("unknown transfer error: ") << e.what();
}
catch (const tools::error::wallet_internal_error& e)
{
LOG_ERROR("internal error: " << e.to_string());
- fail_msg_writer() << "internal error: " << e.what();
+ fail_msg_writer() << tr("internal error: ") << e.what();
}
catch (const std::exception& e)
{
LOG_ERROR("unexpected error: " << e.what());
- fail_msg_writer() << "unexpected error: " << e.what();
+ fail_msg_writer() << tr("unexpected error: ") << e.what();
}
catch (...)
{
LOG_ERROR("Unknown error");
- fail_msg_writer() << "unknown error";
+ fail_msg_writer() << tr("unknown error");
}
return true;
@@ -1460,7 +1467,7 @@ bool simple_wallet::sweep_dust(const std::vector<std::string> &args_)
if(m_wallet->watch_only())
{
- fail_msg_writer() << "This is a watch only wallet";
+ fail_msg_writer() << tr("This is a watch only wallet");
return true;
}
@@ -1478,18 +1485,22 @@ bool simple_wallet::sweep_dust(const std::vector<std::string> &args_)
total_fee += ptx_vector[n].fee;
}
- std::string prompt_str = "Sweeping " + print_money(total_dust);
+ std::string prompt_str = tr("Sweeping ") + print_money(total_dust);
if (ptx_vector.size() > 1) {
- prompt_str += " in ";
- prompt_str += std::to_string(ptx_vector.size());
- prompt_str += " transactions";
+ prompt_str = (boost::format(tr("Sweeping %s in %zu transactions for a total fee of %s. Is this okay? (Y/Yes/N/No)")) %
+ print_money(total_dust) %
+ ptx_vector.size() %
+ print_money(total_fee)).str();
+ }
+ else {
+ prompt_str = (boost::format(tr("Sweeping %s for a total fee of %s. Is this okay? (Y/Yes/N/No)")) %
+ print_money(total_dust) %
+ print_money(total_fee)).str();
}
- prompt_str += " for a total fee of " + print_money(total_fee);
- prompt_str += ". Is this okay? (Y/Yes/N/No)";
std::string accepted = command_line::input_line(prompt_str);
if (accepted != "Y" && accepted != "y" && accepted != "Yes" && accepted != "yes")
{
- fail_msg_writer() << "Transaction cancelled.";
+ fail_msg_writer() << tr("Transaction cancelled.");
// would like to return false, because no tx made, but everything else returns true
// and I don't know what returning false might adversely affect. *sigh*
@@ -1501,7 +1512,7 @@ bool simple_wallet::sweep_dust(const std::vector<std::string> &args_)
{
auto & ptx = ptx_vector.back();
m_wallet->commit_tx(ptx);
- success_msg_writer(true) << "Money successfully sent, transaction " << get_transaction_hash(ptx.tx);
+ success_msg_writer(true) << tr("Money successfully sent, transaction: ") << get_transaction_hash(ptx.tx);
// if no exception, remove element from vector
ptx_vector.pop_back();
@@ -1509,43 +1520,45 @@ bool simple_wallet::sweep_dust(const std::vector<std::string> &args_)
}
catch (const tools::error::daemon_busy&)
{
- fail_msg_writer() << "daemon is busy. Please try later";
+ fail_msg_writer() << tr("daemon is busy. Please try later");
}
catch (const tools::error::no_connection_to_daemon&)
{
- fail_msg_writer() << "no connection to daemon. Please, make sure daemon is running.";
+ fail_msg_writer() << tr("no connection to daemon. Please, make sure daemon is running.");
}
catch (const tools::error::wallet_rpc_error& e)
{
LOG_ERROR("Unknown RPC error: " << e.to_string());
- fail_msg_writer() << "RPC error \"" << e.what() << '"';
+ fail_msg_writer() << tr("RPC error: ") << e.what();
}
catch (const tools::error::get_random_outs_error&)
{
- fail_msg_writer() << "failed to get random outputs to mix";
+ fail_msg_writer() << tr("failed to get random outputs to mix");
}
catch (const tools::error::not_enough_money& e)
{
- fail_msg_writer() << "not enough money to transfer, available only " << print_money(e.available()) <<
- ", transaction amount " << print_money(e.tx_amount() + e.fee()) << " = " << print_money(e.tx_amount()) <<
- " + " << print_money(e.fee()) << " (fee)";
+ fail_msg_writer() << boost::format(tr("not enough money to transfer, available only %s, transaction amount %s = %s + %s (fee)")) %
+ print_money(e.available()) %
+ print_money(e.tx_amount() + e.fee()) %
+ print_money(e.tx_amount()) %
+ print_money(e.fee());
}
catch (const tools::error::not_enough_outs_to_mix& e)
{
auto writer = fail_msg_writer();
- writer << "not enough outputs for specified mixin_count = " << e.mixin_count() << ":";
+ writer << tr("not enough outputs for specified mixin_count") << " = " << e.mixin_count() << ":";
for (const cryptonote::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::outs_for_amount& outs_for_amount : e.scanty_outs())
{
- writer << "\noutput amount = " << print_money(outs_for_amount.amount) << ", fount outputs to mix = " << outs_for_amount.outs.size();
+ writer << "\n" << tr("output amount") << " = " << print_money(outs_for_amount.amount) << ", " << tr("found outputs to mix") << " = " << outs_for_amount.outs.size();
}
}
catch (const tools::error::tx_not_constructed&)
{
- fail_msg_writer() << "transaction was not constructed";
+ fail_msg_writer() << tr("transaction was not constructed");
}
catch (const tools::error::tx_rejected& e)
{
- fail_msg_writer() << "transaction " << get_transaction_hash(e.tx()) << " was rejected by daemon with status \"" << e.status() << '"';
+ fail_msg_writer() << (boost::format(tr("transaction %s was rejected by daemon with status: ")) % get_transaction_hash(e.tx())) << e.status();
}
catch (const tools::error::tx_sum_overflow& e)
{
@@ -1553,31 +1566,31 @@ bool simple_wallet::sweep_dust(const std::vector<std::string> &args_)
}
catch (const tools::error::zero_destination&)
{
- fail_msg_writer() << "one of destinations is zero";
+ fail_msg_writer() << tr("one of destinations is zero");
}
catch (const tools::error::tx_too_big& e)
{
- fail_msg_writer() << "Failed to find a suitable way to split transactions";
+ fail_msg_writer() << tr("Failed to find a suitable way to split transactions");
}
catch (const tools::error::transfer_error& e)
{
LOG_ERROR("unknown transfer error: " << e.to_string());
- fail_msg_writer() << "unknown transfer error: " << e.what();
+ fail_msg_writer() << tr("unknown transfer error: ") << e.what();
}
catch (const tools::error::wallet_internal_error& e)
{
LOG_ERROR("internal error: " << e.to_string());
- fail_msg_writer() << "internal error: " << e.what();
+ fail_msg_writer() << tr("internal error: ") << e.what();
}
catch (const std::exception& e)
{
LOG_ERROR("unexpected error: " << e.what());
- fail_msg_writer() << "unexpected error: " << e.what();
+ fail_msg_writer() << tr("unexpected error: ") << e.what();
}
catch (...)
{
LOG_ERROR("Unknown error");
- fail_msg_writer() << "unknown error";
+ fail_msg_writer() << tr("unknown error");
}
return true;
@@ -1586,7 +1599,7 @@ bool simple_wallet::sweep_dust(const std::vector<std::string> &args_)
bool simple_wallet::run()
{
std::string addr_start = m_wallet->get_account().get_public_address_str(m_wallet->testnet()).substr(0, 6);
- return m_cmd_binder.run_handling("[wallet " + addr_start + "]: ", "");
+ return m_cmd_binder.run_handling(std::string("[") + tr("wallet") + " " + addr_start + "]: ", "");
}
//----------------------------------------------------------------------------------------------------
void simple_wallet::stop()
@@ -1606,14 +1619,14 @@ bool simple_wallet::print_integrated_address(const std::vector<std::string> &arg
crypto::hash payment_id;
if (args.size() > 1)
{
- fail_msg_writer() << "integrated_address only takes one or zero arguments";
+ fail_msg_writer() << tr("integrated_address only takes one or zero arguments");
return true;
}
if (args.size() == 0)
{
crypto::generate_random_bytes(32, payment_id.data);
- success_msg_writer() << "Random payment ID: " << payment_id;
- success_msg_writer() << "Matching integrated address: " << m_wallet->get_account().get_public_integrated_address_str(payment_id, m_wallet->testnet());
+ success_msg_writer() << tr("Random payment ID: ") << payment_id;
+ success_msg_writer() << tr("Matching integrated address: ") << m_wallet->get_account().get_public_integrated_address_str(payment_id, m_wallet->testnet());
return true;
}
if(tools::wallet2::parse_payment_id(args.back(), payment_id))
@@ -1629,16 +1642,17 @@ bool simple_wallet::print_integrated_address(const std::vector<std::string> &arg
{
if (has_payment_id)
{
- success_msg_writer() << "Integrated address: account " << get_account_address_as_str(m_wallet->testnet(),addr) << ", payment id " << payment_id;
+ success_msg_writer() << boost::format(tr("Integrated address: account %s, payment id %s")) %
+ get_account_address_as_str(m_wallet->testnet(),addr) % epee::string_tools::pod_to_hex(payment_id);
}
else
{
- success_msg_writer() << "Standard address: account " << get_account_address_as_str(m_wallet->testnet(),addr);
+ success_msg_writer() << tr("Standard address: account: ") << get_account_address_as_str(m_wallet->testnet(),addr);
}
return true;
}
}
- fail_msg_writer() << "Failed to parse payment id or address";
+ fail_msg_writer() << tr("Failed to parse payment id or address");
return true;
}
//----------------------------------------------------------------------------------------------------
@@ -1657,11 +1671,11 @@ int main(int argc, char* argv[])
string_tools::set_module_name_and_folder(argv[0]);
- po::options_description desc_general("General options");
+ po::options_description desc_general(sw::tr("General options"));
command_line::add_arg(desc_general, command_line::arg_help);
command_line::add_arg(desc_general, command_line::arg_version);
- po::options_description desc_params("Wallet options");
+ po::options_description desc_params(sw::tr("Wallet options"));
command_line::add_arg(desc_params, arg_wallet_file);
command_line::add_arg(desc_params, arg_generate_new_wallet);
command_line::add_arg(desc_params, arg_generate_from_view_key);
@@ -1674,7 +1688,7 @@ int main(int argc, char* argv[])
bf::path default_log {log_space::log_singletone::get_default_log_folder()};
default_log /= log_space::log_singletone::get_default_log_file();
- std::cout << "default_log: " << default_log << ENDL;
+ std::cout << sw::tr("default_log: ") << default_log << ENDL;
command_line::add_arg(desc_params, arg_log_file, default_log.string());
command_line::add_arg(desc_params, arg_restore_deterministic_wallet );
@@ -1687,6 +1701,8 @@ int main(int argc, char* argv[])
po::positional_options_description positional_options;
positional_options.add(arg_command.name, -1);
+ i18n_set_language("translations", "monero");
+
po::options_description desc_all;
desc_all.add(desc_general).add(desc_params);
cryptonote::simple_wallet w;
@@ -1697,14 +1713,14 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
- success_msg_writer() << CRYPTONOTE_NAME << " wallet v" << MONERO_VERSION_FULL;
- success_msg_writer() << "Usage: simplewallet [--wallet-file=<file>|--generate-new-wallet=<file>] [--daemon-address=<host>:<port>] [<COMMAND>]";
+ success_msg_writer() << CRYPTONOTE_NAME << " " << sw::tr("wallet") << " v" << MONERO_VERSION_FULL;
+ success_msg_writer() << sw::tr("Usage:") << " simplewallet [--wallet-file=<file>|--generate-new-wallet=<file>] [--daemon-address=<host>:<port>] [<COMMAND>]";
success_msg_writer() << desc_all << '\n' << w.get_commands_str();
return false;
}
else if (command_line::get_arg(vm, command_line::arg_version))
{
- success_msg_writer() << CRYPTONOTE_NAME << " wallet v" << MONERO_VERSION_FULL;
+ success_msg_writer() << CRYPTONOTE_NAME << " " << sw::tr("wallet") << " v" << MONERO_VERSION_FULL;
return false;
}
@@ -1735,12 +1751,13 @@ int main(int argc, char* argv[])
LOG_LEVEL_4
);
- message_writer(epee::log_space::console_color_white, true) << CRYPTONOTE_NAME << " wallet v" << MONERO_VERSION_FULL;
+ message_writer(epee::log_space::console_color_white, true) << CRYPTONOTE_NAME << " " << sw::tr("wallet") << " v" << MONERO_VERSION_FULL;
if(command_line::has_arg(vm, arg_log_level))
log_level = command_line::get_arg(vm, arg_log_level);
LOG_PRINT_L0("Setting log level = " << log_level);
- message_writer(epee::log_space::console_color_white, true) << "Logging at log level " << log_level << " to " << log_file_path.string();
+ message_writer(epee::log_space::console_color_white, true) << boost::format(sw::tr("Logging at log level %d to %s")) %
+ log_level % log_file_path.string();
log_space::get_set_log_detalisation_level(true, log_level);
if(command_line::has_arg(vm, tools::wallet_rpc_server::arg_rpc_bind_port))
@@ -1749,17 +1766,17 @@ int main(int argc, char* argv[])
//runs wallet with rpc interface
if(!command_line::has_arg(vm, arg_wallet_file) )
{
- LOG_ERROR("Wallet file not set.");
+ LOG_ERROR(sw::tr("Wallet file not set."));
return 1;
}
if(!command_line::has_arg(vm, arg_daemon_address) )
{
- LOG_ERROR("Daemon address not set.");
+ LOG_ERROR(sw::tr("Daemon address not set."));
return 1;
}
if(!command_line::has_arg(vm, arg_password) )
{
- LOG_ERROR("Wallet password not set.");
+ LOG_ERROR(sw::tr("Wallet password not set."));
return 1;
}
@@ -1780,44 +1797,44 @@ int main(int argc, char* argv[])
tools::wallet2 wal(testnet,restricted);
try
{
- LOG_PRINT_L0("Loading wallet...");
+ LOG_PRINT_L0(sw::tr("Loading wallet..."));
wal.load(wallet_file, wallet_password);
wal.init(daemon_address);
wal.refresh();
- LOG_PRINT_GREEN("Loaded ok", LOG_LEVEL_0);
+ LOG_PRINT_GREEN(sw::tr("Loaded ok"), LOG_LEVEL_0);
}
catch (const std::exception& e)
{
- LOG_ERROR("Wallet initialize failed: " << e.what());
+ LOG_ERROR(sw::tr("Wallet initialization failed: ") << e.what());
return 1;
}
tools::wallet_rpc_server wrpc(wal);
bool r = wrpc.init(vm);
- CHECK_AND_ASSERT_MES(r, 1, "Failed to initialize wallet rpc server");
+ CHECK_AND_ASSERT_MES(r, 1, sw::tr("Failed to initialize wallet rpc server"));
tools::signal_handler::install([&wrpc, &wal] {
wrpc.send_stop_signal();
wal.store();
});
- LOG_PRINT_L0("Starting wallet rpc server");
+ LOG_PRINT_L0(sw::tr("Starting wallet rpc server"));
wrpc.run();
- LOG_PRINT_L0("Stopped wallet rpc server");
+ LOG_PRINT_L0(sw::tr("Stopped wallet rpc server"));
try
{
- LOG_PRINT_L0("Storing wallet...");
+ LOG_PRINT_L0(sw::tr("Storing wallet..."));
wal.store();
- LOG_PRINT_GREEN("Stored ok", LOG_LEVEL_0);
+ LOG_PRINT_GREEN(sw::tr("Stored ok"), LOG_LEVEL_0);
}
catch (const std::exception& e)
{
- LOG_ERROR("Failed to store wallet: " << e.what());
+ LOG_ERROR(sw::tr("Failed to store wallet: ") << e.what());
return 1;
}
}else
{
//runs wallet with console interface
r = w.init(vm);
- CHECK_AND_ASSERT_MES(r, 1, "Failed to initialize wallet");
+ CHECK_AND_ASSERT_MES(r, 1, sw::tr("Failed to initialize wallet"));
std::vector<std::string> command = command_line::get_arg(vm, arg_command);
if (!command.empty())
diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h
index 2b8ca0ed2..ad1dd015f 100644
--- a/src/simplewallet/simplewallet.h
+++ b/src/simplewallet/simplewallet.h
@@ -58,6 +58,9 @@ namespace cryptonote
class simple_wallet : public tools::i_wallet2_callback
{
public:
+ static const char *tr(const char *str) { return i18n_translate(str, "cryptonote::simple_wallet"); }
+
+ public:
typedef std::vector<std::string> command_type;
simple_wallet();
@@ -165,7 +168,7 @@ namespace cryptonote
if (std::chrono::milliseconds(1) < current_time - m_print_time || force)
{
- std::cout << "Height " << height << " of " << m_blockchain_height << '\r';
+ std::cout << QT_TRANSLATE_NOOP("Height ", "cryptonote::simple_wallet") << height << " / " << m_blockchain_height << '\r';
m_print_time = current_time;
}
}
diff --git a/translations/monero.ts b/translations/monero.ts
new file mode 100644
index 000000000..da832ff29
--- /dev/null
+++ b/translations/monero.ts
@@ -0,0 +1,996 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>cryptonote::simple_wallet</name>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="202"/>
+ <source>Commands: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="233"/>
+ <source>This wallet is watch-only and cannot have a seed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="253"/>
+ <source>The wallet is non-deterministic. Cannot display seed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="263"/>
+ <source>This wallet is watch-only and doesn&apos;t have a seed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="268"/>
+ <source>This wallet is non-deterministic and doesn&apos;t have a seed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="275"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="495"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="857"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="864"/>
+ <source>failed to read wallet password</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="283"/>
+ <source>invalid password</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="303"/>
+ <source>start_mining [&lt;number_of_threads&gt;] - Start mining in daemon</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="304"/>
+ <source>Stop mining in daemon</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="305"/>
+ <source>Save current blockchain data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="306"/>
+ <source>Resynchronize transactions and balance</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="307"/>
+ <source>Show current wallet balance</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="308"/>
+ <source>incoming_transfers [available|unavailable] - Show incoming transfers - all of them or filter them by availability</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="309"/>
+ <source>payments &lt;payment_id_1&gt; [&lt;payment_id_2&gt; ... &lt;payment_id_N&gt;] - Show payments &lt;payment_id_1&gt;, ... &lt;payment_id_N&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="310"/>
+ <source>Show blockchain height</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="311"/>
+ <source>transfer [&lt;mixin_count&gt;] &lt;addr_1&gt; &lt;amount_1&gt; [&lt;addr_2&gt; &lt;amount_2&gt; ... &lt;addr_N&gt; &lt;amount_N&gt;] [payment_id] - Transfer &lt;amount_1&gt;,... &lt;amount_N&gt; to &lt;address_1&gt;,... &lt;address_N&gt;, respectively. &lt;mixin_count&gt; is the number of transactions yours is indistinguishable from (from 0 to maximum available)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="312"/>
+ <source>Send all dust outputs to the same address with mixin 0</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="313"/>
+ <source>set_log &lt;level&gt; - Change current log detalization level, &lt;level&gt; is a number 0-4</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="314"/>
+ <source>Show current wallet public address</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="315"/>
+ <source>Convert a payment ID to an integrated address for the current wallet public address (no arguments use a random payment ID), or display standard addres and payment ID corresponding to an integrated addres</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="316"/>
+ <source>Save wallet synchronized data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="317"/>
+ <source>Save watch only keys file</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="318"/>
+ <source>Get viewkey</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="319"/>
+ <source>Get spendkey</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="320"/>
+ <source>Get deterministic seed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="321"/>
+ <source>available options: seed language - Set wallet seed langage</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="322"/>
+ <source>Show this help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="329"/>
+ <source>set: needs an argument. available options: seed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="338"/>
+ <source>set seed: needs an argument. available options: language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="350"/>
+ <source>set: unrecognized argument(s)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="358"/>
+ <source>use: set_log &lt;log_level_number_0-4&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="364"/>
+ <source>wrong number format, use: set_log &lt;log_level_number_0-4&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="369"/>
+ <source>wrong number range, use: set_log &lt;log_level_number_0-4&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="384"/>
+ <source>Specify wallet file name (e.g., wallet.bin). If the wallet doesn&apos;t exist, it will be created.
+Wallet file name: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="390"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="756"/>
+ <source>wallet file path not valid: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="409"/>
+ <source>Attempting to generate or restore wallet, but specified file(s) exist. Exiting to not risk overwriting.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="423"/>
+ <source>The wallet doesn&apos;t exist, generating new one</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="428"/>
+ <source>Keys file wasn&apos;t found: failed to open wallet: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="442"/>
+ <source>PLEASE NOTE: the following 25 words can be used to recover access to your wallet. Please write them down and store them somewhere safe and secure. Please do not store them in your email or on file storage services outside of your immediate control.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="458"/>
+ <source>you can&apos;t specify daemon host or port several times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="464"/>
+ <source>Specifying more than one of --generate-new-wallet=&quot;wallet_name&quot;, --wallet-file=&quot;wallet_name&quot; and --generate-from-keys doesn&apos;t make sense!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="510"/>
+ <source>Cannot specify both --restore-deterministic-wallet and --non-deterministic</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="519"/>
+ <source>specify a recovery parameter with the --electrum-seed=&quot;words list here&quot;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="526"/>
+ <source>electrum-style word list failed verification</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="537"/>
+ <source>--generate-from-view-key needs a address:viewkey:filename triple</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="547"/>
+ <source>Failed to parse address</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="555"/>
+ <source>Failed to parse view key secret key</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="609"/>
+ <source>wallet failed to connect to daemon: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="610"/>
+ <source>Daemon either is not started or passed wrong port. Please, make sure that daemon is running or restart the wallet with correct daemon address.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="630"/>
+ <source>List of available languages for your wallet&apos;s seed:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="639"/>
+ <source>Enter the number corresponding to the language of your choice: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="646"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="651"/>
+ <source>Invalid language choice passed. Please try again.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="674"/>
+ <source>You had been using a deprecated version of the wallet. Please use the new seed that we provide.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="690"/>
+ <source>Generated new wallet: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="692"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="739"/>
+ <source>view key: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="696"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="743"/>
+ <source>failed to generate new wallet: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="709"/>
+ <source>Your wallet has been generated.
+To start synchronizing with the daemon use &quot;refresh&quot; command.
+Use &quot;help&quot; command to see the list of available commands.
+Always use &quot;exit&quot; command when closing simplewallet to save
+current session&apos;s state. Otherwise, you will possibly need to synchronize
+your wallet again. Your wallet key is NOT under risk anyway.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="737"/>
+ <source>Generated new watch-only wallet: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="768"/>
+ <source>Opened watch-only wallet</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="768"/>
+ <source>Opened wallet</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="777"/>
+ <source>You had been using a deprecated version of the wallet. Please proceed to upgrade your wallet.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="790"/>
+ <source>You had been using a deprecated version of the wallet. Your wallet file format is being upgraded now.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="798"/>
+ <source>failed to load wallet: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="807"/>
+ <source>Use &quot;help&quot; command to see the list of available commands.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="817"/>
+ <source>failed to deinit wallet</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="839"/>
+ <source>Wallet data saved</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="854"/>
+ <source>Password for the new watch-only wallet</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="861"/>
+ <source>Enter new password again</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="869"/>
+ <source>passwords do not match</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="906"/>
+ <source>invalid arguments. Please use start_mining [&lt;number_of_threads&gt;], &lt;number_of_threads&gt; should be from 1 to </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="915"/>
+ <source>Mining started in daemon</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="917"/>
+ <source>mining has NOT been started: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="931"/>
+ <source>Mining stopped in daemon</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="933"/>
+ <source>mining has NOT been stopped: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="947"/>
+ <source>Blockchain saved</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="949"/>
+ <source>Blockchain can&apos;t be saved: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="961"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="970"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="979"/>
+ <source>Height </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="962"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="971"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="980"/>
+ <source>transaction </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="963"/>
+ <source>received </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="972"/>
+ <source>spent </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="981"/>
+ <source>unsupported transaction format</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="990"/>
+ <source>Starting refresh...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1013"/>
+ <source>Refresh done, blocks received: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1018"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1386"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1523"/>
+ <source>daemon is busy. Please try later</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1022"/>
+ <source>no connection to daemon. Please, make sure daemon is running</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1027"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1395"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1532"/>
+ <source>RPC error: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1032"/>
+ <source>Error refreshing: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1037"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1446"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1583"/>
+ <source>internal error: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1042"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1451"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1588"/>
+ <source>unexpected error: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1047"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1456"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1593"/>
+ <source>unknown error</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1052"/>
+ <source>refresh failed: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1052"/>
+ <source>Blocks received: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1060"/>
+ <source>balance: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1061"/>
+ <source>unlocked balance: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1062"/>
+ <source>including unlocked dust: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1094"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1134"/>
+ <source>amount</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1094"/>
+ <source>spent</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1094"/>
+ <source>global index</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1094"/>
+ <source>tx id</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1110"/>
+ <source>No incoming transfers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1114"/>
+ <source>No incoming available transfers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1118"/>
+ <source>No incoming unavailable transfers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1129"/>
+ <source>expected at least one payment_id</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1134"/>
+ <source>payment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1134"/>
+ <source>transaction</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1134"/>
+ <source>height</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1134"/>
+ <source>unlock time</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1146"/>
+ <source>No payments with id </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1167"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1247"/>
+ <source>payment id has invalid format, expected 64-character string: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1193"/>
+ <source>failed to get blockchain height: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1219"/>
+ <source>wrong number of arguments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1225"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1470"/>
+ <source>This is a watch only wallet</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1280"/>
+ <source>DNSSEC validation passed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1284"/>
+ <source>WARNING: DNSSEC validation was unsuccessful, this address may not be correct!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1287"/>
+ <source>For URL: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1289"/>
+ <source> Monero Address = </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1291"/>
+ <source>Is this OK? (Y/n) </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1297"/>
+ <source>yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1297"/>
+ <source>no</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1299"/>
+ <source>You have cancelled the transfer request</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1305"/>
+ <source>Failed to get a Monero address from: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1311"/>
+ <source>Not yet supported: Multiple Monero addresses found for given URL: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1315"/>
+ <source>Wrong address: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1322"/>
+ <source>A single transaction cannot use more than one payment id: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1333"/>
+ <source>Failed to set up payment id, though it was decoded correctly</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1343"/>
+ <source>amount is wrong: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1344"/>
+ <source>expected number from 0 to </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1359"/>
+ <source>Your transaction needs to be split into %zu transactions. This will result in a transaction fee being applied to each transaction. Is this okay? (Y/Yes/N/No)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1365"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1503"/>
+ <source>Transaction cancelled.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1378"/>
+ <source>Money successfully sent, transaction </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1390"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1527"/>
+ <source>no connection to daemon. Please, make sure daemon is running.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1399"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1536"/>
+ <source>failed to get random outputs to mix</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1403"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1540"/>
+ <source>not enough money to transfer, available only %s, transaction amount %s = %s + %s (fee)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1412"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1549"/>
+ <source>not enough outputs for specified mixin_count</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1415"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1552"/>
+ <source>output amount</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1415"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1552"/>
+ <source>found outputs to mix</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1420"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1557"/>
+ <source>transaction was not constructed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1424"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1561"/>
+ <source>transaction %s was rejected by daemon with status: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1432"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1569"/>
+ <source>one of destinations is zero</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1436"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1573"/>
+ <source>Failed to find a suitable way to split transactions</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1441"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1578"/>
+ <source>unknown transfer error: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1488"/>
+ <source>Sweeping </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1490"/>
+ <source>Sweeping %s in %zu transactions for a total fee of %s. Is this okay? (Y/Yes/N/No)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1496"/>
+ <source>Sweeping %s for a total fee of %s. Is this okay? (Y/Yes/N/No)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1515"/>
+ <source>Money successfully sent, transaction: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1602"/>
+ <source>wallet</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1622"/>
+ <source>integrated_address only takes one or zero arguments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1628"/>
+ <source>Random payment ID: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1629"/>
+ <source>Matching integrated address: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1645"/>
+ <source>Integrated address: account %s, payment id %s</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1650"/>
+ <source>Standard address: account: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1655"/>
+ <source>Failed to parse payment id or address</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>sw</name>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="80"/>
+ <source>Use wallet &lt;arg&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="81"/>
+ <source>Generate new wallet and save it to &lt;arg&gt; or &lt;address&gt;.wallet by default</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="82"/>
+ <source>Generate wallet from (address:viewkey:filename) and save it to &lt;filename&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="83"/>
+ <source>Use daemon instance at &lt;host&gt;:&lt;port&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="84"/>
+ <source>Use daemon instance at host &lt;arg&gt; instead of localhost</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="85"/>
+ <source>Wallet password</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="86"/>
+ <source>Specify electrum seed for wallet recovery/creation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="87"/>
+ <source>Recover wallet using electrum-style mnemonic</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="88"/>
+ <source>creates non-deterministic view and spend keys</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="89"/>
+ <source>Use daemon instance at port &lt;arg&gt; instead of 8081</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="91"/>
+ <source>Specify log file</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="92"/>
+ <source>Used to deploy test nets. The daemon must be launched with --testnet flag</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="93"/>
+ <source>Restricts RPC to view only commands</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="104"/>
+ <source>daemon is busy. Please try later</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="113"/>
+ <source>possible lost connection to daemon</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="194"/>
+ <source>Error: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1674"/>
+ <source>General options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1678"/>
+ <source>Wallet options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1691"/>
+ <source>default_log: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1716"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1723"/>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1754"/>
+ <source>wallet</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1717"/>
+ <source>Usage:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1759"/>
+ <source>Logging at log level %d to %s</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1769"/>
+ <source>Wallet file not set.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1774"/>
+ <source>Daemon address not set.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1779"/>
+ <source>Wallet password not set.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1800"/>
+ <source>Loading wallet...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1804"/>
+ <source>Loaded ok</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1808"/>
+ <source>Wallet initialization failed: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1813"/>
+ <source>Failed to initialize wallet rpc server</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1819"/>
+ <source>Starting wallet rpc server</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1821"/>
+ <source>Stopped wallet rpc server</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1824"/>
+ <source>Storing wallet...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1826"/>
+ <source>Stored ok</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1830"/>
+ <source>Failed to store wallet: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/simplewallet/simplewallet.cpp" line="1837"/>
+ <source>Failed to initialize wallet</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/utils/translations/build-translations.sh b/utils/translations/build-translations.sh
new file mode 100755
index 000000000..0956e633f
--- /dev/null
+++ b/utils/translations/build-translations.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+lrelease=`which lrelease 2> /dev/null`
+if test -z "$lrelease"
+then
+ lrelease=`which lrelease-qt4 2> /dev/null`
+fi
+if test -z "$lrelease"
+then
+ echo "lrelease not found"
+ exit 1
+fi
+
+echo "using $lrelease"
+"$lrelease" translations/*.ts
+
diff --git a/utils/translations/update-translations.sh b/utils/translations/update-translations.sh
new file mode 100755
index 000000000..778aa5176
--- /dev/null
+++ b/utils/translations/update-translations.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+lupdate=`which lupdate 2> /dev/null`
+if test -z "$lupdate"
+then
+ lupdate=`which lupdate-qt4 2> /dev/null`
+fi
+if test -z "$lupdate"
+then
+ echo "lupdate not found"
+ exit 1
+fi
+
+echo "using $lupdate"
+"$lupdate" `find src -name \*.cpp` -ts translations/*.ts
+