m_staticTextBalance->SetSize(140, 17);\r
// & underlines don't work on the toolbar buttons on gtk\r
m_toolBar->ClearTools();\r
- m_toolBar->AddTool(wxID_BUTTONSEND, "Send Coins", wxBitmap(send20_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);\r
- m_toolBar->AddTool(wxID_BUTTONRECEIVE, "Address Book", wxBitmap(addressbook20_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);\r
+ m_toolBar->AddTool(wxID_BUTTONSEND, _("Send Coins"), wxBitmap(send20_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);\r
+ m_toolBar->AddTool(wxID_BUTTONRECEIVE, _("Address Book"), wxBitmap(addressbook20_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);\r
m_toolBar->Realize();\r
// resize to fit ubuntu's huge default font\r
dResize = 1.20;\r
int nDateWidth = DateTimeStr(1229413914).size() * 6 + 8;\r
if (!strstr(DateTimeStr(1229413914).c_str(), "2008"))\r
nDateWidth += 12;\r
- m_listCtrl->InsertColumn(0, "", wxLIST_FORMAT_LEFT, dResize * 0);\r
- m_listCtrl->InsertColumn(1, "", wxLIST_FORMAT_LEFT, dResize * 0);\r
- m_listCtrl->InsertColumn(2, "Status", wxLIST_FORMAT_LEFT, dResize * 110);\r
- m_listCtrl->InsertColumn(3, "Date", wxLIST_FORMAT_LEFT, dResize * nDateWidth);\r
- m_listCtrl->InsertColumn(4, "Description", wxLIST_FORMAT_LEFT, dResize * 409 - nDateWidth);\r
- m_listCtrl->InsertColumn(5, "Debit", wxLIST_FORMAT_RIGHT, dResize * 79);\r
- m_listCtrl->InsertColumn(6, "Credit", wxLIST_FORMAT_RIGHT, dResize * 79);\r
+ m_listCtrl->InsertColumn(0, "", wxLIST_FORMAT_LEFT, dResize * 0);\r
+ m_listCtrl->InsertColumn(1, "", wxLIST_FORMAT_LEFT, dResize * 0);\r
+ m_listCtrl->InsertColumn(2, _("Status"), wxLIST_FORMAT_LEFT, dResize * 110);\r
+ m_listCtrl->InsertColumn(3, _("Date"), wxLIST_FORMAT_LEFT, dResize * nDateWidth);\r
+ m_listCtrl->InsertColumn(4, _("Description"), wxLIST_FORMAT_LEFT, dResize * 409 - nDateWidth);\r
+ m_listCtrl->InsertColumn(5, _("Debit"), wxLIST_FORMAT_RIGHT, dResize * 79);\r
+ m_listCtrl->InsertColumn(6, _("Credit"), wxLIST_FORMAT_RIGHT, dResize * 79);\r
\r
// Init status bar\r
int pnWidths[3] = { -100, 88, 290 };\r
if (!wtx.IsFinal())\r
{\r
if (wtx.nLockTime < 500000000)\r
- return strprintf("Open for %d blocks", nBestHeight - wtx.nLockTime);\r
+ return strprintf(_("Open for %d blocks"), nBestHeight - wtx.nLockTime);\r
else\r
- return strprintf("Open until %s", DateTimeStr(wtx.nLockTime).c_str());\r
+ return strprintf(_("Open until %s"), DateTimeStr(wtx.nLockTime).c_str());\r
}\r
else\r
{\r
int nDepth = wtx.GetDepthInMainChain();\r
if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)\r
- return strprintf("%d/offline?", nDepth);\r
+ return strprintf(_("%d/offline?"), nDepth);\r
else if (nDepth < 6)\r
- return strprintf("%d/unconfirmed", nDepth);\r
+ return strprintf(_("%d/unconfirmed"), nDepth);\r
else\r
- return strprintf("%d confirmations", nDepth);\r
+ return strprintf(_("%d confirmations"), nDepth);\r
}\r
}\r
\r
if (wtx.IsCoinBase())\r
{\r
// Coinbase\r
- strDescription = "Generated";\r
+ strDescription = _("Generated");\r
if (nCredit == 0)\r
{\r
int64 nUnmatured = 0;\r
nUnmatured += txout.GetCredit();\r
if (wtx.IsInMainChain())\r
{\r
- strDescription = strprintf("Generated (%s matures in %d more blocks)", FormatMoney(nUnmatured).c_str(), wtx.GetBlocksToMaturity());\r
+ strDescription = strprintf(_("Generated (%s matures in %d more blocks)"), FormatMoney(nUnmatured).c_str(), wtx.GetBlocksToMaturity());\r
\r
// Check if the block was requested by anyone\r
if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)\r
- strDescription = "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!";\r
+ strDescription = _("Generated - Warning: This block was not received by any other nodes and will probably not be accepted!");\r
}\r
else\r
{\r
- strDescription = "Generated (not accepted)";\r
+ strDescription = _("Generated (not accepted)");\r
}\r
}\r
}\r
{\r
// Online transaction\r
if (!mapValue["from"].empty())\r
- strDescription += "From: " + mapValue["from"];\r
+ strDescription += _("From: ") + mapValue["from"];\r
if (!mapValue["message"].empty())\r
{\r
if (!strDescription.empty())\r
string strAddress = PubKeyToAddress(vchPubKey);\r
if (mapAddressBook.count(strAddress))\r
{\r
- //strDescription += "Received payment to ";\r
- //strDescription += "Received with address ";\r
- strDescription += "From: unknown, To: ";\r
+ //strDescription += _("Received payment to ");\r
+ //strDescription += _("Received with address ");\r
+ strDescription += _("From: unknown, To: ");\r
strDescription += strAddress;\r
/// The labeling feature is just too confusing, so I hid it\r
/// by putting it at the end where it runs off the screen.\r
InsertLine(fNew, nIndex, hash, strSort,\r
strStatus,\r
nTime ? DateTimeStr(nTime) : "",\r
- "Payment to yourself",\r
+ _("Payment to yourself"),\r
"",\r
"");\r
/// issue: can't tell which is the payment and which is the change anymore\r
strAddress = Hash160ToAddress(hash160);\r
}\r
\r
- string strDescription = "To: ";\r
+ string strDescription = _("To: ");\r
CRITICAL_BLOCK(cs_mapAddressBook)\r
if (mapAddressBook.count(strAddress) && !mapAddressBook[strAddress].empty())\r
strDescription += mapAddressBook[strAddress] + " ";\r
// Update status bar\r
string strGen = "";\r
if (fGenerateBitcoins)\r
- strGen = " Generating";\r
+ strGen = _(" Generating");\r
if (fGenerateBitcoins && vNodes.empty())\r
- strGen = "(not connected)";\r
+ strGen = _("(not connected)");\r
m_statusBar->SetStatusText(strGen, 1);\r
\r
- string strStatus = strprintf(" %d connections %d blocks %d transactions", vNodes.size(), nBestHeight + 1, nTransactionCount);\r
+ string strStatus = strprintf(_(" %d connections %d blocks %d transactions"), vNodes.size(), nBestHeight + 1, nTransactionCount);\r
m_statusBar->SetStatusText(strStatus, 2);\r
\r
if (fDebug && GetTime() - nThreadSocketHandlerHeartbeat > 60)\r
\r
\r
\r
- strHTML += "<b>Status:</b> " + FormatTxStatus(wtx);\r
+ strHTML += _("<b>Status:</b> ") + FormatTxStatus(wtx);\r
int nRequests = wtx.GetRequestCount();\r
if (nRequests != -1)\r
{\r
if (nRequests == 0)\r
- strHTML += ", has not been successfully broadcast yet";\r
+ strHTML += _(", has not been successfully broadcast yet");\r
else if (nRequests == 1)\r
- strHTML += strprintf(", broadcast through %d node", nRequests);\r
+ strHTML += strprintf(_(", broadcast through %d node"), nRequests);\r
else\r
- strHTML += strprintf(", broadcast through %d nodes", nRequests);\r
+ strHTML += strprintf(_(", broadcast through %d nodes"), nRequests);\r
}\r
strHTML += "<br>";\r
\r
- strHTML += "<b>Date:</b> " + (nTime ? DateTimeStr(nTime) : "") + "<br>";\r
+ strHTML += _("<b>Date:</b> ") + (nTime ? DateTimeStr(nTime) : "") + "<br>";\r
\r
\r
//\r
//\r
if (wtx.IsCoinBase())\r
{\r
- strHTML += "<b>Source:</b> Generated<br>";\r
+ strHTML += _("<b>Source:</b> Generated<br>");\r
}\r
else if (!wtx.mapValue["from"].empty())\r
{\r
// Online transaction\r
if (!wtx.mapValue["from"].empty())\r
- strHTML += "<b>From:</b> " + HtmlEscape(wtx.mapValue["from"]) + "<br>";\r
+ strHTML += _("<b>From:</b> ") + HtmlEscape(wtx.mapValue["from"]) + "<br>";\r
}\r
else\r
{\r
string strAddress = PubKeyToAddress(vchPubKey);\r
if (mapAddressBook.count(strAddress))\r
{\r
- strHTML += "<b>From:</b> unknown<br>";\r
- strHTML += "<b>To:</b> ";\r
+ strHTML += string() + _("<b>From:</b> ") + _("unknown") + "<br>";\r
+ strHTML += _("<b>To:</b> ");\r
strHTML += HtmlEscape(strAddress);\r
if (!mapAddressBook[strAddress].empty())\r
- strHTML += " (yours, label: " + mapAddressBook[strAddress] + ")";\r
+ strHTML += _(" (yours, label: ") + mapAddressBook[strAddress] + ")";\r
else\r
- strHTML += " (yours)";\r
+ strHTML += _(" (yours)");\r
strHTML += "<br>";\r
}\r
}\r
{\r
// Online transaction\r
strAddress = wtx.mapValue["to"];\r
- strHTML += "<b>To:</b> ";\r
+ strHTML += _("<b>To:</b> ");\r
if (mapAddressBook.count(strAddress) && !mapAddressBook[strAddress].empty())\r
strHTML += mapAddressBook[strAddress] + " ";\r
strHTML += HtmlEscape(strAddress) + "<br>";\r
int64 nUnmatured = 0;\r
foreach(const CTxOut& txout, wtx.vout)\r
nUnmatured += txout.GetCredit();\r
+ strHTML += _("<b>Credit:</b> ");\r
if (wtx.IsInMainChain())\r
- strHTML += strprintf("<b>Credit:</b> (%s matures in %d more blocks)<br>", FormatMoney(nUnmatured).c_str(), wtx.GetBlocksToMaturity());\r
+ strHTML += strprintf(_("(%s matures in %d more blocks)"), FormatMoney(nUnmatured).c_str(), wtx.GetBlocksToMaturity());\r
else\r
- strHTML += "<b>Credit:</b> (not accepted)<br>";\r
+ strHTML += _("(not accepted)");\r
+ strHTML += "<br>";\r
}\r
else if (nNet > 0)\r
{\r
//\r
// Credit\r
//\r
- strHTML += "<b>Credit:</b> " + FormatMoney(nNet) + "<br>";\r
+ strHTML += _("<b>Credit:</b> ") + FormatMoney(nNet) + "<br>";\r
}\r
else\r
{\r
if (ExtractHash160(txout.scriptPubKey, hash160))\r
{\r
string strAddress = Hash160ToAddress(hash160);\r
- strHTML += "<b>To:</b> ";\r
+ strHTML += _("<b>To:</b> ");\r
if (mapAddressBook.count(strAddress) && !mapAddressBook[strAddress].empty())\r
strHTML += mapAddressBook[strAddress] + " ";\r
strHTML += strAddress;\r
}\r
}\r
\r
- strHTML += "<b>Debit:</b> " + FormatMoney(-txout.nValue) + "<br>";\r
+ strHTML += _("<b>Debit:</b> ") + FormatMoney(-txout.nValue) + "<br>";\r
}\r
\r
if (fAllToMe)\r
// Payment to self\r
/// issue: can't tell which is the payment and which is the change anymore\r
//int64 nValue = wtx.vout[0].nValue;\r
- //strHTML += "<b>Debit:</b> " + FormatMoney(-nValue) + "<br>";\r
- //strHTML += "<b>Credit:</b> " + FormatMoney(nValue) + "<br>";\r
+ //strHTML += _("<b>Debit:</b> ") + FormatMoney(-nValue) + "<br>";\r
+ //strHTML += _("<b>Credit:</b> ") + FormatMoney(nValue) + "<br>";\r
}\r
\r
int64 nTxFee = nDebit - wtx.GetValueOut();\r
if (nTxFee > 0)\r
- strHTML += "<b>Transaction fee:</b> " + FormatMoney(-nTxFee) + "<br>";\r
+ strHTML += _("<b>Transaction fee:</b> ") + FormatMoney(-nTxFee) + "<br>";\r
}\r
else\r
{\r
//\r
foreach(const CTxIn& txin, wtx.vin)\r
if (txin.IsMine())\r
- strHTML += "<b>Debit:</b> " + FormatMoney(-txin.GetDebit()) + "<br>";\r
+ strHTML += _("<b>Debit:</b> ") + FormatMoney(-txin.GetDebit()) + "<br>";\r
foreach(const CTxOut& txout, wtx.vout)\r
if (txout.IsMine())\r
- strHTML += "<b>Credit:</b> " + FormatMoney(txout.GetCredit()) + "<br>";\r
+ strHTML += _("<b>Credit:</b> ") + FormatMoney(txout.GetCredit()) + "<br>";\r
}\r
}\r
\r
- strHTML += "<b>Net amount:</b> " + FormatMoney(nNet, true) + "<br>";\r
+ strHTML += _("<b>Net amount:</b> ") + FormatMoney(nNet, true) + "<br>";\r
\r
\r
//\r
// Message\r
//\r
if (!wtx.mapValue["message"].empty())\r
- strHTML += "<br><b>Message:</b><br>" + HtmlEscape(wtx.mapValue["message"], true) + "<br>";\r
+ strHTML += string() + "<br><b>" + _("Message:") + "</b><br>" + HtmlEscape(wtx.mapValue["message"], true) + "<br>";\r
\r
if (wtx.IsCoinBase())\r
- strHTML += "<br>Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.<br>";\r
+ strHTML += string() + "<br>" + _("Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.") + "<br>";\r
\r
\r
//\r
COptionsDialog::COptionsDialog(wxWindow* parent) : COptionsDialogBase(parent)\r
{\r
// Set up list box of page choices\r
- m_listBox->Append("Main");\r
- //m_listBox->Append("Test 2");\r
+ m_listBox->Append(_("Main"));\r
+ //m_listBox->Append(_("Test 2"));\r
m_listBox->SetSelection(0);\r
SelectPage(0);\r
#ifndef __WXMSW__\r
- m_checkBoxMinimizeOnClose->SetLabel("&Minimize on close");\r
+ m_checkBoxMinimizeOnClose->SetLabel(_("&Minimize on close"));\r
m_checkBoxStartOnSystemStartup->Enable(false); // not implemented yet\r
#endif\r
\r
\r
CAboutDialog::CAboutDialog(wxWindow* parent) : CAboutDialogBase(parent)\r
{\r
- m_staticTextVersion->SetLabel(strprintf("version 0.%d.%d beta", VERSION/100, VERSION%100));\r
+ m_staticTextVersion->SetLabel(strprintf(_("version 0.%d.%d beta"), VERSION/100, VERSION%100));\r
\r
-#if !wxUSE_UNICODE\r
- // Workaround until upgrade to wxWidgets supporting UTF-8\r
- // Hack to change the (c) character from UTF-8 back to ANSI\r
+ // Change (c) into UTF-8 or ANSI copyright symbol\r
wxString str = m_staticTextMain->GetLabel();\r
- if (str.Find('\xC2') != wxNOT_FOUND)\r
- str.Remove(str.Find('\xC2'), 1);\r
- m_staticTextMain->SetLabel(str);\r
+#if wxUSE_UNICODE\r
+ str.Replace("(c)", wxString::FromUTF8("\xC2\xA9"));\r
+#else\r
+ str.Replace("(c)", "\xA9");\r
#endif\r
+ m_staticTextMain->SetLabel(str);\r
#ifndef __WXMSW__\r
// Resize on Linux to make the window fit the text.\r
// The text was wrapped manually rather than using the Wrap setting because\r
if (fontTmp.GetPointSize() > 8);\r
fontTmp.SetPointSize(8);\r
m_staticTextMain->SetFont(fontTmp);\r
- SetSize(GetSize().GetWidth() + 44, GetSize().GetHeight() - 4);\r
+ SetSize(GetSize().GetWidth() + 44, GetSize().GetHeight() + 10);\r
#endif\r
}\r
\r
{\r
strFromSave = m_textCtrlFrom->GetValue();\r
strMessageSave = m_textCtrlMessage->GetValue();\r
- m_textCtrlFrom->SetValue("Will appear as \"From: Unknown\"");\r
- m_textCtrlMessage->SetValue("Can't include a message when sending to a Bitcoin address");\r
+ m_textCtrlFrom->SetValue(_("Will appear as \"From: Unknown\""));\r
+ m_textCtrlMessage->SetValue(_("Can't include a message when sending to a Bitcoin address"));\r
}\r
else if (fEnable && !fEnabledPrev)\r
{\r
int64 nValue = 0;\r
if (!ParseMoney(m_textCtrlAmount->GetValue(), nValue) || nValue <= 0)\r
{\r
- wxMessageBox("Error in amount ", "Send Coins");\r
+ wxMessageBox(_("Error in amount "), _("Send Coins"));\r
return;\r
}\r
if (nValue > GetBalance())\r
{\r
- wxMessageBox("Amount exceeds your balance ", "Send Coins");\r
+ wxMessageBox(_("Amount exceeds your balance "), _("Send Coins"));\r
return;\r
}\r
if (nValue + nTransactionFee > GetBalance())\r
{\r
- wxMessageBox(string("Total exceeds your balance when the ") + FormatMoney(nTransactionFee) + " transaction fee is included ", "Send Coins");\r
+ wxMessageBox(string(_("Total exceeds your balance when the ")) + FormatMoney(nTransactionFee) + _(" transaction fee is included "), _("Send Coins"));\r
return;\r
}\r
\r
\r
string strError = SendMoney(scriptPubKey, nValue, wtx);\r
if (strError != "")\r
- wxMessageBox(strError + " ", "Sending...");\r
+ wxMessageBox(strError + " ", _("Sending..."));\r
else\r
- wxMessageBox("Payment sent ", "Sending...");\r
+ wxMessageBox(_("Payment sent "), _("Sending..."));\r
}\r
else\r
{\r
CAddress addr(strAddress);\r
if (!addr.IsValid())\r
{\r
- wxMessageBox("Invalid address ", "Send Coins");\r
+ wxMessageBox(_("Invalid address "), _("Send Coins"));\r
return;\r
}\r
\r
SetSize(1.2 * GetSize().GetWidth(), 1.08 * GetSize().GetHeight());\r
#endif\r
\r
- SetTitle(strprintf("Sending %s to %s", FormatMoney(nPrice).c_str(), wtx.mapValue["to"].c_str()));\r
+ SetTitle(strprintf(_("Sending %s to %s"), FormatMoney(nPrice).c_str(), wtx.mapValue["to"].c_str()));\r
m_textCtrlStatus->SetValue("");\r
\r
CreateThread(SendingDialogStartTransfer, this);\r
}\r
if (fAbort && fCanCancel && IsShown())\r
{\r
- strcpy(pszStatus, "CANCELLED");\r
+ strcpy(pszStatus, _("CANCELLED"));\r
m_buttonOK->Enable(true);\r
m_buttonOK->SetFocus();\r
m_buttonCancel->Enable(false);\r
- m_buttonCancel->SetLabel("Cancelled");\r
+ m_buttonCancel->SetLabel(_("Cancelled"));\r
Close();\r
- wxMessageBox("Transfer cancelled ", "Sending...", wxOK, this);\r
+ wxMessageBox(_("Transfer cancelled "), _("Sending..."), wxOK, this);\r
}\r
event.Skip();\r
}\r
if (fAbort && fCanCancel)\r
{\r
memset(pszStatus, 0, 10);\r
- strcpy(pszStatus, "CANCELLED");\r
+ strcpy(pszStatus, _("CANCELLED"));\r
Repaint();\r
fWorkDone = true;\r
return false;\r
{\r
fCanCancel = false;\r
fWorkDone = true;\r
- Status(string("Error: ") + str);\r
+ Status(string(_("Error: ")) + str);\r
return false;\r
}\r
\r
// Make sure we have enough money\r
if (nPrice + nTransactionFee > GetBalance())\r
{\r
- Error("You don't have enough money");\r
+ Error(_("You don't have enough money"));\r
return;\r
}\r
\r
// We may have connected already for product details\r
- if (!Status("Connecting..."))\r
+ if (!Status(_("Connecting...")))\r
return;\r
CNode* pnode = ConnectNode(addr, 15 * 60);\r
if (!pnode)\r
{\r
- Error("Unable to connect");\r
+ Error(_("Unable to connect"));\r
return;\r
}\r
\r
// Send order to seller, with response going to OnReply2 via event handler\r
- if (!Status("Requesting public key..."))\r
+ if (!Status(_("Requesting public key...")))\r
return;\r
pnode->PushRequest("checkorder", wtx, SendingDialogOnReply2, this);\r
}\r
\r
void CSendingDialog::OnReply2(CDataStream& vRecv)\r
{\r
- if (!Status("Received public key..."))\r
+ if (!Status(_("Received public key...")))\r
return;\r
\r
CScript scriptPubKey;\r
{\r
string strMessage;\r
vRecv >> strMessage;\r
- Error("Transfer was not accepted");\r
+ Error(_("Transfer was not accepted"));\r
//// todo: enlarge the window and enable a hidden white box to put seller's message\r
return;\r
}\r
catch (...)\r
{\r
//// what do we want to do about this?\r
- Error("Invalid response received");\r
+ Error(_("Invalid response received"));\r
return;\r
}\r
\r
CRITICAL_BLOCK(cs_main)\r
{\r
// Pay\r
- if (!Status("Creating transaction..."))\r
+ if (!Status(_("Creating transaction...")))\r
return;\r
if (nPrice + nTransactionFee > GetBalance())\r
{\r
- Error("You don't have enough money");\r
+ Error(_("You don't have enough money"));\r
return;\r
}\r
CKey key;\r
if (!CreateTransaction(scriptPubKey, nPrice, wtx, key, nFeeRequired))\r
{\r
if (nPrice + nFeeRequired > GetBalance())\r
- Error(strprintf("This is an oversized transaction that requires a transaction fee of %s", FormatMoney(nFeeRequired).c_str()));\r
+ Error(strprintf(_("This is an oversized transaction that requires a transaction fee of %s"), FormatMoney(nFeeRequired).c_str()));\r
else\r
- Error("Transaction creation failed");\r
+ Error(_("Transaction creation failed"));\r
return;\r
}\r
\r
CNode* pnode = ConnectNode(addr, 2 * 60 * 60);\r
if (!pnode)\r
{\r
- Error("Lost connection, transaction cancelled");\r
+ Error(_("Lost connection, transaction cancelled"));\r
return;\r
}\r
\r
return;\r
fCanCancel = false;\r
}\r
- if (!Status("Sending payment..."))\r
+ if (!Status(_("Sending payment...")))\r
return;\r
\r
// Commit\r
if (!CommitTransactionSpent(wtx, key))\r
{\r
- Error("Error finalizing payment");\r
+ Error(_("Error finalizing payment"));\r
return;\r
}\r
\r
printf("ERROR: CSendingDialog : wtxNew.AcceptTransaction() %s failed\n", wtx.GetHash().ToString().c_str());\r
wtx.RelayWalletTransaction();\r
\r
- Status("Waiting for confirmation...");\r
+ Status(_("Waiting for confirmation..."));\r
MainFrameRepaint();\r
}\r
}\r
vRecv >> nRet;\r
if (nRet > 0)\r
{\r
- Error("The payment was sent, but the recipient was unable to verify it.\n"\r
- "The transaction is recorded and will credit to the recipient,\n"\r
- "but the comment information will be blank.");\r
+ Error(_("The payment was sent, but the recipient was unable to verify it.\n"\r
+ "The transaction is recorded and will credit to the recipient,\n"\r
+ "but the comment information will be blank."));\r
return;\r
}\r
}\r
catch (...)\r
{\r
//// what do we want to do about this?\r
- Error("Payment was sent, but an invalid response was received");\r
+ Error(_("Payment was sent, but an invalid response was received"));\r
return;\r
}\r
\r
fSuccess = true;\r
fWorkDone = true;\r
- Status("Payment completed");\r
+ Status(_("Payment completed"));\r
}\r
\r
\r
CYourAddressDialog::CYourAddressDialog(wxWindow* parent, const string& strInitSelected) : CYourAddressDialogBase(parent)\r
{\r
// Init column headers\r
- m_listCtrl->InsertColumn(0, "Label", wxLIST_FORMAT_LEFT, 200);\r
- m_listCtrl->InsertColumn(1, "Bitcoin Address", wxLIST_FORMAT_LEFT, 350);\r
+ m_listCtrl->InsertColumn(0, _("Label"), wxLIST_FORMAT_LEFT, 200);\r
+ m_listCtrl->InsertColumn(1, _("Bitcoin Address"), wxLIST_FORMAT_LEFT, 350);\r
m_listCtrl->SetFocus();\r
\r
// Fill listctrl with address book data\r
return;\r
string strName = (string)m_listCtrl->GetItemText(nIndex);\r
string strAddress = (string)GetItemText(m_listCtrl, nIndex, 1);\r
- CGetTextFromUserDialog dialog(this, "Edit Address Label", "New Label", strName);\r
+ CGetTextFromUserDialog dialog(this, _("Edit Address Label"), _("New Label"), strName);\r
if (!dialog.ShowModal())\r
return;\r
strName = dialog.GetValue();\r
void CYourAddressDialog::OnButtonNew(wxCommandEvent& event)\r
{\r
// Ask name\r
- CGetTextFromUserDialog dialog(this, "New Bitcoin Address", "Label", "");\r
+ CGetTextFromUserDialog dialog(this, _("New Bitcoin Address"), _("Label"), "");\r
if (!dialog.ShowModal())\r
return;\r
string strName = dialog.GetValue();\r
m_buttonCancel->Show(false);\r
\r
// Init column headers\r
- m_listCtrl->InsertColumn(0, "Name", wxLIST_FORMAT_LEFT, 200);\r
- m_listCtrl->InsertColumn(1, "Address", wxLIST_FORMAT_LEFT, 350);\r
+ m_listCtrl->InsertColumn(0, _("Name"), wxLIST_FORMAT_LEFT, 200);\r
+ m_listCtrl->InsertColumn(1, _("Address"), wxLIST_FORMAT_LEFT, 350);\r
m_listCtrl->SetFocus();\r
\r
// Set Icon\r
uint160 hash160;\r
bool fMine = (AddressToHash160(strAddress, hash160) && mapPubKeys.count(hash160));\r
if (fMine)\r
- wxMessageBox("This is one of your own addresses for receiving payments and cannot be entered in the address book. ", strTitle);\r
+ wxMessageBox(_("This is one of your own addresses for receiving payments and cannot be entered in the address book. "), strTitle);\r
return fMine;\r
}\r
\r
string strAddressOrg = strAddress;\r
do\r
{\r
- CGetTextFromUserDialog dialog(this, "Edit Address", "Name", strName, "Address", strAddress);\r
+ CGetTextFromUserDialog dialog(this, _("Edit Address"), _("Name"), strName, _("Address"), strAddress);\r
if (!dialog.ShowModal())\r
return;\r
strName = dialog.GetValue1();\r
strAddress = dialog.GetValue2();\r
}\r
- while (CheckIfMine(strAddress, "Edit Address"));\r
+ while (CheckIfMine(strAddress, _("Edit Address")));\r
\r
// Change name\r
if (strAddress != strAddressOrg)\r
string strAddress;\r
do\r
{\r
- CGetTextFromUserDialog dialog(this, "New Address", "Name", strName, "Address", strAddress);\r
+ CGetTextFromUserDialog dialog(this, _("New Address"), _("Name"), strName, _("Address"), strAddress);\r
if (!dialog.ShowModal())\r
return;\r
strName = dialog.GetValue1();\r
strAddress = dialog.GetValue2();\r
}\r
- while (CheckIfMine(strAddress, "New Address"));\r
+ while (CheckIfMine(strAddress, _("New Address")));\r
\r
// Add to list and select it\r
SetAddressBookName(strAddress, strName);\r
static char pszPrevTip[200];\r
if (fShow)\r
{\r
- string strTooltip = "Bitcoin";\r
+ string strTooltip = _("Bitcoin");\r
if (fGenerateBitcoins)\r
- strTooltip = "Bitcoin - Generating";\r
+ strTooltip = _("Bitcoin - Generating");\r
if (fGenerateBitcoins && vNodes.empty())\r
- strTooltip = "Bitcoin - (not connected)";\r
+ strTooltip = _("Bitcoin - (not connected)");\r
\r
// Optimization, only update when changed, using char array to be reentrant\r
if (strncmp(pszPrevTip, strTooltip.c_str(), sizeof(pszPrevTip)-1) != 0)\r
wxMenu* CMyTaskBarIcon::CreatePopupMenu()\r
{\r
wxMenu* pmenu = new wxMenu;\r
- pmenu->Append(ID_TASKBAR_RESTORE, "&Open Bitcoin");\r
- pmenu->Append(ID_TASKBAR_OPTIONS, "O&ptions...");\r
- pmenu->AppendCheckItem(ID_TASKBAR_GENERATE, "&Generate Coins")->Check(fGenerateBitcoins);\r
+ pmenu->Append(ID_TASKBAR_RESTORE, _("&Open Bitcoin"));\r
+ pmenu->Append(ID_TASKBAR_OPTIONS, _("O&ptions..."));\r
+ pmenu->AppendCheckItem(ID_TASKBAR_GENERATE, _("&Generate Coins"))->Check(fGenerateBitcoins);\r
#ifndef __WXMAC_OSX__ // Mac has built-in quit menu\r
pmenu->AppendSeparator();\r
- pmenu->Append(ID_TASKBAR_EXIT, "E&xit");\r
+ pmenu->Append(ID_TASKBAR_EXIT, _("E&xit"));\r
#endif\r
return pmenu;\r
}\r
// Define a new application\r
class CMyApp: public wxApp\r
{\r
- public:\r
+public:\r
+ wxLocale m_locale;\r
+\r
CMyApp(){};\r
~CMyApp(){};\r
bool OnInit();\r
bool CMyApp::OnInit2()\r
{\r
#ifdef _MSC_VER\r
- // Turn off microsoft heap dump noise for now\r
+ // Turn off microsoft heap dump noise\r
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);\r
- _CrtSetReportFile(_CRT_WARN, CreateFile("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0));\r
+ _CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0));\r
#endif\r
#if defined(__WXMSW__) && defined(__WXDEBUG__)\r
// Disable malfunctioning wxWidgets debug assertion\r
SetAppName("bitcoin");\r
umask(077);\r
#endif\r
+#ifdef __WXMSW__\r
+#if wxUSE_UNICODE\r
+ // Hack to set wxConvLibc codepage to UTF-8 on Windows,\r
+ // may break if wxMBConv_win32 implementation in strconv.cpp changes.\r
+ class wxMBConv_win32 : public wxMBConv\r
+ {\r
+ public:\r
+ long m_CodePage;\r
+ size_t m_minMBCharWidth;\r
+ };\r
+ if (((wxMBConv_win32*)&wxConvLibc)->m_CodePage == CP_ACP)\r
+ ((wxMBConv_win32*)&wxConvLibc)->m_CodePage = CP_UTF8;\r
+#endif\r
+#endif\r
+\r
+ // Load locale/<lang>/LC_MESSAGES/bitcoin.mo language file\r
+ m_locale.Init(wxLANGUAGE_DEFAULT, 0);\r
+ m_locale.AddCatalogLookupPathPrefix("locale");\r
+ if (!fWindows)\r
+ {\r
+ m_locale.AddCatalogLookupPathPrefix("/usr/share/locale");\r
+ m_locale.AddCatalogLookupPathPrefix("/usr/local/share/locale");\r
+ }\r
+ m_locale.AddCatalog("wxstd"); // wxWidgets standard translations, if any\r
+ m_locale.AddCatalog("bitcoin");\r
\r
//\r
// Parameters\r
ParseParameters(argc, argv);\r
if (mapArgs.count("-?") || mapArgs.count("--help"))\r
{\r
-#ifdef __WXMSW__\r
- string strUsage =\r
- "Usage: bitcoin [options]\t\t\t\t\t\t\n"\r
- "Options:\n"\r
- " -gen\t\t Generate coins\n"\r
- " -gen=0\t\t Don't generate coins\n"\r
- " -min\t\t Start minimized\n"\r
- " -datadir=<dir>\t Specify data directory\n"\r
- " -proxy=<ip:port>\t Connect through socks4 proxy\n"\r
- " -addnode=<ip>\t Add a node to connect to\n"\r
- " -connect=<ip>\t Connect only to the specified node\n"\r
- " -?\t\t This help message\n";\r
- wxMessageBox(strUsage, "Bitcoin", wxOK);\r
-#else\r
- string strUsage =\r
- "Usage: bitcoin [options]\n"\r
- "Options:\n"\r
- " -gen Generate coins\n"\r
- " -gen=0 Don't generate coins\n"\r
- " -min Start minimized\n"\r
- " -datadir=<dir> Specify data directory\n"\r
- " -proxy=<ip:port> Connect through socks4 proxy\n"\r
- " -addnode=<ip> Add a node to connect to\n"\r
- " -connect=<ip> Connect only to the specified node\n"\r
- " -? This help message\n";\r
- fprintf(stderr, "%s", strUsage.c_str());\r
-#endif\r
+ wxString strUsage = string() +\r
+ _("Usage: bitcoin [options]") + "\t\t\t\t\t\t\n" +\r
+ _("Options:\n") +\r
+ " -gen \t\t " + _("Generate coins\n") +\r
+ " -gen=0 \t\t " + _("Don't generate coins\n") +\r
+ " -min \t\t " + _("Start minimized\n") +\r
+ " -datadir=<dir> \t " + _("Specify data directory\n") +\r
+ " -proxy=<ip:port>\t " + _("Connect through socks4 proxy\n") +\r
+ " -addnode=<ip> \t " + _("Add a node to connect to\n") +\r
+ " -connect=<ip> \t " + _("Connect only to the specified node\n") +\r
+ " -? \t\t " + _("This help message\n");\r
+\r
+ if (fWindows)\r
+ {\r
+ // Remove spaces, the tabs make the columns line up in the message box\r
+ for (int i = 0; i < 50; i++)\r
+ strUsage.Replace(" \t", "\t");\r
+ wxMessageBox(strUsage, "Bitcoin", wxOK);\r
+ }\r
+ else\r
+ {\r
+ // Remove tabs\r
+ strUsage.Replace("\t", "");\r
+ fprintf(stderr, "%s", ((string)strUsage).c_str());\r
+ }\r
return false;\r
}\r
\r
if (!fDebug && !pszSetDataDir[0])\r
ShrinkDebugFile();\r
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");\r
- printf("Bitcoin version %d%s, OS version %s\n", VERSION, pszSubVer, ((string)wxGetOsDescription()).c_str());\r
+ printf("Bitcoin version 0.%d.%d%s beta, OS version %s\n", VERSION/100, VERSION%100, pszSubVer, ((string)wxGetOsDescription()).c_str());\r
+ printf("System default language is %d %s\n", m_locale.GetSystemLanguage(), ((string)m_locale.GetSysName()).c_str());\r
+ printf("Language file %s (%s)\n", (string("locale/") + (string)m_locale.GetCanonicalName() + "/LC_MESSAGES/bitcoin.mo").c_str(), ((string)m_locale.GetLocale()).c_str());\r
\r
if (mapArgs.count("-loadblockindextest"))\r
{\r
{\r
// TODO: find out how to do this in Linux, or replace with wxWidgets commands\r
// Show the previous instance and exit\r
- HWND hwndPrev = FindWindow("wxWindowClassNR", "Bitcoin");\r
+ HWND hwndPrev = FindWindowA("wxWindowClassNR", "Bitcoin");\r
if (hwndPrev)\r
{\r
if (IsIconic(hwndPrev))\r
printf("Loading addresses...\n");\r
nStart = GetTimeMillis();\r
if (!LoadAddresses())\r
- strErrors += "Error loading addr.dat \n";\r
+ strErrors += _("Error loading addr.dat \n");\r
printf(" addresses %15"PRI64d"ms\n", GetTimeMillis() - nStart);\r
\r
printf("Loading block index...\n");\r
nStart = GetTimeMillis();\r
if (!LoadBlockIndex())\r
- strErrors += "Error loading blkindex.dat \n";\r
+ strErrors += _("Error loading blkindex.dat \n");\r
printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart);\r
\r
printf("Loading wallet...\n");\r
nStart = GetTimeMillis();\r
if (!LoadWallet(fFirstRun))\r
- strErrors += "Error loading wallet.dat \n";\r
+ strErrors += _("Error loading wallet.dat \n");\r
printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart);\r
\r
printf("Done loading\n");\r
addrProxy = CAddress(mapArgs["-proxy"]);\r
if (!addrProxy.IsValid())\r
{\r
- wxMessageBox("Invalid -proxy address", "Bitcoin");\r
+ wxMessageBox(_("Invalid -proxy address"), "Bitcoin");\r
return false;\r
}\r
}\r
\r
void CMyApp::OnFatalException()\r
{\r
- wxMessageBox("Program has crashed and will terminate. ", "Bitcoin", wxOK | wxICON_ERROR);\r
+ wxMessageBox(_("Program has crashed and will terminate. "), "Bitcoin", wxOK | wxICON_ERROR);\r
}\r
\r
\r
char pszPath[MAX_PATH+100] = "";\r
\r
// SHGetSpecialFolderPath is not usually available on NT 4.0\r
- HMODULE hShell32 = LoadLibrary("shell32.dll");\r
+ HMODULE hShell32 = LoadLibraryA("shell32.dll");\r
if (hShell32)\r
{\r
PSHGETSPECIALFOLDERPATHA pSHGetSpecialFolderPath =\r
if (SUCCEEDED(hres))\r
{\r
// Get the current executable path\r
- char pszExePath[MAX_PATH];\r
+ TCHAR pszExePath[MAX_PATH];\r
GetModuleFileName(NULL, pszExePath, sizeof(pszExePath));\r
\r
// Set the path to the shortcut target\r
<property name="font"></property>\r
<property name="hidden">0</property>\r
<property name="id">wxID_ANY</property>\r
- <property name="label">Test panel 2 for future expansion</property>\r
+ <property name="label">// [don't translate] Test panel 2 for future expansion</property>\r
<property name="maximum_size"></property>\r
<property name="minimum_size"></property>\r
<property name="name">m_staticText321</property>\r
<property name="font"></property>\r
<property name="hidden">0</property>\r
<property name="id">wxID_ANY</property>\r
- <property name="label">Let's not start multiple pages until the first page is filled up</property>\r
+ <property name="label">// [don't translate] Let's not start multiple pages until the first page is filled up</property>\r
<property name="maximum_size"></property>\r
<property name="minimum_size"></property>\r
<property name="name">m_staticText69</property>\r
<event name="OnUpdateUI"></event>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
- <property name="border">5</property>\r
- <property name="flag">wxALL</property>\r
- <property name="proportion">0</property>\r
- <object class="wxStaticText" expanded="1">\r
- <property name="bg"></property>\r
- <property name="context_help"></property>\r
- <property name="enabled">1</property>\r
- <property name="fg"></property>\r
- <property name="font"></property>\r
- <property name="hidden">0</property>\r
- <property name="id">wxID_ANY</property>\r
- <property name="label">MyLabel</property>\r
- <property name="maximum_size"></property>\r
- <property name="minimum_size"></property>\r
- <property name="name">m_staticText70</property>\r
- <property name="permission">protected</property>\r
- <property name="pos"></property>\r
- <property name="size"></property>\r
- <property name="style"></property>\r
- <property name="subclass"></property>\r
- <property name="tooltip"></property>\r
- <property name="window_extra_style"></property>\r
- <property name="window_name"></property>\r
- <property name="window_style"></property>\r
- <property name="wrap">-1</property>\r
- <event name="OnChar"></event>\r
- <event name="OnEnterWindow"></event>\r
- <event name="OnEraseBackground"></event>\r
- <event name="OnKeyDown"></event>\r
- <event name="OnKeyUp"></event>\r
- <event name="OnKillFocus"></event>\r
- <event name="OnLeaveWindow"></event>\r
- <event name="OnLeftDClick"></event>\r
- <event name="OnLeftDown"></event>\r
- <event name="OnLeftUp"></event>\r
- <event name="OnMiddleDClick"></event>\r
- <event name="OnMiddleDown"></event>\r
- <event name="OnMiddleUp"></event>\r
- <event name="OnMotion"></event>\r
- <event name="OnMouseEvents"></event>\r
- <event name="OnMouseWheel"></event>\r
- <event name="OnPaint"></event>\r
- <event name="OnRightDClick"></event>\r
- <event name="OnRightDown"></event>\r
- <event name="OnRightUp"></event>\r
- <event name="OnSetFocus"></event>\r
- <event name="OnSize"></event>\r
- <event name="OnUpdateUI"></event>\r
- </object>\r
- </object>\r
- <object class="sizeritem" expanded="1">\r
- <property name="border">5</property>\r
- <property name="flag">wxALL</property>\r
- <property name="proportion">0</property>\r
- <object class="wxStaticText" expanded="1">\r
- <property name="bg"></property>\r
- <property name="context_help"></property>\r
- <property name="enabled">1</property>\r
- <property name="fg"></property>\r
- <property name="font"></property>\r
- <property name="hidden">0</property>\r
- <property name="id">wxID_ANY</property>\r
- <property name="label">MyLabel</property>\r
- <property name="maximum_size"></property>\r
- <property name="minimum_size"></property>\r
- <property name="name">m_staticText71</property>\r
- <property name="permission">protected</property>\r
- <property name="pos"></property>\r
- <property name="size"></property>\r
- <property name="style"></property>\r
- <property name="subclass"></property>\r
- <property name="tooltip"></property>\r
- <property name="window_extra_style"></property>\r
- <property name="window_name"></property>\r
- <property name="window_style"></property>\r
- <property name="wrap">-1</property>\r
- <event name="OnChar"></event>\r
- <event name="OnEnterWindow"></event>\r
- <event name="OnEraseBackground"></event>\r
- <event name="OnKeyDown"></event>\r
- <event name="OnKeyUp"></event>\r
- <event name="OnKillFocus"></event>\r
- <event name="OnLeaveWindow"></event>\r
- <event name="OnLeftDClick"></event>\r
- <event name="OnLeftDown"></event>\r
- <event name="OnLeftUp"></event>\r
- <event name="OnMiddleDClick"></event>\r
- <event name="OnMiddleDown"></event>\r
- <event name="OnMiddleUp"></event>\r
- <event name="OnMotion"></event>\r
- <event name="OnMouseEvents"></event>\r
- <event name="OnMouseWheel"></event>\r
- <event name="OnPaint"></event>\r
- <event name="OnRightDClick"></event>\r
- <event name="OnRightDown"></event>\r
- <event name="OnRightUp"></event>\r
- <event name="OnSetFocus"></event>\r
- <event name="OnSize"></event>\r
- <event name="OnUpdateUI"></event>\r
- </object>\r
- </object>\r
</object>\r
</object>\r
</object>\r
<property name="font"></property>\r
<property name="hidden">0</property>\r
<property name="id">wxID_ANY</property>\r
- <property name="label">Copyright © 2009-2010 Satoshi Nakamoto.

This is experimental software. Do not rely on it for actual financial transactions.

Distributed under the MIT/X11 software license, see the accompanying file 
license.txt or http://www.opensource.org/licenses/mit-license.php.

This product includes software developed by the OpenSSL Project for use in the 
OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by 
Eric Young (eay@cryptsoft.com).</property>\r
+ <property name="label">Copyright (c) 2009-2010 Satoshi Nakamoto.

This is experimental software. Do not rely on it for actual financial transactions.

Distributed under the MIT/X11 software license, see the accompanying file 
license.txt or http://www.opensource.org/licenses/mit-license.php.

This product includes software developed by the OpenSSL Project for use in the 
OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by 
Eric Young (eay@cryptsoft.com).</property>\r
<property name="maximum_size"></property>\r
<property name="minimum_size"></property>\r
<property name="name">m_staticTextMain</property>\r