diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5380bf2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs/website/themes/universal"] + path = docs/website/themes/universal + url = https://github.com/devcows/hugo-universal-theme diff --git a/docs/website/archetypes/default.md b/docs/website/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/docs/website/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/docs/website/config.toml b/docs/website/config.toml new file mode 100644 index 0000000..53c7eb4 --- /dev/null +++ b/docs/website/config.toml @@ -0,0 +1,4 @@ +baseURL = "http://example.org/" +languageCode = "en-us" +title = "My New Hugo Site" +theme = "universal" diff --git a/docs/website/themes/universal b/docs/website/themes/universal new file mode 160000 index 0000000..a94d55b --- /dev/null +++ b/docs/website/themes/universal @@ -0,0 +1 @@ +Subproject commit a94d55b11da3a474e06691bff8d266601ce7f87c diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 41f793a..2b2d0e1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -462,9 +462,9 @@ void MainWindow::donate() { Settings::getInstance()->isSaplingAddress(ui->inputsCombo->currentText()))); ui->Address1->setCursorPosition(0); ui->Amount1->setText("0.01"); - ui->MemoTxt1->setText("Thanks for supporting zec-qt-wallet!"); + ui->MemoTxt1->setText(tr("Thanks for supporting zec-qt-wallet!")); - ui->statusBar->showMessage("Donate 0.01 " % Settings::getTokenName() % " to support zec-qt-wallet"); + ui->statusBar->showMessage(tr("Donate 0.01 ") % Settings::getTokenName() % tr(" to support zec-qt-wallet")); // And switch to the send tab. ui->tabWidget->setCurrentIndex(1); @@ -500,7 +500,7 @@ void MainWindow::postToZBoard() { // Testnet warning if (Settings::getInstance()->isTestnet()) { - zb.testnetWarning->setText("You are on testnet, your post won't actually appear on z-board.net"); + zb.testnetWarning->setText(tr("You are on testnet, your post won't actually appear on z-board.net")); } else { zb.testnetWarning->setText(""); @@ -556,7 +556,7 @@ void MainWindow::postToZBoard() { // Send from your first sapling address that has a balance. tx.fromAddr = zb.fromAddr->currentText(); if (tx.fromAddr.isEmpty()) { - QMessageBox::critical(this, "Error Posting Message", "You need a sapling address with available balance to post", QMessageBox::Ok); + QMessageBox::critical(this, "Error Posting Message", tr("You need a sapling address with available balance to post"), QMessageBox::Ok); return; } @@ -575,7 +575,7 @@ void MainWindow::postToZBoard() { // And send the Tx rpc->sendZTransaction(params, [=](const json& reply) { QString opid = QString::fromStdString(reply.get()); - ui->statusBar->showMessage("Computing Tx: " % opid); + ui->statusBar->showMessage(tr("Computing Tx: ") % opid); // And then start monitoring the transaction rpc->addNewTxToWatch(tx, opid); @@ -593,9 +593,9 @@ void MainWindow::doImport(QList* keys) { delete keys; QMessageBox::information(this, - "Imported", "The keys were imported. It may take several minutes to rescan the blockchain. Until then, functionality may be limited", + "Imported", tr("The keys were imported. It may take several minutes to rescan the blockchain. Until then, functionality may be limited"), QMessageBox::Ok); - ui->statusBar->showMessage("Private key import rescan finished"); + ui->statusBar->showMessage(tr("Private key import rescan finished")); return; } @@ -622,7 +622,7 @@ void MainWindow::importPrivKey() { pui.buttonBox->button(QDialogButtonBox::Save)->setVisible(false); pui.helpLbl->setText(QString() % "Please paste your private keys (z-Addr or t-Addr) here, one per line.\n" % - "The keys will be imported into your connected zcashd node"); + tr("The keys will be imported into your connected zcashd node")); if (d.exec() == QDialog::Accepted && !pui.privKeyTxt->toPlainText().trimmed().isEmpty()) { auto rawkeys = pui.privKeyTxt->toPlainText().trimmed().split("\n"); @@ -661,8 +661,8 @@ void MainWindow::backupWalletDat() { QFile wallet(zcashdir.filePath("wallet.dat")); if (!wallet.exists()) { - QMessageBox::critical(this, "No wallet.dat", "Couldn't find the wallet.dat on this computer." - "You need to back it up from the machine zcashd is running on", QMessageBox::Ok); + QMessageBox::critical(this, "No wallet.dat", tr("Couldn't find the wallet.dat on this computer.\n") + + tr("You need to back it up from the machine zcashd is running on"), QMessageBox::Ok); return; } @@ -671,8 +671,8 @@ void MainWindow::backupWalletDat() { return; if (!wallet.copy(backupName.toLocalFile())) { - QMessageBox::critical(this, "Couldn't backup", "Couldn't backup the wallet.dat file." - "You need to back it up manually.", QMessageBox::Ok); + QMessageBox::critical(this, "Couldn't backup", tr("Couldn't backup the wallet.dat file.") + + tr("You need to back it up manually."), QMessageBox::Ok); } } @@ -694,14 +694,14 @@ void MainWindow::exportKeys(QString addr) { Settings::saveRestore(&d); - pui.privKeyTxt->setPlainText("Loading..."); + pui.privKeyTxt->setPlainText(tr("Loading...")); pui.privKeyTxt->setReadOnly(true); pui.privKeyTxt->setLineWrapMode(QPlainTextEdit::LineWrapMode::NoWrap); if (allKeys) - pui.helpLbl->setText("These are all the private keys for all the addresses in your wallet"); + pui.helpLbl->setText(tr("These are all the private keys for all the addresses in your wallet")); else - pui.helpLbl->setText("Private key for " + addr); + pui.helpLbl->setText(tr("Private key for ") + addr); // Disable the save button until it finishes loading pui.buttonBox->button(QDialogButtonBox::Save)->setEnabled(false); @@ -808,13 +808,13 @@ void MainWindow::setupBalancesTab() { QMenu menu(this); - menu.addAction("Copy address", [=] () { + menu.addAction(tr("Copy address"), [=] () { QClipboard *clipboard = QGuiApplication::clipboard(); clipboard->setText(addr); - ui->statusBar->showMessage("Copied to clipboard", 3 * 1000); + ui->statusBar->showMessage(tr("Copied to clipboard"), 3 * 1000); }); - menu.addAction("Get private key", [=] () { + menu.addAction(tr("Get private key"), [=] () { this->exportKeys(addr); }); @@ -825,12 +825,12 @@ void MainWindow::setupBalancesTab() { if (addr.startsWith("t")) { auto defaultSapling = rpc->getDefaultSaplingAddress(); if (!defaultSapling.isEmpty()) { - menu.addAction("Shield balance to Sapling", [=] () { + menu.addAction(tr("Shield balance to Sapling"), [=] () { fnDoSendFrom(addr, defaultSapling, true); }); } - menu.addAction("View on block explorer", [=] () { + menu.addAction(tr("View on block explorer"), [=] () { QString url; if (Settings::getInstance()->isTestnet()) { url = "https://explorer.testnet.z.cash/address/" + addr; @@ -842,7 +842,7 @@ void MainWindow::setupBalancesTab() { } if (Settings::getInstance()->isSproutAddress(addr)) { - menu.addAction("Migrate to Sapling", [=] () { + menu.addAction(tr("Migrate to Sapling"), [=] () { this->turnstileDoMigration(addr); }); } @@ -862,7 +862,7 @@ void MainWindow::setupTransactionsTab() { QString memo = txModel->getMemo(index.row()); if (!memo.isEmpty()) { - QMessageBox::information(this, "Memo", memo, QMessageBox::Ok); + QMessageBox::information(this, tr("Memo"), memo, QMessageBox::Ok); } }); @@ -881,19 +881,19 @@ void MainWindow::setupTransactionsTab() { QString memo = txModel->getMemo(index.row()); QString addr = txModel->getAddr(index.row()); - menu.addAction("Copy txid", [=] () { + menu.addAction(tr("Copy txid"), [=] () { QGuiApplication::clipboard()->setText(txid); - ui->statusBar->showMessage("Copied to clipboard", 3 * 1000); + ui->statusBar->showMessage(tr("Copied to clipboard"), 3 * 1000); }); if (!addr.isEmpty()) { - menu.addAction("Copy address", [=] () { + menu.addAction(tr("Copy address"), [=] () { QGuiApplication::clipboard()->setText(addr); - ui->statusBar->showMessage("Copied to clipboard", 3 * 1000); + ui->statusBar->showMessage(tr("Copied to clipboard"), 3 * 1000); }); } - menu.addAction("View on block explorer", [=] () { + menu.addAction(tr("View on block explorer"), [=] () { QString url; if (Settings::getInstance()->isTestnet()) { url = "https://explorer.testnet.z.cash/tx/" + txid; @@ -904,8 +904,8 @@ void MainWindow::setupTransactionsTab() { }); if (!memo.isEmpty()) { - menu.addAction("View Memo", [=] () { - QMessageBox::information(this, "Memo", memo, QMessageBox::Ok); + menu.addAction(tr("View Memo"), [=] () { + QMessageBox::information(this, tr("Memo"), memo, QMessageBox::Ok); }); } @@ -968,7 +968,7 @@ void MainWindow::setupRecieveTab() { ui->listRecieveAddresses->insertItem(0, addr); ui->listRecieveAddresses->setCurrentIndex(0); - ui->statusBar->showMessage("Created new t-Addr", 10 * 1000); + ui->statusBar->showMessage(tr("Created new t-Addr"), 10 * 1000); } }); }; diff --git a/src/rpc.cpp b/src/rpc.cpp index c4d780c..942b806 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -345,7 +345,7 @@ void RPC::noConnection() { QIcon i = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical); main->statusIcon->setPixmap(i.pixmap(16, 16)); main->statusIcon->setToolTip(""); - main->statusLabel->setText("No Connection"); + main->statusLabel->setText(QObject::tr("No Connection")); main->statusLabel->setToolTip(""); main->ui->statusBar->showMessage("No Connection", 1000);